Trait kernel::init::InPlaceInit
source · pub trait InPlaceInit<T>: Sized {
type PinnedSelf;
// Required methods
fn try_pin_init<E>(
init: impl PinInit<T, E>,
flags: Flags
) -> Result<Self::PinnedSelf, E>
where E: From<AllocError>;
fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E>
where E: From<AllocError>;
// Provided methods
fn pin_init<E>(
init: impl PinInit<T, E>,
flags: Flags
) -> Result<Self::PinnedSelf>
where Error: From<E> { ... }
fn init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self>
where Error: From<E> { ... }
}
Expand description
Smart pointer that can initialize memory in-place.
Required Associated Types§
sourcetype PinnedSelf
type PinnedSelf
Pinned version of Self
.
If a type already implicitly pins its pointee, Pin<Self>
is unnecessary. In this case use
Self
, otherwise just use Pin<Self>
.
Required Methods§
sourcefn try_pin_init<E>(
init: impl PinInit<T, E>,
flags: Flags
) -> Result<Self::PinnedSelf, E>where
E: From<AllocError>,
fn try_pin_init<E>(
init: impl PinInit<T, E>,
flags: Flags
) -> Result<Self::PinnedSelf, 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.
Provided Methods§
Object Safety§
This trait is not object safe.