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

A container of items that can be accessed via a Key.

Implementations

Creates a new Arena with enough space for capacity number of items.

Returns a Controller for this Arena.

Returns the total capacity for this Arena.

Returns the number of items currently in the Arena.

Returns true if the Arena is currently empty.

Tries to insert an item into the Arena with a previously reserved Key.

Tries to reserve a Key, and, if successful, inserts an item into the Arena with that Key and returns the Key.

If the Arena contains an item with the given Key, removes it from the Arena and returns Some(item). Otherwise, returns None.

Returns a shared reference to the item in the Arena with the given Key if it exists. Otherwise, returns None.

Returns a mutable reference to the item in the Arena with the given Key if it exists. Otherwise, returns None.

Retains only the elements specified by the predicate.

In other words, remove all elements e such that f(&e) returns false.

Returns an iterator over shared references to the items in the Arena.

The most recently added items will be visited first.

Returns an iterator over mutable references to the items in the Arena.

The most recently added items will be visited first.

Returns an iterator that removes and yields all elements for which filter(&element) returns true.

Trait Implementations

Formats the value using the given formatter. Read more

The returned type after indexing.

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

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.