#erased #type-erasure #no-std

nightly no-std craft-eraser

A set of simple type-erased box primitives

7 releases

0.3.2 May 31, 2022
0.3.1 Dec 9, 2021
0.2.2 Dec 3, 2021
0.1.0 Dec 3, 2021

#469 in Memory management


Used in rebound

MIT/Apache

32KB
610 lines

Eraser

A set of handy type-erasure primitive tools for Rust.


lib.rs:

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.

No runtime deps