Segment

Type Alias Segment 

Source
pub type Segment<'a, K> = Segment<'a, K, VecDeque<<K as ClosedVecDeque>::Item>>;
Available on crate feature alloc only.

Aliased Type§

pub struct Segment<'a, K> { /* private fields */ }

Implementations§

Source§

impl<K, T> Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>,

Source

pub fn split_off(&mut self, at: usize) -> VecDeque<T>

Source

pub fn resize(&mut self, len: usize, fill: T)
where T: Clone,

Source

pub fn resize_with<F>(&mut self, len: usize, f: F)
where F: FnMut() -> T,

Source

pub fn truncate(&mut self, len: usize)

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn clear(&mut self)

Source

pub fn len(&self) -> usize

Source

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

Source

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

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl<K, T> Extend<T> for Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>,

Source§

fn extend<I>(&mut self, items: 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<K, T> Ord for Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>, T: Ord,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<K, T> PartialEq for Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>, T: PartialEq<T>,

Source§

fn eq(&self, other: &Self) -> 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<K, T> PartialOrd for Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>, T: PartialOrd<T>,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<K, T> Segmentation for Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>,

Source§

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

Available on crate features arrayvec or alloc only.
Source§

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

Available on crate features arrayvec or alloc only.
Source§

fn segment<R>(&mut self, range: R) -> Segment<'_, Self::Kind, Self::Target>
where Self: SegmentedBy<R>,

Available on crate features arrayvec or alloc only.
Source§

impl<K, T, R> SegmentedBy<R> for Segment<'_, K>
where PositionalRange: Project<R, Output = PositionalRange>, K: ClosedVecDeque<Item = T> + SegmentedBy<R> + SegmentedOver<Target = VecDeque<T>>, R: RangeBounds<usize>,

Source§

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

Available on crate features arrayvec or alloc only.
Source§

impl<K, T> Eq for Segment<'_, K>
where K: ClosedVecDeque<Item = T> + SegmentedOver<Target = VecDeque<T>>, T: Eq,