pub struct Stacko<T, K: Key = DefaultKey> { /* private fields */ }
Expand description

A Stacko for storing values of a single type.

Implementations

Constructs an empty Stacko with a capacity of DEFAULT_CAPACITY.

Constructs an empty Stacko able to store at least capacity values before needing to allocate.

Pushes a value onto the Stacko potentially allocating more memory.

Tries to push a value onto the Stacko without allocating more memory.

Errors

Fails in case no space is available in the Stacko.

The number of values stored in the Stacko.

Checks whether the Stacko is empty.

Returns a shared reference to the value stored for the given key.

The complexity is O(1) if the key has been returned by this Stacko. It is O(log n) if the key cannot be found or it has been serialized and deserialized without also serializing and deserializing the Stacko.

Returns an exclusive reference to the value stored for the given key.

For details see get.

Returns a key corresponding to the provided index if a value is stored at the given index.

The complexity is O(log n).

Turns the Stacko into a Vec.

The index of Key can be used as an index into the returned Vec.

Returns an Iterator over the stored key-value pairs.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

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

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.