Enum smallbox::SmallBox [] [src]

pub enum SmallBox<T: ?Sized> {
    Stack(StackBox<T>),
    Box(Box<T>),
}

Stack allocation with heap fallback

Examples

use smallbox::SmallBox;
 
let val: SmallBox<PartialEq<usize>> = SmallBox::new(5usize);
 
assert!(*val == 5)

Variants

Methods

impl<T: ?Sized> SmallBox<T>
[src]

Box val on stack or heap depending on its size

Trait Implementations

impl<T: ?Sized> Deref for SmallBox<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T: ?Sized> DerefMut for SmallBox<T>
[src]

The method called to mutably dereference a value