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.
Trait Implementations
impl<T: Trace + ?Sized> Trace for GcCell<T>
[src]
unsafe fn trace(&self)
Mark all contained Gcs
unsafe fn root(&self)
Increment the root-count of all contained Gcs
unsafe fn unroot(&self)
Decrement the root-count of all contained Gcs
impl<T: Trace + Default> Default for GcCell<T>
[src]
impl<T: Trace + ?Sized + PartialEq> PartialEq for GcCell<T>
[src]
fn eq(&self, other: &GcCell<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &GcCell<T>) -> 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: &GcCell<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &GcCell<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &GcCell<T>) -> 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: &GcCell<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &GcCell<T>) -> 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
impl<T: Trace + ?Sized + Hash> Hash for GcCell<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<T: Trace + ?Sized + Display> Display for GcCell<T>
[src]
impl<T: Debug + Trace> Debug for GcCell<T>
[src]
impl<T: Trace> From<T> for GcCell<T>
[src]
fn from(t: T) -> Self
Performs the conversion.