Struct naga::Arena[][src]

pub struct Arena<T> { /* fields omitted */ }
Expand description

An arena holding some kind of component (e.g., type, constant, instruction, etc.) that can be referenced.

Adding new items to the arena produces a strongly-typed Handle. The arena can be indexed using the given handle to obtain a reference to the stored item.

Implementations

Create a new arena with no initial capacity allocated.

Extracts the inner vector.

Returns the current number of items stored in this arena.

Returns true if the arena contains no elements.

Returns an iterator over the items stored in this arena, returning both the item’s handle and a reference to it.

Returns a iterator over the items stored in this arena, returning both the item’s handle and a mutable reference to it.

Adds a new value to the arena, returning a typed handle.

Fetch a handle to an existing type.

Adds a value with a custom check for uniqueness: returns a handle pointing to an existing element if the check succeeds, or adds a new element otherwise.

Adds a value with a check for uniqueness, where the check is plain comparison.

Get a mutable reference to an element in the arena.

Get the range of handles from a particular number of elements to the end.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.