VecDeque1

Type Alias VecDeque1 

Source
pub type VecDeque1<T> = NonEmpty<VecDeque<T>>;
Available on crate feature alloc only.

Aliased Type§

pub struct VecDeque1<T> { /* private fields */ }

Implementations§

Source§

impl<T> VecDeque1<T>

Source

pub unsafe fn from_vec_deque_unchecked(items: VecDeque<T>) -> Self

§Safety

items must be non-empty. For example, it is unsound to call this function with the immediate output of VecDeque::new().

Source

pub fn from_one(item: T) -> Self

Source

pub fn from_one_with_capacity(item: T, capacity: usize) -> Self

Source

pub fn from_iter1_with_capacity<U>(items: U, capacity: usize) -> Self
where U: IntoIterator1<Item = T>,

Source

pub fn from_head_and_tail<I>(head: T, tail: I) -> Self
where I: IntoIterator<Item = T>,

Source

pub fn from_rtail_and_head<I>(tail: I, head: T) -> Self
where I: IntoIterator<Item = T>,

Source

pub fn try_from_ref( items: &VecDeque<T>, ) -> Result<&Self, EmptyError<&VecDeque<T>>>

Source

pub fn try_from_mut( items: &mut VecDeque<T>, ) -> Result<&mut Self, EmptyError<&mut VecDeque<T>>>

Source

pub fn into_vec_deque(self) -> VecDeque<T>

Source

pub fn try_retain<F>(self, f: F) -> Result<Self, EmptyError<VecDeque<T>>>
where F: FnMut(&T) -> bool,

Source

pub fn retain_until_only<F>(&mut self, f: F) -> Option<&T>
where F: FnMut(&T) -> bool,

Source

pub fn shrink_to(&mut self, capacity: usize)

Source

pub fn shrink_to_fit(&mut self)

Source

pub fn make_contiguous(&mut self) -> &mut Slice1<T>

Source

pub fn rotate_left(&mut self, n: usize)

Source

pub fn rotate_right(&mut self, n: usize)

Source

pub fn split_off_tail(&mut self) -> VecDeque<T>

Source

pub fn append(&mut self, items: &mut VecDeque<T>)

Source

pub fn push_front(&mut self, item: T)

Source

pub fn push_back(&mut self, item: T)

Source

pub fn pop_front_if_many(&mut self) -> PopIfMany<'_, Self>

Source

pub fn pop_back_if_many(&mut self) -> PopIfMany<'_, Self>

Source

pub fn insert(&mut self, index: usize, item: T)

Source

pub fn remove_if_many(&mut self, index: usize) -> RemoveIfMany<'_, Self>

Source

pub fn swap_remove_front_if_many( &mut self, index: usize, ) -> RemoveIfMany<'_, Self>

Source

pub fn swap_remove_back_if_many( &mut self, index: usize, ) -> RemoveIfMany<'_, Self>

Source

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

Source

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

Source

pub fn len(&self) -> NonZeroUsize

Source

pub fn capacity(&self) -> NonZeroUsize

Source

pub fn front(&self) -> &T

Source

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

Source

pub fn back(&self) -> &T

Source

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

Source

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

Source

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

Source

pub const fn as_vec_deque(&self) -> &VecDeque<T>

Source

pub const unsafe fn as_mut_vec_deque(&mut self) -> &mut VecDeque<T>

§Safety

The VecDeque behind the returned mutable reference must not be empty when the reference is dropped. Consider the following example:

use mitsein::vec_deque1::VecDeque1;

let mut xs = VecDeque1::from([0i32, 1, 2, 3]);
// This block is unsound. The `&mut VecDeque<_>` is dropped in the block and so `xs` can be
// freely manipulated after the block despite violation of the non-empty guarantee.
unsafe {
    xs.as_mut_vec_deque().clear();
}
let x = xs.front(); // Undefined behavior!
Source§

