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>
impl<T> VecDeque1<T>
Sourcepub unsafe fn from_vec_deque_unchecked(items: VecDeque<T>) -> Self
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().
pub fn from_one(item: T) -> Self
pub fn from_one_with_capacity(item: T, capacity: usize) -> Self
pub fn from_iter1_with_capacity<U>(items: U, capacity: usize) -> Selfwhere
U: IntoIterator1<Item = T>,
pub fn from_head_and_tail<I>(head: T, tail: I) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn from_rtail_and_head<I>(tail: I, head: T) -> Selfwhere
I: IntoIterator<Item = T>,
pub fn try_from_ref( items: &VecDeque<T>, ) -> Result<&Self, EmptyError<&VecDeque<T>>>
pub fn try_from_mut( items: &mut VecDeque<T>, ) -> Result<&mut Self, EmptyError<&mut VecDeque<T>>>
pub fn into_vec_deque(self) -> VecDeque<T>
pub fn try_retain<F>(self, f: F) -> Result<Self, EmptyError<VecDeque<T>>>
pub fn retain_until_only<F>(&mut self, f: F) -> Option<&T>
pub fn shrink_to(&mut self, capacity: usize)
pub fn shrink_to_fit(&mut self)
pub fn make_contiguous(&mut self) -> &mut Slice1<T>
pub fn rotate_left(&mut self, n: usize)
pub fn rotate_right(&mut self, n: usize)
pub fn split_off_tail(&mut self) -> VecDeque<T>
pub fn append(&mut self, items: &mut VecDeque<T>)
pub fn push_front(&mut self, item: T)
pub fn push_back(&mut self, item: T)
pub fn pop_front_if_many(&mut self) -> PopIfMany<'_, Self>
pub fn pop_back_if_many(&mut self) -> PopIfMany<'_, Self>
pub fn insert(&mut self, index: usize, item: T)
pub fn remove_if_many(&mut self, index: usize) -> RemoveIfMany<'_, Self>
pub fn swap_remove_front_if_many( &mut self, index: usize, ) -> RemoveIfMany<'_, Self>
pub fn swap_remove_back_if_many( &mut self, index: usize, ) -> RemoveIfMany<'_, Self>
pub fn get(&self, index: usize) -> Option<&T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn len(&self) -> NonZeroUsize
pub fn capacity(&self) -> NonZeroUsize
pub fn front(&self) -> &T
pub fn front_mut(&mut self) -> &mut T
pub fn back(&self) -> &T
pub fn back_mut(&mut self) -> &mut T
pub fn iter1(&self) -> Iterator1<Iter<'_, T>>
pub fn iter1_mut(&mut self) -> Iterator1<IterMut<'_, T>>
pub const fn as_vec_deque(&self) -> &VecDeque<T>
Sourcepub const unsafe fn as_mut_vec_deque(&mut self) -> &mut VecDeque<T>
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>
impl<T> VecDeque1<T>
pub fn par_iter1(
&self,
) -> ParallelIterator1<<&Self as IntoParallelIterator>::Iter>where
T: Sync,
Available on crate feature
rayon only.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.
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>
fn arbitrary(unstructured: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
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 moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
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 moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
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 moreSource§impl<T, R> ByRange<usize, R> for VecDeque1<T>where
R: RangeBounds<usize>,
impl<T, R> ByRange<usize, R> for VecDeque1<T>where
R: RangeBounds<usize>,
Source§type Error = RangeError<usize>
type Error = RangeError<usize>
Available on crate features
alloc or arrayvec or heapless only.Source§impl<T> ByTail for VecDeque1<T>
impl<T> ByTail for VecDeque1<T>
Source§impl<T> ClosedVecDeque for VecDeque1<T>
impl<T> ClosedVecDeque for VecDeque1<T>
Source§impl<T> Extend<T> for VecDeque1<T>
impl<T> Extend<T> for VecDeque1<T>
Source§fn extend<I>(&mut self, extension: I)where
I: IntoIterator<Item = T>,
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)
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)
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> FromIterator1<T> for VecDeque1<T>
impl<T> FromIterator1<T> for VecDeque1<T>
fn from_iter1<I>(items: I) -> Selfwhere
I: IntoIterator1<Item = T>,
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.
impl<T> FromParallelIterator1<T> for VecDeque1<T>where
T: Send,
Available on crate feature
rayon only.fn from_par_iter1<I>(items: I) -> Selfwhere
I: IntoParallelIterator1<Item = T>,
Source§impl<'a, T> IntoIterator for &'a VecDeque1<T>
impl<'a, T> IntoIterator for &'a VecDeque1<T>
Source§impl<'a, T> IntoIterator for &'a mut VecDeque1<T>
impl<'a, T> IntoIterator for &'a mut VecDeque1<T>
Source§impl<T> IntoIterator for VecDeque1<T>
impl<T> IntoIterator for VecDeque1<T>
Source§impl<T> IntoIterator1 for &VecDeque1<T>
impl<T> IntoIterator1 for &VecDeque1<T>
fn into_iter1(self) -> Iterator1<Self::IntoIter>
Source§impl<T> IntoIterator1 for &mut VecDeque1<T>
impl<T> IntoIterator1 for &mut VecDeque1<T>
fn into_iter1(self) -> Iterator1<Self::IntoIter>
Source§impl<T> IntoIterator1 for VecDeque1<T>
impl<T> IntoIterator1 for VecDeque1<T>
fn into_iter1(self) -> Iterator1<Self::IntoIter>
Source§impl<'a, T> IntoParallelIterator for &'a VecDeque1<T>where
T: Sync,
Available on crate feature rayon only.
impl<'a, T> IntoParallelIterator for &'a VecDeque1<T>where
T: Sync,
Available on crate feature
rayon only.Source§impl<'a, T> IntoParallelIterator for &'a mut VecDeque1<T>where
T: Send,
Available on crate feature rayon only.
impl<'a, T> IntoParallelIterator for &'a mut VecDeque1<T>where
T: Send,
Available on crate feature
rayon only.Source§impl<T> IntoParallelIterator for VecDeque1<T>where
T: Send,
Available on crate feature rayon only.
impl<T> IntoParallelIterator for VecDeque1<T>where
T: Send,
Available on crate feature
rayon only.Source§impl<T> IntoParallelIterator1 for &VecDeque1<T>where
T: Sync,
Available on crate feature rayon only.
impl<T> IntoParallelIterator1 for &VecDeque1<T>where
T: Sync,
Available on crate feature
rayon only.fn into_par_iter1(self) -> ParallelIterator1<Self::Iter>
Source§impl<T> IntoParallelIterator1 for &mut VecDeque1<T>where
T: Send,
Available on crate feature rayon only.
impl<T> IntoParallelIterator1 for &mut VecDeque1<T>where
T: Send,
Available on crate feature
rayon only.fn into_par_iter1(self) -> ParallelIterator1<Self::Iter>
Source§impl<T> IntoParallelIterator1 for VecDeque1<T>where
T: Send,
Available on crate feature rayon only.
impl<T> IntoParallelIterator1 for VecDeque1<T>where
T: Send,
Available on crate feature
rayon only.fn into_par_iter1(self) -> ParallelIterator1<Self::Iter>
Source§impl<T> JsonSchema for VecDeque1<T>where
T: JsonSchema,
Available on crate feature schemars only.
impl<T> JsonSchema for VecDeque1<T>where
T: JsonSchema,
Available on crate feature
schemars only.Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
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 moreSource§impl<T> Segmentation for VecDeque1<T>
impl<T> Segmentation for VecDeque1<T>
Source§impl Write for VecDeque1<u8>
Available on crate feature std only.
impl Write for VecDeque1<u8>
Available on crate feature
std only.Source§fn write(&mut self, buffer: &[u8]) -> Result<usize>
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_all(&mut self, buffer: &[u8]) -> Result<()>
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<()>
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
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
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