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]

[src]

Constructs a new, empty AnyVec.

[src]

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.

[src]

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

[src]

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.

[src]

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.

[src]

Shrinks the capacity of the vector as much as possible.

[src]

Shortens the vector to be len elements long.

[src]

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.

[src]

Removes and returns the element at position index.

Shifts elements after position index to the left.

Panics

Panics if index is out of bounds.

[src]

Removes and returns the element at position index.

Shifts elements after position index to the left.

Panics

Panics if index is out of bounds.

[src]

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

[src]

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

[src]

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

[src]

Appends an element to the back of a collection.

Panics

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

[src]

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

[src]

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

Panics

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

[src]

Clears the vector.

[src]

Returns the number of elements in the vector.

[src]

Returns if the vector is empty.

[src]

Splits the collection into two at the given index.

Panics

Panics if at > len.

Trait Implementations

impl Debug for AnyVec
[src]

[src]

Formats the value using the given formatter.