Struct gc::GcCell
[−]
[src]
pub struct GcCell<T: ?Sized + 'static> { /* fields omitted */ }
A mutable memory location with dynamically checked borrow rules that can be used inside of a garbage-collected pointer.
This object is a RefCell
that can be used inside of a Gc<T>
.
Methods
impl<T: Trace> GcCell<T>
[src]
fn new(value: T) -> Self
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.
Trait Implementations
impl<T: Trace + ?Sized> Trace for GcCell<T>
[src]
unsafe fn trace(&self)
Marks all contained Gc
s.
unsafe fn root(&self)
Increments the root-count of all contained Gc
s.
unsafe fn unroot(&self)
Decrements the root-count of all contained Gc
s.
fn finalize_glue(&self)
Runs Finalize::finalize() on this object and all contained subobjects Read more
impl<T: ?Sized + Send> Send for GcCell<T>
[src]
impl<T: ?Sized> !Sync for GcCell<T>
[src]
impl<T: Trace + Clone> Clone for GcCell<T>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Trace + Default> Default for GcCell<T>
[src]
impl<T: Trace + ?Sized + PartialEq> PartialEq for GcCell<T>
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Self) -> bool
This method tests for !=
.
impl<T: Trace + ?Sized + Eq> Eq for GcCell<T>
[src]
impl<T: Trace + ?Sized + PartialOrd> PartialOrd for GcCell<T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Self) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Self) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Self) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Self) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Trace + ?Sized + Ord> Ord for GcCell<T>
[src]
fn cmp(&self, other: &GcCell<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more