Struct containers::collections::Vec [] [src]

pub struct Vec<T, A: Alloc = NullAllocator> { /* fields omitted */ }

Growable array

Methods

impl<T, A: Alloc> Vec<T, A>
[src]

[src]

Make a new array.

[src]

Make a new array with enough room to hold at least cap elements.

Failures

Returns None if allocation fails.

[src]

[src]

Return number of elements array can hold before reallocation.

[src]

[src]

Make sure the array has enough room for at least n_more more elements, reallocating if need be.

Failures

Returns false if allocation fails, true otherwise.

[src]

Relinquish memory so capacity = length.

[src]

Insert element x at position k, shifting elements after k aftward one position to make room.

Failures

Returns Err(x) if allocation fails.

Panics

Panics if k is out of bounds.

[src]

Delete element at position k and return it, shifting elements after k forward one position to fill the gap.

Panics

Panics if k is out of bounds.

[src]

Delete element at position k and move the last element into the gap.

Panics

Panics if k is out of bounds.

[src]

Push x onto aft end of array.

Failures

Returns Err(x) if allocation fails.

[src]

Pop last element off end of array. Return None if array empty.

[src]

Append xs to the array.

Failures

Returns Err(xs) if allocation fails, in which case both self and xs are unmodified.

[src]

Copy xs and append it to the array.

Failures

Returns false if allocation fails, in which case self is unmodified.

[src]

Add elements of xs to aft end of array.

Failures

Returns Err of remainder of xs if allocation fails.

[src]

Add elements of xs to aft end of array.

Failures

Returns Err of remainder of xs if allocation fails, in which case some elements may have been added to xs already.

[src]

Shorten array to len and drop elements beyond.

[src]

impl<T, A: Alloc + Default> Vec<T, A>
[src]

[src]

Make a new array.

[src]

Make a new array with enough room to hold at least cap elements.

Failures

Returns None if allocation fails.

[src]

Add elements of xs to aft end of array.

Failures

Returns Err of remainder of xs if allocation fails, in which case some elements may have been added to xs already.

impl<T, A: Alloc + TryClone> Vec<T, A>
[src]

[src]

Split off and return the segment of the array from k to the aft end, inclusive.

Failures

Returns None if allocation fails, in which case self is unmodified.

Panics

Panics if k is out of bounds.

Trait Implementations

impl<T: TryClone, A: Alloc + TryClone> TryClone for Vec<T, A>
[src]

[src]

[src]

impl<T, A: Alloc> Drop for Vec<T, A>
[src]

[src]

Executes the destructor for this type. Read more

impl<T, A: Alloc + Default> Default for Vec<T, A>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T: PartialEq, A: Alloc> PartialEq for Vec<T, A>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<T: PartialOrd, A: Alloc> PartialOrd for Vec<T, A>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Eq, A: Alloc> Eq for Vec<T, A>
[src]

impl<T: Ord, A: Alloc> Ord for Vec<T, A>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl<T, A: Alloc> Index<usize> for Vec<T, A>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T, A: Alloc> IndexMut<usize> for Vec<T, A>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl<T, A: Alloc> Index<Range<usize>> for Vec<T, A>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T, A: Alloc> IndexMut<Range<usize>> for Vec<T, A>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl<T, A: Alloc> Index<RangeTo<usize>> for Vec<T, A>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T, A: Alloc> IndexMut<RangeTo<usize>> for Vec<T, A>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl<T, A: Alloc> Index<RangeFrom<usize>> for Vec<T, A>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T, A: Alloc> IndexMut<RangeFrom<usize>> for Vec<T, A>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl<T, A: Alloc> Index<RangeFull> for Vec<T, A>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T, A: Alloc> IndexMut<RangeFull> for Vec<T, A>
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl<T, A: Alloc> Borrow<[T]> for Vec<T, A>
[src]

[src]

Immutably borrows from an owned value. Read more

impl<T, A: Alloc> BorrowMut<[T]> for Vec<T, A>
[src]

[src]

Mutably borrows from an owned value. Read more

impl<T, A: Alloc> Deref for Vec<T, A>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<T, A: Alloc> DerefMut for Vec<T, A>
[src]

[src]

Mutably dereferences the value.

impl<T: Hash, A: Alloc> Hash for Vec<T, A>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: Debug, A: Alloc> Debug for Vec<T, A>
[src]

[src]

Formats the value using the given formatter.

impl<T, A: Alloc> IntoIterator for Vec<T, A>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a, T, A: Alloc> IntoIterator for &'a Vec<T, A>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a, T, A: Alloc> IntoIterator for &'a mut Vec<T, A>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more