Skip to content

Investigate into a way to consolidate reconcile the Allocator trait and a collection trait #11

@nekevss

Description

@nekevss

The allocator_api2 crate exposes Rust's Allocator trait, which is an experimental trait for defining allocators.

It would be interesting if we were able to take advantage of the Allocator trait with a Collector super trait of our own. Something akin to:

trait Collector : Allocator { 
    // Methods to be determined.
}

This would mean that we could use third party collection libraries that expose an allocator API of their own.

Potential concerns

  • Is doing this even possible in a generic way across multiple collectors?
  • Is it even safe to do this and use collections that may not be properly designed for this use case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs researchNeeds further research or investigation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions