Struct moveit::stackbox::Slot[][src]

pub struct Slot<'frame, T>(_);

An empty slot on the stack into which a value could be emplaced.

The 'frame lifetime refers to the lifetime of the stack frame this Slot’s storage is allocated on.

See slot!.

Implementations

impl<'frame, T> Slot<'frame, T>[src]

pub unsafe fn new_unchecked(ptr: &'frame mut MaybeUninit<T>) -> Self[src]

Creates a new Slot with the given pointer as its basis.

To safely construct a Slot, use slot!.

Safety

ptr must not be outlived by any other pointers to its allocation.

pub fn put(self, val: T) -> StackBox<'frame, T>[src]

Put val into this slot, returning a new StackBox.

The stackbox! macro is a shorthand for this function.

pub fn pin(self, val: T) -> Pin<StackBox<'frame, T>>[src]

Pin val into this slot, returning a new, pinned StackBox.

pub fn emplace<C: Ctor<Output = T>>(self, ctor: C) -> Pin<StackBox<'frame, T>>[src]

Emplace ctor into this slot, returning a new, pinned StackBox.

The emplace! macro is a shorthand for this function.

pub fn try_emplace<C: TryCtor<Output = T>>(
    self,
    ctor: C
) -> Result<Pin<StackBox<'frame, T>>, C::Error>
[src]

Try to emplace ctor into this slot, returning a new, pinned StackBox.

Auto Trait Implementations

impl<'frame, T> Send for Slot<'frame, T> where
    T: Send

impl<'frame, T> Sync for Slot<'frame, T> where
    T: Sync

impl<'frame, T> Unpin for Slot<'frame, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.