Struct ghost_cell::GhostCell[][src]

pub struct GhostCell<'brand, T: ?Sized> { /* fields omitted */ }

Branded wrapper for the data structure’s nodes, whose type is T.

Implementations

impl<'brand, T> GhostCell<'brand, T>[src]

pub fn new(value: T) -> Self[src]

Wraps some data T into a GhostCell with brand'brand.

pub fn into_inner(self) -> T[src]

Turns an owned GhostCell back into owned data.

pub fn get_mut(&mut self) -> &mut T[src]

Turns a mutably borrowed GhostCell to mutably borrowed data.

pub fn from_mut(t: &mut T) -> &mut Self[src]

Turns mutably borrowed data to a mutably borrowed GhostCell.

pub fn borrow<'a>(&'a self, _: &'a GhostToken<'brand>) -> &'a T[src]

Immutably borrows the GhostCell with the same-branded token.

pub fn borrow_mut<'a>(&'a self, _: &'a mut GhostToken<'brand>) -> &'a mut T[src]

Mutably borrows the GhostCell with the same-branded token.

impl<'brand, T> GhostCell<'brand, T>[src]

pub fn replace(&self, value: T, token: &mut GhostToken<'brand>) -> T[src]

Returns the value, replacing it by the supplied one.

pub fn take(&self, token: &mut GhostToken<'brand>) -> T where
    T: Default
[src]

Returns the value, replacing it with the default value.

Auto Trait Implementations

impl<'brand, T: ?Sized> Send for GhostCell<'brand, T> where
    T: Send

impl<'brand, T> !Sync for GhostCell<'brand, T>

impl<'brand, T: ?Sized> Unpin for GhostCell<'brand, T> where
    T: Unpin

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.