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]

Creates a new GcCell containing value.

Consumes the GcCell, returning the wrapped value.

impl<T: Trace + ?Sized> GcCell<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.

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]

Marks all contained Gcs.

Increments the root-count of all contained Gcs.

Decrements the root-count of all contained Gcs.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Trace + Default> Default for GcCell<T>
[src]

Returns the "default value" for a type. Read more

impl<T: Trace + ?Sized + PartialEq> PartialEq for GcCell<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Trace + ?Sized + Eq> Eq for GcCell<T>
[src]

impl<T: Trace + ?Sized + PartialOrd> PartialOrd for GcCell<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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]

This method returns an Ordering between self and other. Read more

impl<T: Trace + ?Sized + Debug> Debug for GcCell<T>
[src]

Formats the value using the given formatter.