[][src]Struct memur::N

pub struct N<T> { /* fields omitted */ }

A wrapper of struct that is stored in arena memory.

Implementations

impl<T> N<T>[src]

pub fn new(arena: &Arena, value: T) -> Result<N<T>, UploadError>[src]

Stores the value in arena and returns a handle to it.

pub fn expect(&self, message: &str) -> (Arena, &T)[src]

Returns a reference to value or panics if arena is dead.

pub fn val(&self) -> Option<&T>[src]

Returns a reference to value if the arena is alive.

pub fn expect_mut(&self, message: &str) -> (Arena, &mut T)[src]

Returns a mutable reference to value or panics if arena is dead.

pub fn var(&mut self) -> Option<&mut T>[src]

Returns a mutable reference to value if the arena is alive.

pub fn outlives<O>(&self, value: O) -> Result<N<O>, UploadError>[src]

Puts another value to the same Arena and ensures that it is dropped only after this value is dropped, in other words, this struct should outlive the specified struct. Super useful for managing deterministic drop order.

Auto Trait Implementations

impl<T> RefUnwindSafe for N<T> where
    T: RefUnwindSafe

impl<T> !Send for N<T>

impl<T> !Sync for N<T>

impl<T> Unpin for N<T>

impl<T> UnwindSafe for N<T> where
    T: RefUnwindSafe

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.