[][src]Struct moving_gc_arena::Root

pub struct Root<T> { /* fields omitted */ }

An external rooted index into a region.

Roots will always keep the objects they point to live in the appropriate region.

Roots should generally not be used within a region, instead use Ix. A root that is inside its own region will never be collected and is vulnerable to the same issues as Rc. Similarly, roots between two different regions may cause uncollectable reference cycles.

A root is always a valid pointer into its corresponding region, regardless of the presence of any garbage collections.

Implementations

impl<T> Root<T>[src]

pub fn get<'a>(&self, r: &'a Region<T>) -> &'a T[src]

Gets the value at this location, when passed the correct region. As with Ix, the behavior when the region or location is unspecified (but is still safe).

pub fn get_mut<'a>(&self, r: &'a mut Region<T>) -> &'a mut T[src]

pub fn try_get<'a>(&self, r: &'a Region<T>) -> Result<&'a T, Error>[src]

Try to get a reference to this data, possibly returning an error.

If the region is correct, then an error always indicates that the pointed-to entry is no longer valid

pub fn try_get_mut<'a>(&self, r: &'a mut Region<T>) -> Result<&'a mut T, Error>[src]

pub fn ix(&self) -> Ix<T>[src]

pub fn weak(&self) -> Weak<T>[src]

Trait Implementations

impl<T> Clone for Root<T>[src]

impl<T> Debug for Root<T>[src]

impl<T> Eq for Root<T>[src]

impl<T> PartialEq<Root<T>> for Root<T>[src]

Auto Trait Implementations

impl<T> !Send for Root<T>

impl<T> !Sync for Root<T>

impl<T> Unpin for Root<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.