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]
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]
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]
T: Default,
Returns the value, replacing it with the default value.