[−][src]Struct memur::N
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,
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,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,