Struct moveit::stackbox::StackBox [−][src]
pub struct StackBox<'frame, T>(_);
A stack-based owning pointer.
The 'frame
lifetime refers to the lifetime of the stack frame this
StackBox
’s storage is allocated on.
This type is useful for when emplacement and move constructors are desired but no allocator is available.
Implementations
impl<'frame, T> StackBox<'frame, T>
[src]
impl<'frame, T> StackBox<'frame, T>
[src]pub fn new(val: T, slot: Slot<'frame, T>) -> Self
[src]
Alternate spelling for Slot::put()
.
pub fn pin(val: T, slot: Slot<'frame, T>) -> Pin<Self>
[src]
Alternate spelling for Slot::pin()
.
pub fn emplace<C: Ctor<Output = T>>(ctor: C, slot: Slot<'frame, T>) -> Pin<Self>
[src]
Alternate spelling for Slot::emplace()
.
pub fn try_emplace<C: TryCtor<Output = T>>(
ctor: C,
slot: Slot<'frame, T>
) -> Result<Pin<Self>, C::Error>
[src]
ctor: C,
slot: Slot<'frame, T>
) -> Result<Pin<Self>, C::Error>
Alternate spelling for Slot::try_emplace()
.
pub unsafe fn new_unchecked(ptr: &'frame mut T) -> Self
[src]
Creates a new StackBox
with the given pointer as its basis.
To safely construct a StackBox
, use emplace!
or stackbox!
.
Safety
ptr
must not be outlived by any other pointers to its allocation.
pub fn into_inner(this: Self) -> T
[src]
Consumes this StackBox
, returning the contents inside.
pub fn leak(this: Self) -> &'frame mut T
[src]
Consumes this StackBox
, returning the stack-bound reference inside.
This function is analogous to Box::leak()
; it is the caller’s
responsibility to call T
’s destructor.
Trait Implementations
impl<T> OuterDrop for StackBox<'_, T>
[src]
impl<T> OuterDrop for StackBox<'_, T>
[src]