[][src]Struct moving_gc_arena::Ix

#[repr(C)]pub struct Ix<T> { /* fields omitted */ }

A raw index for a region, that should be used for internal edges.

This index is invalidated by many operations. but locations which have always been exposed exactly once by foreach_ix for each collection are guaranteed to have an index which is valid.

Furthermore, indices received from a Entry or Root/Weak are valid when retrieved.

An Ix is valid so long as no invalidating methods have been called. Borrowing rules ensure several situations in which no invalidating method can be called:

  • An immutable reference to the region exists
  • A mutable or immutable reference to any element of this region exists, such as those acquired via Ix::get.
  • An Entry for this region exists.

If an Ix is not valid for the given region, behavior is unspecified but safe, A valid instance of T may be returned. Panics may occur with get and get_mut. If the index is valid, then it still points to the expected object.

Implementations

impl<T> Ix<T>[src]

pub fn identifier(self) -> usize[src]

Get an identifier for this index. It is unique amongst indices in this region, so long as they have not been invalidated.

Like the index itself, uniqueness is only guaranteed as long as the index has not been invalidated.

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

If this crate has been compiled with support for validity checking, this method will verify that an index is valid. In such cases, a result of Ok indicates that this index points to a valid location in the given region and has been updated.

Otherwise, Ok will always be returned.

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

Get the value pointd to by this index in its corresponding region.

If the region is incorrect, the behavior of this function is unspecified, and it may panic (but may also return a valid T reference). Use try_get to avoid panics.

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

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

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

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

pub fn try_weak(self, region: &Region<T>) -> Result<Weak<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 Ix<T>[src]

impl<T> Copy for Ix<T>[src]

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

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

If indices are in different regions or different generations, then behavior is unspecified: this may return true, false, or panic, obeying symmetry and transitivity.

In practice, it will panic if and only if the "debug-arena" feature is active.

impl<T: 'static> HasIx<T> for Ix<T>[src]

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

impl<T> Send for Ix<T>[src]

impl<T> Sync for Ix<T>[src]

Auto Trait Implementations

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