Crate craft_eraser

Crate craft_eraser 

Source
Expand description

Implementations of type-erasure tools, which store fully non-generic data on the heap.

Current features include:

§Erased Boxes

These are useful for cases where Box<dyn Any> doesn’t fulfill your needs, including non-'static data or wanting to store the data in one pointer even when unsized. As a trade-off, there is no safe way to retrieve the data, as the user must already know the type and lifetimes involved and verify them without the help of the compiler.

§Erased Pointer

The unowned equivalent to an erased box. Basically just a pointer-meta pair, that ensures the meta is handled correctly on destruction.

Re-exports§

pub use ebox::ErasedBox;
pub use eptr::ErasedNonNull;
pub use eptr::ErasedPtr;
pub use eref::ErasedMut;
pub use eref::ErasedRef;
pub use thin_ebox::ThinErasedBox;

Modules§

ebox
A standard erased box implementation, larger but simple implementation
eptr
Erased pointer types, all are 3 pointers wide
eref
Erased reference types, all are 3 pointers wide
thin_ebox
A more advanced erased box implementation, smaller but with a more complex implementation