Struct stack_ptr::StackPtr [] [src]

pub struct StackPtr<'a, T: 'a + ?Sized> { /* fields omitted */ }

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

Methods

impl<'a, T: 'a + ?Sized> StackPtr<'a, T>
[src]

ptr must be a pointer to forgotten data on the stack, whose lifetime is at least as long as lifetime's lifetime. Better to just use the stack_ptr! macro.

an implementation of std::borrow::Borrow, where the returned reference has the same lifetime as self.

an implementation of std::borrow::BorrowMut, where the returned reference has the same lifetime as self.

Consumes a StackPtr without running its destructor, and returns a *mut pointer to the data, and a std::marker::PhantomData representing the lifetime of the StackPtr. Useful for doing a conversion on the pointer and reconstructing a StackPtr with from_raw_parts.

Constructs a new StackPtr from its raw parts. Usually called on the result of into_raw_parts.

Trait Implementations

impl<'a, T: ?Sized> Drop for StackPtr<'a, T>
[src]

A method called when the value goes out of scope. Read more

impl<'a, T: ?Sized> Debug for StackPtr<'a, T> where
    T: Debug
[src]

Formats the value using the given formatter.

impl<'a, T: ?Sized> Deref for StackPtr<'a, T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<'a, T: ?Sized> DerefMut for StackPtr<'a, T>
[src]

The method called to mutably dereference a value

impl<'a, T: 'a + Send + ?Sized> Send for StackPtr<'a, T>
[src]

impl<'a, T: 'a + Sync + ?Sized> Sync for StackPtr<'a, T>
[src]