pub struct TCell<Q, T: ?Sized> { /* private fields */ }
Available on crate feature
std
only.Expand description
Cell whose contents is owned (for borrowing purposes) by a
TCellOwner
.
To borrow from this cell, use the borrowing calls on the
TCellOwner
instance that shares the same marker type.
See also crate documentation.
Implementations
sourceimpl<Q, T: ?Sized> TCell<Q, T>
impl<Q, T: ?Sized> TCell<Q, T>
sourcepub fn ro<'a>(&'a self, owner: &'a TCellOwner<Q>) -> &'a T
pub fn ro<'a>(&'a self, owner: &'a TCellOwner<Q>) -> &'a T
Borrow contents of this cell immutably (read-only). Many
TCell
instances can be borrowed immutably at the same time
from the same owner.
sourcepub fn rw<'a>(&'a self, owner: &'a mut TCellOwner<Q>) -> &'a mut T
pub fn rw<'a>(&'a self, owner: &'a mut TCellOwner<Q>) -> &'a mut T
Borrow contents of this cell mutably (read-write). Only one
TCell
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 TCellOwner::rw2
or
TCellOwner::rw3
.
Trait Implementations
Auto Trait Implementations
impl<Q, T> !RefUnwindSafe for TCell<Q, T>
impl<Q, T: ?Sized> Send for TCell<Q, T> where
T: Send,
impl<Q, T: ?Sized> Unpin for TCell<Q, T> where
T: Unpin,
impl<Q, T: ?Sized> UnwindSafe for TCell<Q, 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