Struct gc::Gc [] [src]

pub struct Gc<T: Trace + ?Sized + 'static> {
    // some fields omitted
}

A garbage-collected pointer type over an immutable value.

See the module level documentation for more details.

Methods

impl<T: Trace> Gc<T>
[src]

Constructs a new Gc<T> with the given value.

Collection

This method could trigger a garbage collection.

Examples

use gc::Gc;

let five = Gc::new(5);

Trait Implementations

impl<T: ?Sized> !Send for Gc<T>
[src]

impl<T: ?Sized> !Sync for Gc<T>
[src]

impl<T: Trace + ?Sized + Unsize<U>, U: Trace + ?Sized> CoerceUnsized<Gc<U>> for Gc<T>
[src]

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

Marks all contained Gcs.

Increments the root-count of all contained Gcs.

Decrements the root-count of all contained Gcs.

impl<T: Trace + ?Sized> Clone for Gc<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Trace + ?Sized> Deref for Gc<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T: Trace + ?Sized> Drop for Gc<T>
[src]

A method called when the value goes out of scope. Read more

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

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

impl<T: Trace + ?Sized + PartialEq> PartialEq for Gc<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 Gc<T>
[src]

impl<T: Trace + ?Sized + PartialOrd> PartialOrd for Gc<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 Gc<T>
[src]

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

impl<T: Trace + ?Sized + Hash> Hash for Gc<T>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<T: Trace + ?Sized + Display> Display for Gc<T>
[src]

Formats the value using the given formatter.

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

Formats the value using the given formatter.

impl<T: Trace> Pointer for Gc<T>
[src]

Formats the value using the given formatter.

impl<T: Trace> From<T> for Gc<T>
[src]

Performs the conversion.