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]
fn new(value: T) -> Gc<T>
Constructs a new Gc<T>
.
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]
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 + ?Sized> Clone for Gc<T>
[src]
fn clone(&self) -> Gc<T>
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 + ?Sized> Deref for Gc<T>
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value