Skip to main content

VecDeque

Struct VecDeque 

Source
pub struct VecDeque<T, A: Allocator> { /* private fields */ }

Implementations§

Source§

impl<T, A: Allocator> VecDeque<T, A>

Source

pub fn new_in(alloc: A) -> Self

Source

pub fn with_capacity_in( capacity: usize, alloc: A, ) -> Result<Self, TryReserveError>

Source

pub fn get(&self, index: usize) -> Option<&T>

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut T>

Source

pub fn capacity(&self) -> usize

Source

pub fn allocator(&self) -> &A

Source

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

Source

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

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn range<R>(&self, range: R) -> Iter<'_, T>
where R: RangeBounds<usize>,

Source

pub fn range_mut<R>(&mut self, range: R) -> IterMut<'_, T>
where R: RangeBounds<usize>,

Source

pub fn reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where R: RangeBounds<usize>,

Source

pub fn clear(&mut self)

Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn push_front(&mut self, item: T) -> Result<(), TryReserveError>

Source

pub fn push_back(&mut self, item: T) -> Result<(), TryReserveError>

Source

pub fn insert(&mut self, index: usize, item: T) -> Result<(), TryReserveError>

Source

pub fn remove(&mut self, index: usize) -> Option<T>

Source

pub fn append(&mut self, other: &mut Self) -> Result<(), TryReserveError>

Source

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

Trait Implementations§

Source§

impl<T, A: Allocator> From<Vec<T, A>> for VecDeque<T, A>

Source§

fn from(vec: Vec<T, A>) -> Self

Converts to this type from the input type.
Source§

impl<T: Claim, A: Allocator + Claim> TryClone for VecDeque<T, A>

Source§

type Error = TryReserveError

Source§

fn try_clone(&self) -> Result<Self, Self::Error>

Source§

fn try_clone_from(&mut self, source: &Self) -> Result<(), Self::Error>

Auto Trait Implementations§

§

impl<T, A> Freeze for VecDeque<T, A>
where A: Freeze,

§

impl<T, A> RefUnwindSafe for VecDeque<T, A>

§

impl<T, A> Send for VecDeque<T, A>
where A: Send, T: Send,

§

impl<T, A> Sync for VecDeque<T, A>
where A: Sync, T: Sync,

§

impl<T, A> Unpin for VecDeque<T, A>
where A: Unpin, T: Unpin,

§

impl<T, A> UnwindSafe for VecDeque<T, A>
where A: UnwindSafe, T: UnwindSafe,

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> 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.