pub struct Segment<'a, K, T>where
K: SegmentedOver<Target = T>,
T: Ranged,{ /* private fields */ }
Available on crate features
arrayvec
or alloc
only.Implementations§
Source§impl<K, T, const N: usize> Segment<'_, K, ArrayVec<<K as ClosedArrayVec<N>>::Item, N>>
impl<K, T, const N: usize> Segment<'_, K, ArrayVec<<K as ClosedArrayVec<N>>::Item, N>>
pub fn truncate(&mut self, len: usize)
Available on crate feature
arrayvec
only.pub fn retain<F>(&mut self, f: F)
Available on crate feature
arrayvec
only.pub fn insert(&mut self, index: usize, item: T)
Available on crate feature
arrayvec
only.pub fn insert_back(&mut self, item: T)
Available on crate feature
arrayvec
only.pub fn remove(&mut self, index: usize) -> T
Available on crate feature
arrayvec
only.pub fn remove_back(&mut self) -> Option<T>
Available on crate feature
arrayvec
only.pub fn swap_remove(&mut self, index: usize) -> T
Available on crate feature
arrayvec
only.pub fn clear(&mut self)
Available on crate feature
arrayvec
only.pub fn len(&self) -> usize
Available on crate feature
arrayvec
only.pub fn as_slice(&self) -> &[T]
Available on crate feature
arrayvec
only.pub fn as_mut_slice(&mut self) -> &mut [T]
Available on crate feature
arrayvec
only.pub fn as_ptr(&self) -> *const T
Available on crate feature
arrayvec
only.pub fn as_mut_ptr(&mut self) -> *mut T
Available on crate feature
arrayvec
only.pub fn is_empty(&self) -> bool
Available on crate feature
arrayvec
only.Source§impl<T, K, V> Segment<'_, T, BTreeMap<<T as ClosedBTreeMap>::Key, <T as ClosedBTreeMap>::Value>>where
T: ClosedBTreeMap<Key = K, Value = V> + SegmentedOver<Target = BTreeMap<K, V>>,
K: Clone + Ord,
impl<T, K, V> Segment<'_, T, BTreeMap<<T as ClosedBTreeMap>::Key, <T as ClosedBTreeMap>::Value>>where
T: ClosedBTreeMap<Key = K, Value = V> + SegmentedOver<Target = BTreeMap<K, V>>,
K: Clone + Ord,
pub fn retain<F>(&mut self, f: F)
Available on crate feature
alloc
only.pub fn insert_in_range(&mut self, key: K, value: V) -> Result<Option<V>, (K, V)>
Available on crate feature
alloc
only.pub fn append_in_range(&mut self, other: &mut BTreeMap<K, V>)
Available on crate feature
alloc
only.pub fn remove(&mut self, key: &K) -> Option<V>
Available on crate feature
alloc
only.pub fn clear(&mut self)
Available on crate feature
alloc
only.pub fn get(&self, key: &K) -> Option<&V>
Available on crate feature
alloc
only.pub fn first_key_value(&self) -> Option<(&K, &V)>
Available on crate feature
alloc
only.pub fn last_key_value(&self) -> Option<(&K, &V)>
Available on crate feature
alloc
only.pub fn contains_key(&self, key: &K) -> bool
Available on crate feature
alloc
only.Source§impl<K, T> Segment<'_, K, BTreeSet<<K as ClosedBTreeSet>::Item>>
impl<K, T> Segment<'_, K, BTreeSet<<K as ClosedBTreeSet>::Item>>
pub fn retain<F>(&mut self, f: F)
Available on crate feature
alloc
only.pub fn insert_in_range(&mut self, item: T) -> Result<bool, T>
Available on crate feature
alloc
only.pub fn append_in_range(&mut self, other: &mut BTreeSet<T>)
Available on crate feature
alloc
only.pub fn remove(&mut self, item: &T) -> bool
Available on crate feature
alloc
only.pub fn take(&mut self, item: &T) -> Option<T>
Available on crate feature
alloc
only.pub fn clear(&mut self)
Available on crate feature
alloc
only.pub fn get(&self, item: &T) -> Option<&T>
Available on crate feature
alloc
only.pub fn first(&self) -> Option<&T>
Available on crate feature
alloc
only.pub fn last(&self) -> Option<&T>
Available on crate feature
alloc
only.pub fn contains(&self, item: &T) -> bool
Available on crate feature
alloc
only.Source§impl<T, K, V, S> Segment<'_, T, IndexMap<<T as ClosedIndexMap>::Key, <T as ClosedIndexMap>::Value, <T as ClosedIndexMap>::State>>
impl<T, K, V, S> Segment<'_, T, IndexMap<<T as ClosedIndexMap>::Key, <T as ClosedIndexMap>::Value, <T as ClosedIndexMap>::State>>
pub fn truncate(&mut self, len: usize)
Available on crate feature
indexmap
only.pub fn retain<F>(&mut self, f: F)
Available on crate feature
indexmap
only.pub fn move_index(&mut self, from: usize, to: usize)
Available on crate feature
indexmap
only.pub fn swap_indices(&mut self, a: usize, b: usize)
Available on crate feature
indexmap
only.pub fn shift_remove_index(&mut self, index: usize) -> Option<(K, V)>
Available on crate feature
indexmap
only.pub fn swap_remove_index(&mut self, index: usize) -> Option<(K, V)>
Available on crate feature
indexmap
only.pub fn clear(&mut self)
Available on crate feature
indexmap
only.pub fn len(&self) -> usize
Available on crate feature
indexmap
only.Source§impl<T, K, V, S> Segment<'_, T, IndexMap<<T as ClosedIndexMap>::Key, <T as ClosedIndexMap>::Value, <T as ClosedIndexMap>::State>>where
T: ClosedIndexMap<Key = K, Value = V, State = S> + SegmentedOver<Target = IndexMap<K, V, S>>,
S: BuildHasher,
impl<T, K, V, S> Segment<'_, T, IndexMap<<T as ClosedIndexMap>::Key, <T as ClosedIndexMap>::Value, <T as ClosedIndexMap>::State>>where
T: ClosedIndexMap<Key = K, Value = V, State = S> + SegmentedOver<Target = IndexMap<K, V, S>>,
S: BuildHasher,
pub fn contains_key<Q>(&self, query: &Q) -> bool
Available on crate feature
indexmap
only.Source§impl<K, T, S> Segment<'_, K, IndexSet<<K as ClosedIndexSet>::Item, <K as ClosedIndexSet>::State>>
impl<K, T, S> Segment<'_, K, IndexSet<<K as ClosedIndexSet>::Item, <K as ClosedIndexSet>::State>>
pub fn truncate(&mut self, len: usize)
Available on crate feature
indexmap
only.pub fn retain<F>(&mut self, f: F)
Available on crate feature
indexmap
only.pub fn move_index(&mut self, from: usize, to: usize)
Available on crate feature
indexmap
only.pub fn swap_indices(&mut self, a: usize, b: usize)
Available on crate feature
indexmap
only.pub fn shift_remove_index(&mut self, index: usize) -> Option<T>
Available on crate feature
indexmap
only.pub fn swap_remove_index(&mut self, index: usize) -> Option<T>
Available on crate feature
indexmap
only.pub fn clear(&mut self)
Available on crate feature
indexmap
only.pub fn len(&self) -> usize
Available on crate feature
indexmap
only.Source§impl<K, T, S> Segment<'_, K, IndexSet<<K as ClosedIndexSet>::Item, <K as ClosedIndexSet>::State>>where
K: ClosedIndexSet<Item = T, State = S> + SegmentedOver<Target = IndexSet<T, S>>,
T: Eq + Hash,
S: BuildHasher,
impl<K, T, S> Segment<'_, K, IndexSet<<K as ClosedIndexSet>::Item, <K as ClosedIndexSet>::State>>where
K: ClosedIndexSet<Item = T, State = S> + SegmentedOver<Target = IndexSet<T, S>>,
T: Eq + Hash,
S: BuildHasher,
pub fn shift_insert(&mut self, index: usize, item: T) -> bool
Available on crate feature
indexmap
only.Source§impl<K, A, T> Segment<'_, K, SmallVec<<K as ClosedSmallVec>::Array>>
impl<K, A, T> Segment<'_, K, SmallVec<<K as ClosedSmallVec>::Array>>
pub fn resize(&mut self, len: usize, fill: T)where
T: Clone,
Available on crate feature
smallvec
only.pub fn resize_with<F>(&mut self, len: usize, f: F)where
F: FnMut() -> T,
Available on crate feature
smallvec
only.pub fn truncate(&mut self, len: usize)
Available on crate feature
smallvec
only.pub fn retain<F>(&mut self, f: F)
Available on crate feature
smallvec
only.pub fn retain_mut<F>(&mut self, f: F)
Available on crate feature
smallvec
only.pub fn insert(&mut self, index: usize, item: T)
Available on crate feature
smallvec
only.pub fn insert_back(&mut self, item: T)
Available on crate feature
smallvec
only.pub fn remove(&mut self, index: usize) -> T
Available on crate feature
smallvec
only.pub fn remove_back(&mut self) -> Option<T>
Available on crate feature
smallvec
only.pub fn swap_remove(&mut self, index: usize) -> T
Available on crate feature
smallvec
only.pub fn clear(&mut self)
Available on crate feature
smallvec
only.pub fn len(&self) -> usize
Available on crate feature
smallvec
only.pub fn as_slice(&self) -> &[T]
Available on crate feature
smallvec
only.pub fn as_mut_slice(&mut self) -> &mut [T]
Available on crate feature
smallvec
only.pub fn as_ptr(&self) -> *const T
Available on crate feature
smallvec
only.pub fn as_mut_ptr(&mut self) -> *mut T
Available on crate feature
smallvec
only.pub fn is_empty(&self) -> bool
Available on crate feature
smallvec
only.Source§impl<T> Segment<'_, Vec<T>, Vec<<Vec<T> as ClosedVec>::Item>>
impl<T> Segment<'_, Vec<T>, Vec<<Vec<T> as ClosedVec>::Item>>
pub fn drain<R>(&mut self, range: R) -> DrainSegment<'_, T> ⓘwhere
PositionalRange: Project<R, Output = PositionalRange>,
R: RangeBounds<usize>,
Available on crate feature
alloc
only.Source§impl<T> Segment<'_, NonEmpty<Vec<T>>, Vec<<NonEmpty<Vec<T>> as ClosedVec>::Item>>
impl<T> Segment<'_, NonEmpty<Vec<T>>, Vec<<NonEmpty<Vec<T>> as ClosedVec>::Item>>
pub fn swap_drain<R>(&mut self, range: R) -> SwapDrainSegment<'_, T> ⓘwhere
PositionalRange: Project<R, Output = PositionalRange>,
R: RangeBounds<usize>,
Available on crate feature
alloc
only.Source§impl<K, T> Segment<'_, K, Vec<<K as ClosedVec>::Item>>
impl<K, T> Segment<'_, K, Vec<<K as ClosedVec>::Item>>
pub fn split_off(&mut self, at: usize) -> Vec<T>
Available on crate feature
alloc
only.pub fn resize(&mut self, len: usize, fill: T)where
T: Clone,
Available on crate feature
alloc
only.pub fn resize_with<F>(&mut self, len: usize, f: F)where
F: FnMut() -> T,
Available on crate feature
alloc
only.pub fn truncate(&mut self, len: usize)
Available on crate feature
alloc
only.pub fn retain<F>(&mut self, f: F)
Available on crate feature
alloc
only.pub fn retain_mut<F>(&mut self, f: F)
Available on crate feature
alloc
only.pub fn insert(&mut self, index: usize, item: T)
Available on crate feature
alloc
only.pub fn insert_back(&mut self, item: T)
Available on crate feature
alloc
only.pub fn remove(&mut self, index: usize) -> T
Available on crate feature
alloc
only.pub fn remove_back(&mut self) -> Option<T>
Available on crate feature
alloc
only.pub fn swap_remove(&mut self, index: usize) -> T
Available on crate feature
alloc
only.pub fn clear(&mut self)
Available on crate feature
alloc
only.pub fn len(&self) -> usize
Available on crate feature
alloc
only.pub fn as_slice(&self) -> &[T]
Available on crate feature
alloc
only.pub fn as_mut_slice(&mut self) -> &mut [T]
Available on crate feature
alloc
only.pub fn as_ptr(&self) -> *const T
Available on crate feature
alloc
only.pub fn as_mut_ptr(&mut self) -> *mut T
Available on crate feature
alloc
only.pub fn is_empty(&self) -> bool
Available on crate feature
alloc
only.Source§impl<K, T> Segment<'_, K, VecDeque<<K as ClosedVecDeque>::Item>>
impl<K, T> Segment<'_, K, VecDeque<<K as ClosedVecDeque>::Item>>
pub fn split_off(&mut self, at: usize) -> VecDeque<T>
Available on crate feature
alloc
only.pub fn resize(&mut self, len: usize, fill: T)where
T: Clone,
Available on crate feature
alloc
only.pub fn resize_with<F>(&mut self, len: usize, f: F)where
F: FnMut() -> T,
Available on crate feature
alloc
only.pub fn truncate(&mut self, len: usize)
Available on crate feature
alloc
only.pub fn retain<F>(&mut self, f: F)
Available on crate feature
alloc
only.pub fn retain_mut<F>(&mut self, f: F)
Available on crate feature
alloc
only.pub fn insert(&mut self, index: usize, item: T)
Available on crate feature
alloc
only.pub fn insert_front(&mut self, item: T)
Available on crate feature
alloc
only.pub fn insert_back(&mut self, item: T)
Available on crate feature
alloc
only.pub fn remove(&mut self, index: usize) -> Option<T>
Available on crate feature
alloc
only.pub fn remove_front(&mut self) -> Option<T>
Available on crate feature
alloc
only.pub fn remove_back(&mut self) -> Option<T>
Available on crate feature
alloc
only.pub fn swap_remove_front(&mut self, index: usize) -> Option<T>
Available on crate feature
alloc
only.pub fn swap_remove_back(&mut self, index: usize) -> Option<T>
Available on crate feature
alloc
only.pub fn clear(&mut self)
Available on crate feature
alloc
only.pub fn len(&self) -> usize
Available on crate feature
alloc
only.pub fn iter(&self) -> Iter<'_, T>
Available on crate feature
alloc
only.pub fn iter_mut(&mut self) -> IterMut<'_, T>
Available on crate feature
alloc
only.pub fn is_empty(&self) -> bool
Available on crate feature
alloc
only.Trait Implementations§
Source§impl<'a, KT, KU, AT, AU, T, U> PartialEq<Segment<'a, KU, SmallVec<<KU as ClosedSmallVec>::Array>>> for Segment<'a, KT>where
KT: ClosedSmallVec<Array = AT> + SegmentedOver<Target = SmallVec<AT>>,
KU: ClosedSmallVec<Array = AU> + SegmentedOver<Target = SmallVec<AU>>,
AT: Array<Item = T>,
AU: Array<Item = U>,
T: PartialEq<U>,
Available on crate feature smallvec
only.
impl<'a, KT, KU, AT, AU, T, U> PartialEq<Segment<'a, KU, SmallVec<<KU as ClosedSmallVec>::Array>>> for Segment<'a, KT>where
KT: ClosedSmallVec<Array = AT> + SegmentedOver<Target = SmallVec<AT>>,
KU: ClosedSmallVec<Array = AU> + SegmentedOver<Target = SmallVec<AU>>,
AT: Array<Item = T>,
AU: Array<Item = U>,
T: PartialEq<U>,
Available on crate feature
smallvec
only.Source§impl<'a, KT, KU, T, U> PartialEq<Segment<'a, KU, Vec<<KU as ClosedVec>::Item>>> for Segment<'a, KT>where
KT: ClosedVec<Item = T> + SegmentedOver<Target = Vec<T>>,
KU: ClosedVec<Item = U> + SegmentedOver<Target = Vec<U>>,
T: PartialEq<U>,
Available on crate feature alloc
only.
impl<'a, KT, KU, T, U> PartialEq<Segment<'a, KU, Vec<<KU as ClosedVec>::Item>>> for Segment<'a, KT>where
KT: ClosedVec<Item = T> + SegmentedOver<Target = Vec<T>>,
KU: ClosedVec<Item = U> + SegmentedOver<Target = Vec<U>>,
T: PartialEq<U>,
Available on crate feature
alloc
only.Source§impl<K, T> SegmentedOver for Segment<'_, K, T>where
K: SegmentedOver<Target = T>,
T: Ranged,
impl<K, T> SegmentedOver for Segment<'_, K, T>where
K: SegmentedOver<Target = T>,
T: Ranged,
Auto Trait Implementations§
impl<'a, K, T> Freeze for Segment<'a, K, T>where
<T as Ranged>::Range: Freeze,
impl<'a, K, T> RefUnwindSafe for Segment<'a, K, T>where
<T as Ranged>::Range: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, K, T> Send for Segment<'a, K, T>
impl<'a, K, T> Sync for Segment<'a, K, T>
impl<'a, K, T> Unpin for Segment<'a, K, T>where
<T as Ranged>::Range: Unpin,
impl<'a, K, T> !UnwindSafe for Segment<'a, K, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more