Struct gc::GcCell
[−]
[src]
pub struct GcCell<T: ?Sized + 'static> { // some fields omitted }
A mutable memory location with dynamically checked borrow rules which can be used inside of a garbage collected pointer.
This object is a RefCell which can be used inside of a Gc
Methods
impl<T: Trace> GcCell<T>
[src]
fn new(value: T) -> GcCell<T>
Creates a new GcCell
containing value
.
fn into_inner(self) -> T
Consumes the GcCell
, returning the wrapped value.
impl<T: Trace + ?Sized> GcCell<T>
[src]
fn borrow(&self) -> GcCellRef<T>
Immutably borrows the wrapped value.
The borrow lasts until the returned GcCellRef
exits scope.
Multiple immutable borrows can be taken out at the same time.
Panics
Panics if the value is currently mutably borrowed.
fn borrow_mut(&self) -> GcCellRefMut<T>
Mutably borrows the wrapped value.
The borrow lasts until the returned GcCellRefMut
exits scope.
The value cannot be borrowed while this borrow is active.
Panics
Panics if the value is currently borrowed.