Vec

Struct Vec 

Source
#[repr(C)]
pub struct Vec<T> { /* private fields */ }

Implementations§

Source§

impl<T> Vec<T>

Source

pub fn with_capacity(c: usize) -> Self

Source

pub fn new() -> Self

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn as_mut_slice(&mut self) -> &mut [T]

Source

pub fn len(&self) -> usize

Source

pub fn push(&mut self, t: T)

Source

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

Source

pub fn get_unchecked(&self, idx: usize) -> &T

Source

pub fn get_unchecked_mut(&mut self, idx: usize) -> &mut T

Source

pub fn to_iter<'a>(&self) -> Iter<'a, T>

Source

pub fn last(&self) -> Option<&T>

Source

pub fn capacity(&self) -> usize

Source

pub fn iter(&self) -> Iter<'_, T>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Source

pub fn from_raw_parts(ptr: *mut T, len: usize, cap: usize) -> Self

Trait Implementations§

Source§

impl<T: Clone> Clone for Vec<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Drop for Vec<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<A> FromIterator<A> for Vec<A>

Source§

fn from_iter<I: IntoIterator<Item = A>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T, I: SliceIndex<[T]>> Index<I> for Vec<T>

Source§

type Output = <I as SliceIndex<[T]>>::Output

The returned type after indexing.
Source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T, I: SliceIndex<[T]>> IndexMut<I> for Vec<T>

Source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, T> IntoIterator for &'a Vec<T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Iter<'a, T>

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for &'a mut Vec<T>

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> IterMut<'a, T>

Creates an iterator from a value. Read more
Source§

impl<T: Copy> VecAppend<T> for Vec<T>

Source§

fn append(&mut self, arr: &[T])

Auto Trait Implementations§

§

impl<T> Freeze for Vec<T>

§

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

§

impl<T> !Send for Vec<T>

§

impl<T> !Sync for Vec<T>

§

impl<T> Unpin for Vec<T>

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.