pub struct Vector<T> { /* private fields */ }
Expand description
An iterable implementation of vector that stores its content on the trie. Uses the following map: index -> element.
Implementations
Returns the number of elements in the vector, also referred to as its size.
Create new vector with zero elements. Use id
as a unique identifier on the trie.
Returns the serialized element by index or None
if it is not present.
Removes an element from the vector and returns it in serialized form.
The removed element is replaced by the last element of the vector.
Does not preserve ordering, but is O(1)
.
Panics
Panics if index
is out of bounds.
Appends a serialized element to the back of the collection.
Removes the last element from a vector and returns it without deserializing, or None
if it is empty.
Inserts a serialized element at index
, returns a serialized evicted element.
Panics
If index
is out of bounds.
Iterate over raw serialized elements.
Extends vector from the given collection of serialized elements.
Returns the element by index or None
if it is not present.
Removes an element from the vector and returns it.
The removed element is replaced by the last element of the vector.
Does not preserve ordering, but is O(1)
.
Panics
Panics if index
is out of bounds.
Removes the last element from a vector and returns it, or None
if it is empty.
Iterate over deserialized elements.