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: Clone> RefVal<'b, T>
impl<'b, T: Clone> RefVal<'b, T>
sourcepub fn clone(orig: &RefVal<'b, T>) -> RefVal<'b, T>
pub fn clone(orig: &RefVal<'b, T>) -> RefVal<'b, T>
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
.