Struct oxischeme::heap::Rooted [-]  [+] [src]

pub struct Rooted<T> {
    // some fields omitted
}

A smart pointer wrapping the pointer type T. It keeps its referent rooted while the smart pointer is in scope to prevent dangling pointers caused by a garbage collection within the pointers lifespan. For more information see the module level documentation about rooting.

Methods

impl<T: ToGcThing> Rooted<T>

fn new(heap: &mut Heap, ptr: T) -> Rooted<T>

Create a new Rooted<T>, rooting the referent.

fn emplace(&mut self, rhs: T)

Unroot the current referent and replace it with the given referent, which then gets rooted.

Trait Implementations

impl<T: ToGcThing> ToGcThing for Rooted<T>

fn to_gc_thing(&self) -> Option<GcThing>

impl<T> Deref for Rooted<T>

type Target = T

fn deref<'a>(&'a self) -> &'a T

impl<T> DerefMut for Rooted<T>

fn deref_mut<'a>(&'a mut self) -> &'a mut T

impl<T: ToGcThing> Drop for Rooted<T>

fn drop(&mut self)

impl<T: Copy + ToGcThing> Clone for Rooted<T>

fn clone(&self) -> Rooted<T>

fn clone_from(&mut self, source: &Self)

impl<T: PartialEq> PartialEq for Rooted<T>

fn eq(&self, rhs: &Rooted<T>) -> bool

fn ne(&self, other: &Rhs) -> bool

impl<T: PartialEq + Eq> Eq for Rooted<T>

fn assert_receiver_is_total_eq(&self)

Derived Implementations

impl<T: Debug> Debug for Rooted<T>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<__S: Writer + Hasher, T: Hash<__S>> Hash<__S> for Rooted<T>

fn hash(&self, __arg_0: &mut __S)