pub struct RefMut<'a, T, U = T>where
    T: 'static + Trace + ?Sized,
    U: ?Sized,
{ /* private fields */ }
Expand description

A wrapper type for a mutably borrowed value from a GcCell<T>.

Implementations

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.

Examples
use gc::{GcCell, GcCellRefMut};

let c = GcCell::new((5, 'b'));
{
    let b1: GcCellRefMut<(u32, char)> = c.borrow_mut();
    let mut b2: GcCellRefMut<(u32, char), u32> = GcCellRefMut::map(b1, |t| &mut t.0);
    assert_eq!(*b2, 5);
    *b2 = 42;
}
assert_eq!(*c.borrow(), (42, 'b'));

Trait Implementations

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.