impl<T> VecDeque1<T>

Source

pub fn par_iter1( &self, ) -> ParallelIterator1<<&Self as IntoParallelIterator>::Iter>
where T: Sync,

Available on crate feature rayon only.
Source

pub fn par_iter1_mut( &mut self, ) -> ParallelIterator1<<&mut Self as IntoParallelIterator>::Iter>
where T: Send,

Available on crate feature rayon only.

Trait Implementations§

Source§

impl<'a, T> Arbitrary<'a> for VecDeque1<T>
where T: Arbitrary<'a>,

Available on crate feature arbitrary only.
Source§

fn arbitrary(unstructured: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl<T, R> ByRange<usize, R> for VecDeque1<T>
where R: RangeBounds<usize>,

Source§

type Range = IndexRange

Available on crate features alloc or arrayvec or heapless only.
Source§

type Error = RangeError<usize>

Available on crate features alloc or arrayvec or heapless only.
Source§

fn segment(&mut self, range: R) -> Result<Segment<'_, Self>, Self::Error>

Available on crate features alloc or arrayvec or heapless only.
Source§

impl<T> ByTail for VecDeque1<T>

Source§

type Range = IndexRange

Available on crate features alloc or arrayvec or heapless only.
Source§

fn tail(&mut self) -> Segment<'_, Self>

Available on crate features alloc or arrayvec or heapless only.
Source§

fn rtail(&mut self) -> Segment<'_, Self>

Available on crate features alloc or arrayvec or heapless only.
Source§

impl<T> ClosedVecDeque for VecDeque1<T>

Source§

type Item = T

Source§

fn as_vec_deque(&self) -> &VecDeque<Self::Item>

Source§

impl<T> Debug for VecDeque1<T>
where T: Debug,

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Extend<T> for VecDeque1<T>

Source§

fn extend<I>(&mut self, extension: I)
where I: IntoIterator<Item = T>,

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

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<T, const N: usize> From<[T; N]> for VecDeque1<T>
where [T; N]: Array1,

Source§

fn from(items: [T; N]) -> Self

Converts to this type from the input type.
Source§

impl<T> FromIterator1<T> for VecDeque1<T>

Source§

fn from_iter1<I>(items: I) -> Self
where I: IntoIterator1<Item = T>,

Source§

fn try_from_iter<I>(items: I) -> Result<Self, EmptyError<Peekable<I::IntoIter>>>
where Self: Sized, I: IntoIterator<Item = T>,

Source§

impl<T> FromParallelIterator1<T> for VecDeque1<T>
where T: Send,

Available on crate feature rayon only.
Source§

fn from_par_iter1<I>(items: I) -> Self
where I: IntoParallelIterator1<Item = T>,

Source§

impl<T, I> Index<I> for VecDeque1<T>
where VecDeque<T>: Index<I>,

Source§

type Output = <VecDeque<T> as Index<I>>::Output

The returned type after indexing.
Source§

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

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

impl<T, I> IndexMut<I> for VecDeque1<T>
where VecDeque<T>: IndexMut<I>,

Source§

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

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

impl<'a, T> IntoIterator for &'a VecDeque1<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) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T> IntoIterator for &'a mut VecDeque1<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) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> IntoIterator for VecDeque1<T>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<T>

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T> IntoIterator1 for &VecDeque1<T>

Source§

impl<T> IntoIterator1 for &mut VecDeque1<T>

Source§

impl<T> IntoIterator1 for VecDeque1<T>

Source§

impl<'a, T> IntoParallelIterator for &'a VecDeque1<T>
where T: Sync,

Available on crate feature rayon only.
Source§

type Item = &'a T

The type of item that the parallel iterator will produce.
Source§

type Iter = <&'a VecDeque<T> as IntoParallelIterator>::Iter

The parallel iterator type that will be created.
Source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more
Source§

impl<'a, T> IntoParallelIterator for &'a mut VecDeque1<T>
where T: Send,

