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]
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]
self,
ctor: C
) -> Result<Pin<StackBox<'frame, T>>, C::Error>
Try to emplace ctor
into this slot, returning a new, pinned StackBox
.