[][src]Struct ordnung::compact::Vec

pub struct Vec<T> { /* fields omitted */ }

A contiguous growable array type, written Vec<T> but pronounced 'vector'.

Methods

impl<T> Vec<T>[src]

pub fn new() -> Self[src]

Constructs a new, empty Vec.

The vector will not allocate until elements are pushed onto it.

pub fn with_capacity(capacity: usize) -> Self[src]

Constructs a new, empty Vec with the specified capacity.

The vector will be able to hold exactly capacity elements without reallocating. If capacity is 0, the vector will not allocate.

pub fn push(&mut self, val: T)[src]

Appends an element to the back of a collection.

Panics

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

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

Removes the last element from a vector and returns it, or None if it is empty.

pub fn clear(&mut self)[src]

Clears the vector, removing all values.

Note that this method has no effect on the allocated capacity of the vector.

pub fn len(&self) -> usize[src]

Returns the number of elements in the vector.

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

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

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

Removes and returns the element at position index within the vector, shifting all elements after it to the left.

pub const fn as_ptr(&self) -> *const T[src]

Returns a raw pointer to the vector's buffer.

pub fn as_mut_ptr(&mut self) -> *mut T[src]

Returns an unsafe mutable pointer to the vector's buffer.

Trait Implementations

impl<T: Clone> Clone for Vec<T>[src]

impl<T: Debug> Debug for Vec<T>[src]

impl<T> Deref for Vec<T>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T> DerefMut for Vec<T>[src]

impl<T> Drop for Vec<T>[src]

impl<T> From<Vec<T>> for Vec<T>[src]

impl<T> From<Vec<T>> for StdVec<T>[src]

impl<T> FromIterator<T> for Vec<T>[src]

impl<T> IntoIterator for Vec<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T: PartialEq> PartialEq<Vec<T>> for Vec<T>[src]

impl<T: Send> Send for Vec<T>[src]

impl<T: Sync> Sync for Vec<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Vec<T> where
    T: RefUnwindSafe

impl<T> Unpin for Vec<T>

impl<T> UnwindSafe for Vec<T> where
    T: RefUnwindSafe

Blanket Implementations

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

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

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

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.