Crate stack_ptr

Source
Expand description

Provides StackPtr, an owned pointer to stack-allocated data. Create one using the provided stack_ptr! macro:

stack_ptr! {
    let slice: StackPtr<[_]> = StackPtr::new([1,2,3,4,5]);
}

Macros§

coerce_stackptr
An implementation of std::ops::CoerceUnsized on stable rust. On nightly, you can convert a StackPtr<T> into a StackPtr<U> if T implements U, with let sp = sp as StackPtr<U>;, but this requires the unstable CoerceUnsized trait. On stable you can do let sp = coerce_stackptr!(sp, U);.
stack_ptr
Safely declares a StackPtr<$ty> with an appropriate lifetime to the data contained in $expr.

Structs§

StackPtr
An owning pointer to stack-allocated data. Similar to Box, except Box is heap-allocated.