pub struct LCell<'id, T: ?Sized> { /* private fields */ }
Expand description
Cell whose contents are owned (for borrowing purposes) by a
LCellOwner
.
To borrow from this cell, use the borrowing calls on the
LCellOwner
instance that owns it, i.e. that shares the same
Rust lifetime.
See also crate documentation.
Implementations
sourceimpl<'id, T: ?Sized> LCell<'id, T>
impl<'id, T: ?Sized> LCell<'id, T>
sourcepub fn ro<'a>(&'a self, owner: &'a LCellOwner<'id>) -> &'a T
pub fn ro<'a>(&'a self, owner: &'a LCellOwner<'id>) -> &'a T
Borrow contents of this cell immutably (read-only). Many
LCell
instances can be borrowed immutably at the same time
from the same owner.
sourcepub fn rw<'a>(&'a self, owner: &'a mut LCellOwner<'id>) -> &'a mut T
pub fn rw<'a>(&'a self, owner: &'a mut LCellOwner<'id>) -> &'a mut T
Borrow contents of this cell mutably (read-write). Only one
LCell
at a time can be borrowed from the owner using this
call. The returned reference must go out of scope before
another can be borrowed. To mutably borrow from two or three
cells at the same time, see LCellOwner::rw2
or
LCellOwner::rw3
.
Trait Implementations
Auto Trait Implementations
impl<'id, T> !RefUnwindSafe for LCell<'id, T>
impl<'id, T: ?Sized> Send for LCell<'id, T> where
T: Send,
impl<'id, T: ?Sized> Unpin for LCell<'id, T> where
T: Unpin,
impl<'id, T: ?Sized> UnwindSafe for LCell<'id, T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more