Trait kernel::init::InPlaceInit

source ·
pub trait InPlaceInit<T>: Sized {
    // Required methods
    fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E>
       where E: From<AllocError>;
    fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E>
       where E: From<AllocError>;

    // Provided methods
    fn pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>>
       where Error: From<E> { ... }
    fn init<E>(init: impl Init<T, E>) -> Result<Self>
       where Error: From<E> { ... }
}
Expand description

Smart pointer that can initialize memory in-place.

Required Methods§

source

fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E>where E: From<AllocError>,

Use the given pin-initializer to pin-initialize a T inside of a new smart pointer of this type.

If T: !Unpin it will not be able to move afterwards.

source

fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E>where E: From<AllocError>,

Use the given initializer to in-place initialize a T.

Provided Methods§

source

fn pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>>where Error: From<E>,

Use the given pin-initializer to pin-initialize a T inside of a new smart pointer of this type.

If T: !Unpin it will not be able to move afterwards.

source

fn init<E>(init: impl Init<T, E>) -> Result<Self>where Error: From<E>,

Use the given initializer to in-place initialize a T.

Implementations on Foreign Types§

source§

impl<T> InPlaceInit<T> for Box<T>

source§

fn try_pin_init<E>(init: impl PinInit<T, E>) -> Result<Pin<Self>, E>where E: From<AllocError>,

source§

fn try_init<E>(init: impl Init<T, E>) -> Result<Self, E>where E: From<AllocError>,

Implementors§

source§

impl<T> InPlaceInit<T> for UniqueArc<T>

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.