# [−] [src] Struct heapless::Vec

    #[repr(transparent)]pub struct Vec<T, N>(_)
     where
        N: ArrayLength<T>;

A fixed capacity `Vec`

# Examples

    use heapless::Vec;
    use heapless::consts::*;

    // A vector with a fixed capacity of 8 elements allocated on the stack
    let mut vec = Vec::<_, U8>::new();
    vec.push(1);
    vec.push(2);

    assert_eq!(vec.len(), 2);
    assert_eq!(vec[0], 1);

    assert_eq!(vec.pop(), Some(2));
    assert_eq!(vec.len(), 1);

    vec[0] = 7;
    assert_eq!(vec[0], 7);

    vec.extend([1, 2, 3].iter().cloned());

    for x in &vec {
        println!("{}", x);
    }
    assert_eq!(vec, [7, 1, 2, 3]);

## Implementations

### `impl<T, N> Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `pub fn new() -> Self` [src]

Constructs a new, empty vector with a fixed capacity of `N`

# Examples

    use heapless::Vec;
    use heapless::consts::*;

    // allocate the vector on the stack
    let mut x: Vec<u8, U16> = Vec::new();

    // allocate the vector in a static variable
    static mut X: Vec<u8, U16> = Vec(heapless::i::Vec::new());

#### `pub fn from_slice(other: &[T]) -> Result<Self, ()> where
T: Clone,` [src]

Constructs a new vector with a fixed capacity of `N` and fills it with the provided slice.

This is equivalent to the following code:

    use heapless::Vec;
    use heapless::consts::*;

    let mut v: Vec<u8, U16> = Vec::new();
    v.extend_from_slice(&[1, 2, 3]).unwrap();

#### `pub fn capacity(&self) -> usize` [src]

Returns the maximum number of elements the vector can hold

#### `pub fn clear(&mut self)` [src]

Clears the vector, removing all values.

#### `pub fn extend_from_slice(&mut self, other: &[T]) -> Result<(), ()> where
T: Clone,` [src]

Clones and appends all elements in a slice to the `Vec`.

Iterates over the slice `other`, clones each element, and then appends it to this `Vec`. The `other` vector is traversed in-order.

# Examples

    use heapless::Vec;
    use heapless::consts::*;

    let mut vec = Vec::<u8, U8>::new();
    vec.push(1).unwrap();
    vec.extend_from_slice(&[2, 3, 4]).unwrap();
    assert_eq!(*vec, [1, 2, 3, 4]);

#### `pub fn pop(&mut self) -> Option<T>` [src]

Removes the last element from a vector and return it, or `None` if it's empty

#### `pub fn push(&mut self, item: T) -> Result<(), T>` [src]

Appends an `item` to the back of the collection

Returns back the `item` if the vector is full

#### `pub fn truncate(&mut self, len: usize)` [src]

Shortens the vector, keeping the first `len` elements and dropping the rest.

#### `pub fn resize(&mut self, new_len: usize, value: T) -> Result<(), ()> where
T: Clone,` [src]

Resizes the Vec in-place so that len is equal to new_len.

If new_len is greater than len, the Vec is extended by the difference, with each additional slot filled with value. If new_len is less than len, the Vec is simply truncated.

See also `resize_default`.

#### `pub fn resize_default(&mut self, new_len: usize) -> Result<(), ()> where
T: Clone + Default,` [src]

Resizes the `Vec` in-place so that `len` is equal to `new_len`.

If `new_len` is greater than `len`, the `Vec` is extended by the difference, with each additional slot filled with `Default::default()`. If `new_len` is less than `len`, the `Vec` is simply truncated.

See also `resize`.

#### `pub unsafe fn set_len(&mut self, new_len: usize)` [src]

Forces the length of the vector to `new_len`.

This is a low-level operation that maintains none of the normal invariants of the type. Normally changing the length of a vector is done using one of the safe operations instead, such as `truncate`, `resize`, `extend`, or `clear`.

# Safety

- `new_len` must be less than or equal to `capacity()`.
- The elements at `old_len..new_len` must be initialized.

# Examples

This method can be useful for situations in which the vector is serving as a buffer for other code, particularly over FFI:

    use heapless::Vec;
    use heapless::consts::*;

    pub fn get_dictionary(&self) -> Option<Vec<u8, U32768>> {
        // Per the FFI method's docs, "32768 bytes is always enough".
        let mut dict = Vec::new();
        let mut dict_length = 0;
        // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
        // 1. `dict_length` elements were initialized.
        // 2. `dict_length` <= the capacity (32_768)
        // which makes `set_len` safe to call.
        unsafe {
            // Make the FFI call...
            let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
            if r == Z_OK {
                // ...and update the length to what was initialized.
                dict.set_len(dict_length);
                Some(dict)
            } else {
                None
            }
        }
    }

While the following example is sound, there is a memory leak since the inner vectors were not freed prior to the `set_len` call:

    use core::iter::FromIterator;
    use heapless::Vec;
    use heapless::consts::*;

    let mut vec = Vec::<Vec<u8, U3>, U3>::from_iter(
        [
            Vec::from_iter([1, 0, 0].iter().cloned()),
            Vec::from_iter([0, 1, 0].iter().cloned()),
            Vec::from_iter([0, 0, 1].iter().cloned()),
        ]
        .iter()
        .cloned()
    );
    // SAFETY:
    // 1. `old_len..0` is empty so no elements need to be initialized.
    // 2. `0 <= capacity` always holds whatever `capacity` is.
    unsafe {
        vec.set_len(0);
    }

Normally, here, one would use `clear` instead to correctly drop the contents and thus not leak memory.

#### `pub fn swap_remove(&mut self, index: usize) -> T` [src]

Removes an element from the vector and returns it.

The removed element is replaced by the last element of the vector.

This does not preserve ordering, but is O(1).

# Panics

Panics if `index` is out of bounds.

# Examples

    use heapless::Vec;
    use heapless::consts::*;

    let mut v: Vec<_, U8> = Vec::new();
    v.push("foo").unwrap();
    v.push("bar").unwrap();
    v.push("baz").unwrap();
    v.push("qux").unwrap();

    assert_eq!(v.swap_remove(1), "bar");
    assert_eq!(&*v, ["foo", "qux", "baz"]);

    assert_eq!(v.swap_remove(0), "foo");
    assert_eq!(&*v, ["baz", "qux"]);

#### `pub fn starts_with(&self, needle: &[T]) -> bool where
T: PartialEq,` [src]

Returns `true` if `needle` is a prefix of the Vec.

Always returns `true` if `needle` is an empty slice.

# Examples

    use heapless::Vec;
    use heapless::consts::*;

    let v: Vec<_, U8> = Vec::from_slice(b"abc").unwrap();
    assert_eq!(v.starts_with(b""), true);
    assert_eq!(v.starts_with(b"ab"), true);
    assert_eq!(v.starts_with(b"bc"), false);

#### `pub fn ends_with(&self, needle: &[T]) -> bool where
T: PartialEq,` [src]

Returns `true` if `needle` is a suffix of the Vec.

Always returns `true` if `needle` is an empty slice.

# Examples

    use heapless::Vec;
    use heapless::consts::*;

    let v: Vec<_, U8> = Vec::from_slice(b"abc").unwrap();
    assert_eq!(v.ends_with(b""), true);
    assert_eq!(v.ends_with(b"ab"), false);
    assert_eq!(v.ends_with(b"bc"), true);

## Trait Implementations

### `impl<T, N> AsMut<[T]> for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn as_mut(&mut self) -> &mut [T]` [src]

Performs the conversion.

### `impl<T, N> AsMut<Vec<T, N>> for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn as_mut(&mut self) -> &mut Self` [src]

Performs the conversion.

### `impl<T, N> AsRef<[T]> for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn as_ref(&self) -> &[T]` [src]

Performs the conversion.

### `impl<T, N> AsRef<Vec<T, N>> for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn as_ref(&self) -> &Self` [src]

Performs the conversion.

### `impl<T, N> Clone for Vec<T, N> where
N: ArrayLength<T>,
T: Clone,` [src]

#### `fn clone(&self) -> Self` [src]

Returns a copy of the value. Read more

#### `pub fn clone_from(&mut self, source: &Self)`1.0.0 [src]

Performs copy-assignment from `source`. Read more

### `impl<T, N> Debug for Vec<T, N> where
T: Debug,
N: ArrayLength<T>,` [src]

#### `fn fmt(&self, f: &mut Formatter<'_>) -> Result` [src]

Formats the value using the given formatter. Read more

### `impl<T, N> Default for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn default() -> Self` [src]

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

### `impl<T, N> Deref for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `type Target = [T]`

The resulting type after dereferencing.

#### `fn deref(&self) -> &[T]` [src]

Dereferences the value.

### `impl<T, N> DerefMut for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn deref_mut(&mut self) -> &mut [T]` [src]

Mutably dereferences the value.

### `impl<T, N> Drop for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn drop(&mut self)` [src]

Executes the destructor for this type. Read more

### `impl<T, N> Eq for Vec<T, N> where
N: ArrayLength<T>,
T: Eq,` [src]

### `impl<'a, T, N> Extend<&'a T> for Vec<T, N> where
T: 'a + Copy,
N: ArrayLength<T>,` [src]

#### `fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = &'a T>,` [src]

Extends a collection with the contents of an iterator. Read more

#### `pub fn extend_one(&mut self, item: A)` [src]

🔬 This is a nightly-only experimental API. (`extend_one`)

Extends a collection with exactly one element.

#### `pub fn extend_reserve(&mut self, additional: usize)` [src]

🔬 This is a nightly-only experimental API. (`extend_one`)

Reserves capacity in a collection for the given number of additional elements. Read more

### `impl<T, N> Extend<T> for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = T>,` [src]

Extends a collection with the contents of an iterator. Read more

#### `pub fn extend_one(&mut self, item: A)` [src]

🔬 This is a nightly-only experimental API. (`extend_one`)

Extends a collection with exactly one element.

#### `pub fn extend_reserve(&mut self, additional: usize)` [src]

🔬 This is a nightly-only experimental API. (`extend_one`)

Reserves capacity in a collection for the given number of additional elements. Read more

### `impl<T, N> FromIterator<T> for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = T>,` [src]

Creates a value from an iterator. Read more

### `impl<T, N> Hash for Vec<T, N> where
T: Hash,
N: ArrayLength<T>,` [src]

#### `fn hash<H: Hasher>(&self, state: &mut H)` [src]

Feeds this value into the given `Hasher`. Read more

#### `pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,` 1.3.0 [src]

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

### `impl<T, N> Hash for Vec<T, N> where
T: Hash,
N: ArrayLength<T>,` [src]

#### `fn hash<H: Hasher>(&self, state: &mut H)` [src]

Feeds this value into the given `Hasher`.

#### `pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,` [src]

Feeds a slice of this type into the given `Hasher`.

### `impl<'a, T, N> IntoIterator for &'a Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `type Item = &'a T`

The type of the elements being iterated over.

#### `type IntoIter = Iter<'a, T>`

Which kind of iterator are we turning this into?

#### `fn into_iter(self) -> Self::IntoIter` [src]

Creates an iterator from a value. Read more

### `impl<'a, T, N> IntoIterator for &'a mut Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `type Item = &'a mut T`

The type of the elements being iterated over.

#### `type IntoIter = IterMut<'a, T>`

Which kind of iterator are we turning this into?

#### `fn into_iter(self) -> Self::IntoIter` [src]

Creates an iterator from a value. Read more

### `impl<T, N> IntoIterator for Vec<T, N> where
N: ArrayLength<T>,` [src]

#### `type Item = T`

The type of the elements being iterated over.

#### `type IntoIter = IntoIter<T, N>`

Which kind of iterator are we turning this into?

#### `fn into_iter(self) -> Self::IntoIter` [src]

Creates an iterator from a value. Read more

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 0]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 0]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 1]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 1]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 10]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 10]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 11]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 11]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 12]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 12]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 13]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 13]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 14]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 14]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 15]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 15]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 16]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 16]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 17]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 17]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 18]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 18]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 19]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 19]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 2]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 2]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 20]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 20]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 21]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 21]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 22]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 22]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 23]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 23]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 24]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 24]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 25]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 25]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 26]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 26]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 27]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 27]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 28]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 28]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 29]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 29]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 3]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 3]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 30]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 30]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 31]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 31]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 32]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 32]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 4]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 4]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 5]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 5]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 6]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 6]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 7]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 7]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 8]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 8]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B; 9]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B; 9]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a [B]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a [B]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<&'a mut [B]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &&'a mut [B]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 0]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 0]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 1]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 1]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 10]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 10]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 11]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 11]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 12]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 12]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 13]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 13]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 14]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 14]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 15]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 15]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 16]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 16]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 17]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 17]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 18]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 18]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 19]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 19]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 2]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 2]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 20]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 20]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 21]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 21]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 22]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 22]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 23]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 23]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 24]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 24]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 25]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 25]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 26]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 26]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 27]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 27]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 28]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 28]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 29]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 29]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 3]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 3]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 30]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 30]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 31]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 31]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 32]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 32]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 4]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 4]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 5]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 5]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 6]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 6]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 7]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 7]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 8]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 8]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B; 9]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B; 9]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<'a, 'b, A, B, N> PartialEq<[B]> for Vec<A, N> where
A: PartialEq<B>,
N: ArrayLength<A>,` [src]

#### `fn eq(&self, other: &[B]) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<A, B, N1, N2> PartialEq<Vec<B, N2>> for Vec<A, N1> where
N1: ArrayLength<A>,
N2: ArrayLength<B>,
A: PartialEq<B>,` [src]

#### `fn eq(&self, other: &Vec<B, N2>) -> bool` [src]

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

#### `#[must_use]pub fn ne(&self, other: &Rhs) -> bool` 1.0.0 [src]

This method tests for `!=`.

### `impl<N> Write for Vec<u8, N> where
N: ArrayLength<u8>,` [src]

#### `fn write_str(&mut self, s: &str) -> Result` [src]

Writes a string slice into this writer, returning whether the write succeeded. Read more

#### `pub fn write_char(&mut self, c: char) -> Result<(), Error>`1.1.0 [src]

Writes a `char` into this writer, returning whether the write succeeded. Read more

#### `pub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>`1.0.0 [src]

Glue for usage of the `write!` macro with implementors of this trait. Read more

## Auto Trait Implementations

### `impl<T, N> Send for Vec<T, N> where
T: Send,` [src]

### `impl<T, N> Sync for Vec<T, N> where
T: Sync,` [src]

### `impl<T, N> Unpin for Vec<T, N> where
<N as ArrayLength<T>>::ArrayType: Unpin,` [src]

## Blanket Implementations

### `impl<T> Any for T where
T: 'static + ?Sized,` [src]

#### `pub fn type_id(&self) -> TypeId` [src]

Gets the `TypeId` of `self`. Read more

### `impl<T> Borrow<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow(&self) -> &T` [src]

Immutably borrows from an owned value. Read more

### `impl<T> BorrowMut<T> for T where
T: ?Sized,` [src]

#### `pub fn borrow_mut(&mut self) -> &mut T` [src]

Mutably borrows from an owned value. Read more

### `impl<T> From<T> for T` [src]

#### `pub fn from(t: T) -> T` [src]

Performs the conversion.

### `impl<T, U> Into<U> for T where
U: From<T>,` [src]

#### `pub fn into(self) -> U` [src]

Performs the conversion.

### `impl<T> Same<T> for T` [src]

#### `type Output = T`

Should always be `Self`

### `impl<T, U> TryFrom<U> for T where
U: Into<T>,` [src]

#### `type Error = Infallible`

The type returned in the event of a conversion error.

#### `pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>` [src]

Performs the conversion.

### `impl<T, U> TryInto<U> for T where
U: TryFrom<T>,` [src]

#### `type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

#### `pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>` [src]

Performs the conversion.