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
[src]
Creates a new GcCell
containing value
.
fn into_inner(self) -> T
[src]
Consumes the GcCell
, returning the wrapped value.
impl<T: Trace + ?Sized> GcCell<T>
[src]
fn borrow(&self) -> GcCellRef<T>
[src]
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>
[src]
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> Finalize for GcCell<T>
[src]
impl<T: Trace + ?Sized> Trace for GcCell<T>
[src]
unsafe fn trace(&self)
[src]
Marks all contained Gc
s.
unsafe fn root(&self)
[src]
Increments the root-count of all contained Gc
s.
unsafe fn unroot(&self)
[src]
Decrements the root-count of all contained Gc
s.
fn finalize_glue(&self)
[src]
Runs Finalize::finalize() on this object and all contained subobjects Read more
impl<T: ?Sized + Send> Send for GcCell<T>
[src]
impl<T: Trace + Clone> Clone for GcCell<T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Self) -> bool
[src]
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>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Self) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Self) -> bool
[src]
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
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Self) -> bool
[src]
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
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more