pub struct GcRefMut<'a, T: ?Sized + 'static, U: ?Sized = T> { /* private fields */ }
Expand description
A wrapper type for a mutably borrowed value from a GcCell<T>
.
Implementations§
source§impl<'a, T: ?Sized, U: ?Sized> GcRefMut<'a, T, U>
impl<'a, T: ?Sized, U: ?Sized> GcRefMut<'a, T, U>
sourcepub fn try_map<V, F>(orig: Self, f: F) -> Option<GcRefMut<'a, T, V>>
pub fn try_map<V, F>(orig: Self, f: F) -> Option<GcRefMut<'a, T, V>>
Tries to make a new GcCellRefMut
for a component of the borrowed data, returning None
if the mapping function returns None
.
The GcCellRefMut
is already mutably borrowed, so this cannot fail.
This is an associated function that needs to be used as
GcCellRefMut::map(...)
. A method would interfere with methods of the same
name on the contents of a GcCell
used through Deref
.
sourcepub fn map<V, F>(orig: Self, f: F) -> GcRefMut<'a, T, V>
pub fn map<V, F>(orig: Self, f: F) -> GcRefMut<'a, T, V>
Makes a new GcCellRefMut
for a component of the borrowed data, e.g., an enum
variant.
The GcCellRefMut
is already mutably borrowed, so this cannot fail.
This is an associated function that needs to be used as
GcCellRefMut::map(...)
. A method would interfere with methods of the same
name on the contents of a GcCell
used through Deref
.