pub struct RefVal<'b, T> { /* private fields */ }
Expand description
A type containing a value that contains a borrowed reference to a
value from a RefCell<T>
.
See the module-level documentation for more.
Implementations§
Source§impl<'b, T> RefVal<'b, T>
impl<'b, T> RefVal<'b, T>
Sourcepub fn clone(orig: &RefVal<'b, T>) -> RefVal<'b, T>where
T: Clone,
pub fn clone(orig: &RefVal<'b, T>) -> RefVal<'b, T>where
T: Clone,
Copies a RefVal
.
The RefCell
is already immutably borrowed, so this cannot fail.
This is an associated function that needs to be used as
Ref::clone(...)
. A Clone
implementation or a method would interfere
with the widespread use of r.borrow().clone()
to clone the contents of
a RefCell
.
Trait Implementations§
Auto Trait Implementations§
impl<'b, T> Freeze for RefVal<'b, T>where
T: Freeze,
impl<'b, T> !RefUnwindSafe for RefVal<'b, T>
impl<'b, T> !Send for RefVal<'b, T>
impl<'b, T> !Sync for RefVal<'b, T>
impl<'b, T> Unpin for RefVal<'b, T>where
T: Unpin,
impl<'b, T> !UnwindSafe for RefVal<'b, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more