Struct std::gc::Gc
pub struct Gc<T> { // some fields omitted }
Immutable garbage-collected pointer type
Methods
impl<T: 'static> Gc<T>
fn new(value: T) -> Gc<T>
Construct a new garbage-collected box
fn borrow<'r>(&'r self) -> &'r T
Borrow the value contained in the garbage-collected box
fn ptr_eq(&self, other: &Gc<T>) -> bool
Determine if two garbage-collected boxes point to the same object
Trait Implementations
impl<T> Clone for Gc<T>
fn clone(&self) -> Gc<T>
Clone the pointer only
fn clone_from(&mut self, source: &Self)
Perform copy-assignment from source
.
a.clone_from(&b)
is equivalent to a = b.clone()
in functionality,
but can be overridden to reuse the resources of a
to avoid unnecessary
allocations.