FromBox

Trait FromBox 

Source
pub trait FromBox: Storage {
    // Required method
    fn from_box<T>(boxed: StdBox<T>) -> Self;
}
Available on crate feature alloc only.
Expand description

A storage that can be constructed from boxed data.

Required Methods§

Source

fn from_box<T>(boxed: StdBox<T>) -> Self

Constructs a new storage storing T.

Data may be moved out the box if it fits in the storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl FromBox for Box

Source§

impl<const SIZE: usize, const ALIGN: usize> FromBox for RawOrBox<SIZE, ALIGN>
where Align<ALIGN>: Alignment,