Fancyflame/stack_box (github.com)
stack_box - crates.io: Rust Package Registry
Features are similar to smallbox
and checked by Miri.
Interesting new features:
- Unsize coercion is 100% in safe rust
- A macro with which you can coerce a sized box into an unsized box by a simple call
coerce!(your_stack_box)
.
(StackBox<T, Ctnr> -> StackBox<dyn Trait, Ctnr>
) - A macro could easily make a
StackBox
type alias which could exactly contains some type.type StringBox<T> = FitStackBox!(T, String); StringBox::new("a".to_string()); // always works
- Static check if a value could be put into a
StackBox
, emit a compile time error if check is failed.
Please take a look at examples/basic.rs
!