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 aStackPtr<T>
into aStackPtr<U>
ifT
implementsU
, withlet sp = sp as StackPtr<U>;
, but this requires the unstableCoerceUnsized
trait. On stable you can dolet sp = coerce_stackptr!(sp, U);
. - stack_
ptr - Safely declares a StackPtr<$ty> with an appropriate lifetime to the data contained in $expr.
Structs§
- Stack
Ptr - An owning pointer to stack-allocated data. Similar to
Box
, exceptBox
is heap-allocated.