[][src]Struct moving_gc_arena::Weak

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

A weak index into a region.

This index will never prevent an object from being collected, but can be used to test if an object has been collected, or access it as normal.

Implementations

impl<T> Weak<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]

Get the raw index pointed to this by weak. This method will panic if ix is expired. Use try_ix to handle failure

pub fn try_ix(&self) -> Result<Ix<T>, Error>[src]

pub fn root(&self, region: &Region<T>) -> Root<T>[src]

pub fn try_root(&self, region: &Region<T>) -> Result<Root<T>, Error>[src]

Trait Implementations

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

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

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

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

Auto Trait Implementations

impl<T> !Send for Weak<T>

impl<T> !Sync for Weak<T>

impl<T> Unpin for Weak<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.