# [−][src]Trait smallvec::VecLike

    pub trait VecLike<T>: Index<usize, Output = T> + IndexMut<usize> + Index<Range<usize>, Output = [T]> + IndexMut<Range<usize>> + Index<RangeFrom<usize>, Output = [T]> + IndexMut<RangeFrom<usize>> + Index<RangeTo<usize>, Output = [T]> + IndexMut<RangeTo<usize>> + Index<RangeFull, Output = [T]> + IndexMut<RangeFull> + DerefMut<Target = [T]> + Extend<T> {
        fn push(&mut self, value: T);
    }

Deprecated:

Use `Extend` and `Deref<[T]>` instead

Common operations implemented by both `Vec` and `SmallVec`.

This can be used to write generic code that works with both `Vec` and `SmallVec`.

## Example

    use smallvec::{VecLike, SmallVec};

    fn initialize<V: VecLike<u8>>(v: &mut V) {
        for i in 0..5 {
            v.push(i);
        }
    }

    let mut vec = Vec::new();
    initialize(&mut vec);

    let mut small_vec = SmallVec::<[u8; 8]>::new();
    initialize(&mut small_vec);

## Required methods

### `fn push(&mut self, value: T)`

Deprecated:

Use `Extend` and `Deref<[T]>` instead

Append an element to the vector.

Loading content...

## Implementations on Foreign Types

### `impl<T> VecLike<T> for Vec<T>`[src]

#### `fn push(&mut self, value: T)`[src]

Deprecated:

Use `Extend` and `Deref<[T]>` instead

Loading content...

## Implementors

### `impl<A: Array> VecLike<<A as Array>::Item> for SmallVec<A>`[src]

#### `fn push(&mut self, value: A::Item)`[src]

Deprecated:

Use `Extend` and `Deref<[T]>` instead

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)