Available on crate feature rayon only.
Source§

type Item = &'a mut T

The type of item that the parallel iterator will produce.
Source§

type Iter = <&'a mut VecDeque<T> as IntoParallelIterator>::Iter

The parallel iterator type that will be created.
Source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more
Source§

impl<T> IntoParallelIterator for VecDeque1<T>
where T: Send,

Available on crate feature rayon only.
Source§

type Item = T

The type of item that the parallel iterator will produce.
Source§

type Iter = <VecDeque<T> as IntoParallelIterator>::Iter

The parallel iterator type that will be created.
Source§

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator. Read more
Source§

impl<T> IntoParallelIterator1 for &VecDeque1<T>
where T: Sync,

Available on crate feature rayon only.
Source§

impl<T> IntoParallelIterator1 for &mut VecDeque1<T>
where T: Send,

Available on crate feature rayon only.
Source§

impl<T> IntoParallelIterator1 for VecDeque1<T>
where T: Send,

Available on crate feature rayon only.
Source§

impl<T> JsonSchema for VecDeque1<T>
where T: JsonSchema,

Available on crate feature schemars only.
Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

impl<U, T> PartialEq<&[U]> for VecDeque1<T>
where T: PartialEq<U>,

Source§

fn eq(&self, rhs: &&[U]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U, T, const N: usize> PartialEq<&[U; N]> for VecDeque1<T>
where T: PartialEq<U>,

Source§

fn eq(&self, rhs: &&[U; N]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U, T> PartialEq<&mut [U]> for VecDeque1<T>
where T: PartialEq<U>,

Source§

fn eq(&self, rhs: &&mut [U]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U, T, const N: usize> PartialEq<&mut [U; N]> for VecDeque1<T>
where T: PartialEq<U>,

Source§

fn eq(&self, rhs: &&mut [U; N]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U, T, const N: usize> PartialEq<[U; N]> for VecDeque1<T>
where T: PartialEq<U>,

Source§

fn eq(&self, rhs: &[U; N]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<U, T> PartialEq<Vec<U>> for VecDeque1<T>
where T: PartialEq<U>,

Source§

fn eq(&self, rhs: &Vec<U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Segmentation for VecDeque1<T>

Source§

type Kind = NonEmpty<VecDeque<T>>

Available on crate features alloc or arrayvec or heapless only.
Source§

type Target = VecDeque<T>

Available on crate features alloc or arrayvec or heapless only.
Source§

impl<'a, T> TryFrom<&'a VecDeque<T>> for &'a VecDeque1<T>

Source§

type Error = EmptyError<&'a VecDeque<T>>

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

fn try_from(items: &'a VecDeque<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T> TryFrom<&'a mut VecDeque<T>> for &'a mut VecDeque1<T>

Source§

type Error = EmptyError<&'a mut VecDeque<T>>

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

fn try_from(items: &'a mut VecDeque<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T> TryFrom<VecDeque<T>> for VecDeque1<T>

Source§

type Error = EmptyError<VecDeque<T>>

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

fn try_from(items: VecDeque<T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Write for VecDeque1<u8>

Available on crate feature std only.
Source§

fn write(&mut self, buffer: &[u8]) -> Result<usize>

Writes a buffer into this writer, returning how many bytes were written. Read more
Source§

fn write_vectored(&mut self, buffers: &[IoSlice<'_>]) -> Result<usize>

Like write, except that it writes from a slice of buffers. Read more
Source§

fn write_all(&mut self, buffer: &[u8]) -> Result<()>

Attempts to write an entire buffer into this writer. Read more
Source§

fn flush(&mut self) -> Result<()>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
Source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · Source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
Source§

impl<T> UnsafeHash for VecDeque1<T>
where T: UnsafeHash,

Source§

impl<T> UnsafeOrd for VecDeque1<T>
where T: UnsafeOrd,