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]

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]

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> Deref for StackBox<'_, T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMove for StackBox<'_, T>[src]

impl<T> DerefMut for StackBox<'_, T>[src]

impl<T> Drop for StackBox<'_, T>[src]

impl<T> OuterDrop for StackBox<'_, T>[src]

Auto Trait Implementations

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

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

impl<'frame, T> Unpin for StackBox<'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.