bytemuck::allocation

Trait TransparentWrapperAlloc

Source
pub trait TransparentWrapperAlloc<Inner: ?Sized>: TransparentWrapper<Inner> {
    // Provided methods
    fn wrap_vec(s: Vec<Inner>) -> Vec<Self>
       where Self: Sized,
             Inner: Sized { ... }
    fn wrap_box(s: Box<Inner>) -> Box<Self> { ... }
    fn wrap_rc(s: Rc<Inner>) -> Rc<Self> { ... }
    fn wrap_arc(s: Arc<Inner>) -> Arc<Self> { ... }
    fn peel_vec(s: Vec<Self>) -> Vec<Inner>
       where Self: Sized,
             Inner: Sized { ... }
    fn peel_box(s: Box<Self>) -> Box<Inner> { ... }
    fn peel_rc(s: Rc<Self>) -> Rc<Inner> { ... }
    fn peel_arc(s: Arc<Self>) -> Arc<Inner> { ... }
}
Expand description

An extension trait for TransparentWrapper and alloc types.

Provided Methods§

Source

fn wrap_vec(s: Vec<Inner>) -> Vec<Self>
where Self: Sized, Inner: Sized,

Convert a vec of the inner type into a vec of the wrapper type.

Source

fn wrap_box(s: Box<Inner>) -> Box<Self>

Convert a box to the inner type into a box to the wrapper type.

Source

fn wrap_rc(s: Rc<Inner>) -> Rc<Self>

Convert an Rc to the inner type into an Rc to the wrapper type.

Source

fn wrap_arc(s: Arc<Inner>) -> Arc<Self>

Convert an Arc to the inner type into an Arc to the wrapper type.

Source

fn peel_vec(s: Vec<Self>) -> Vec<Inner>
where Self: Sized, Inner: Sized,

Convert a vec of the wrapper type into a vec of the inner type.

Source

fn peel_box(s: Box<Self>) -> Box<Inner>

Convert a box to the wrapper type into a box to the inner type.

Source

fn peel_rc(s: Rc<Self>) -> Rc<Inner>

Convert an Rc to the wrapper type into an Rc to the inner type.

Source

fn peel_arc(s: Arc<Self>) -> Arc<Inner>

Convert an Arc to the wrapper type into an Arc to the inner type.

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§