Struct pinned_init::PinInitClosure
source · [−]pub struct PinInitClosure<F, T, E>(_, _);Expand description
A closure initializer for pinned data.
Implementations
sourceimpl<T, E, F> PinInitClosure<F, T, E>where
F: FnOnce(*mut T) -> Result<(), E>,
impl<T, E, F> PinInitClosure<F, T, E>where
F: FnOnce(*mut T) -> Result<(), E>,
sourcepub const unsafe fn from_closure(f: F) -> Self
pub const unsafe fn from_closure(f: F) -> Self
Creates a new Init from the given closure
Safety
The closure
- returns
Ok(())iff it initialized every field of place, - returns
Err(err)iff it encountered an error and then cleaned place, this means:- place can be deallocated without UB ocurring,
- place does not need to be dropped,
- place is not partially initialized.
Trait Implementations
Auto Trait Implementations
impl<F, T, E> RefUnwindSafe for PinInitClosure<F, T, E>where
F: RefUnwindSafe,
impl<F, T, E> Send for PinInitClosure<F, T, E>where
F: Send,
impl<F, T, E> Sync for PinInitClosure<F, T, E>where
F: Sync,
impl<F, T, E> Unpin for PinInitClosure<F, T, E>where
F: Unpin,
impl<F, T, E> UnwindSafe for PinInitClosure<F, T, E>where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more