Struct anyvec::AnyVec [] [src]

pub struct AnyVec { /* fields omitted */ }

A growable list type with dynamic typing.

It can store anything that implements the Any trait.

Methods

impl AnyVec
[src]

Constructs a new, empty AnyVec.

Constructs a new, empty AnyVec with specified capacity.

Since we do not type sizes ahead, an average type size avg_type_size must be specified.

Returns the number of elements the vector can hold without reallocating.

Reserves capacity for at least additional more elements.

Since we do not type sizes ahead, an average type size avg_type_size must be specified.

Panics

Panics if the new capacity overflows usize.

Reserves capacity for exactly additional more elements.

Since we do not type sizes ahead, an average type size avg_type_size must be specified.

Panics

Panics if the new capacity overflows usize.

Shrinks the capacity of the vector as much as possible.

Shortens the vector to be len elements long.

Inserts an element at position index in the vector.

Shifts elements after position index to the right.

Panics

Panics if index is greater than the vector's length.

Removes and returns the element at position index.

Shifts elements after position index to the left.

Panics

Panics if index is out of bounds.

Removes and returns the element at position index.

Shifts elements after position index to the left.

Panics

Panics if index is out of bounds.

Returns if element at position index is of type T, or None if the index is out of bounds.

Returns element at position index or None if the index is out of bounds.

Returns mutable reference to element at position index, or None if the index is out of bounds.

Appends an element to the back of a collection.

Panics

Panics if the number of elements in the vector overflows a usize.

Returns the last element of the vector, or None if it is empty.

Moves all the elements of other into Self, leaving other empty.

Panics

Panics if the number of elements in the vector overflows a usize.

Clears the vector.

Returns the number of elements in the vector.

Returns if the vector is empty.

Splits the collection into two at the given index.

Panics

Panics if at > len.

Trait Implementations

impl Debug for AnyVec
[src]

Formats the value using the given formatter.