pub struct Ref<'a, T: ?Sized + 'a> { /* private fields */ }
Expand description
An immutable reference to the value stored in a RefCell.
Implementations§
Source§impl<'a, T: ?Sized> Ref<'a, T>
impl<'a, T: ?Sized> Ref<'a, T>
Sourcepub fn clone(orig: &Ref<'a, T>) -> Ref<'a, T>
pub fn clone(orig: &Ref<'a, T>) -> Ref<'a, T>
Clone the provided Ref value. This is treated as a separate borrow record from the original cloned reference.
pub fn map<U: ?Sized, F>(orig: Ref<'a, T>, f: F) -> Ref<'a, U>
pub fn filter_map<U: ?Sized, F>( orig: Ref<'a, T>, f: F, ) -> Result<Ref<'a, U>, Self>
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Ref<'a, T>where
T: ?Sized,
impl<'a, T> !RefUnwindSafe for Ref<'a, T>
impl<'a, T> !Send for Ref<'a, T>
impl<'a, T> !Sync for Ref<'a, T>
impl<'a, T> Unpin for Ref<'a, T>where
T: ?Sized,
impl<'a, T> !UnwindSafe for Ref<'a, 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