Struct stack_graphs::arena::ReversibleList[][src]

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

An arena-allocated list that can be reversed.

Well, that is, you can reverse a List just fine by yourself. This type takes care of doing that for you, and importantly, saves the result so that if you only have to compute the reversal once even if you need to access it multiple times.

Implementations

Creates a new ReversibleListArena that will manage lists of this type.

Returns whether this list is empty.

Returns an empty list.

Returns whether we have already calculated the reversal of this list.

Pushes a new element onto the front of this list.

Removes and returns the element at the front of this list. If the list is empty, returns None.

Returns an iterator over the elements of this list.

Reverses the list. Since we’re already caching everything in an arena, we make sure to only calculate the reversal once, returning it as-is if you call this function multiple times.

Ensures that the reversal of this list is available. It can be useful to precalculate this when you have mutable access to the arena, so that you can then reverse and un-reverse the list later when you only have shared access to it.

Reverses the list, assuming that the reversal has already been computed. If it hasn’t we return an error.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. 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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.