Struct gc::Gc
[−]
[src]
pub struct Gc<T: Trace + ?Sized + 'static> { /* 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) -> Self
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]
unsafe fn trace(&self)
Marks all contained Gc
s.
unsafe fn root(&self)
Increments the root-count of all contained Gc
s.
unsafe fn unroot(&self)
Decrements the root-count of all contained Gc
s.
fn finalize_glue(&self)
Runs Finalize::finalize() on this object and all contained subobjects Read more
impl<T: Trace + ?Sized> Clone for Gc<T>
[src]
fn clone(&self) -> Self
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
impl<T: Trace + ?Sized> Drop for Gc<T>
[src]
impl<T: Trace + Default> Default for Gc<T>
[src]
impl<T: Trace + ?Sized + PartialEq> PartialEq for Gc<T>
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Self) -> bool
This method tests for !=
.
impl<T: Trace + ?Sized + Eq> Eq for Gc<T>
[src]
impl<T: Trace + ?Sized + PartialOrd> PartialOrd for Gc<T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Self) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Self) -> 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: &Self) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Self) -> 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 Gc<T>
[src]
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<T: Trace + ?Sized + Hash> Hash for Gc<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 Gc<T>
[src]
impl<T: Trace + ?Sized + Debug> Debug for Gc<T>
[src]
impl<T: Trace> Pointer for Gc<T>
[src]
impl<T: Trace> From<T> for Gc<T>
[src]
fn from(t: T) -> Self
Performs the conversion.