pub struct IndexSmallVec<I, T, const CAP: usize> { /* private fields */ }
Available on crate feature
smallvec
only.Implementations§
Source§impl<I: Idx, T, const CAP: usize> IndexSmallVec<I, T, CAP>
impl<I: Idx, T, const CAP: usize> IndexSmallVec<I, T, CAP>
pub const fn new() -> Self
pub fn swap_remove(&mut self, idx: I) -> T
pub fn reserve(&mut self, additional: I)
pub fn reserve_len(&mut self, additional: usize)
pub fn extend_from_slice(&mut self, slice: &[T])where
T: Clone,
pub fn push(&mut self, v: T)
pub fn pop(&mut self) -> Option<T>
pub fn clear(&mut self)
pub fn as_array_vec(&self) -> &SmallVec<[T; CAP]>
pub fn as_array_vec_mut(&mut self) -> &mut SmallVec<[T; CAP]>
pub fn into_array_vec(self) -> SmallVec<[T; CAP]>
pub fn push_get_id(&mut self, v: T) -> I
pub fn truncate(&mut self, end: I)
pub fn truncate_len(&mut self, len: usize)
pub fn iter_enumerated(&self) -> IdxEnumerate<I, Iter<'_, T>> ⓘ
pub fn iter_enumerated_mut(&mut self) -> IdxEnumerate<I, IterMut<'_, T>> ⓘ
pub fn into_iter_enumerated(self) -> IdxEnumerate<I, IntoIter<[T; CAP]>> ⓘ
pub fn indices(&self) -> IdxRange<I> ⓘ
pub fn capacity(&self) -> usize
pub fn as_index_slice(&self) -> &IndexSlice<I, T>
pub fn as_index_slice_mut(&mut self) -> &IndexSlice<I, T>
Methods from Deref<Target = IndexSlice<I, T>>§
pub fn iter_enumerated(&self, initial_offset: I) -> IdxEnumerate<I, Iter<'_, T>> ⓘ
pub fn iter_enumerated_mut( &mut self, initial_offset: I, ) -> IdxEnumerate<I, IterMut<'_, T>> ⓘ
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn len_idx(&self) -> I
pub fn last_idx(&self) -> Option<I>
pub fn first(&self) -> Option<&T>
pub fn first_mut(&mut self) -> Option<&mut T>
pub fn last(&self) -> Option<&T>
pub fn last_mut(&mut self) -> Option<&mut T>
pub fn as_slice(&self) -> &[T]
pub fn as_slice_mut(&mut self) -> &mut [T]
pub fn get(&self, idx: I) -> Option<&T>
pub fn get_mut(&mut self, idx: I) -> Option<&mut T>
pub fn iter(&self) -> Iter<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn split_at_mut( &mut self, idx: I, ) -> (&mut IndexSlice<I, T>, &mut IndexSlice<I, T>)
Sourcepub unsafe fn get_disjoint_unchecked_mut<ISI: IndexSliceIndex<IndexSlice<I, T>> + GetDisjointMutIndex<I>, const N: usize>(
&mut self,
indices: [ISI; N],
) -> [&mut ISI::Output; N]
pub unsafe fn get_disjoint_unchecked_mut<ISI: IndexSliceIndex<IndexSlice<I, T>> + GetDisjointMutIndex<I>, const N: usize>( &mut self, indices: [ISI; N], ) -> [&mut ISI::Output; N]
§Safety
Calling this method with overlapping keys is undefined behavior even if the resulting references are not used.
pub fn get_disjoint_mut<ISI: IndexSliceIndex<IndexSlice<I, T>> + GetDisjointMutIndex<I>, const N: usize>( &mut self, indices: [ISI; N], ) -> Result<[&mut ISI::Output; N], GetDisjointMutError>
Trait Implementations§
Source§impl<I: Clone, T: Clone, const CAP: usize> Clone for IndexSmallVec<I, T, CAP>
impl<I: Clone, T: Clone, const CAP: usize> Clone for IndexSmallVec<I, T, CAP>
Source§fn clone(&self) -> IndexSmallVec<I, T, CAP>
fn clone(&self) -> IndexSmallVec<I, T, CAP>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<I, T, const CAP: usize> Default for IndexSmallVec<I, T, CAP>
impl<I, T, const CAP: usize> Default for IndexSmallVec<I, T, CAP>
Source§impl<'de, I: Idx, T, const CAP: usize> Deserialize<'de> for IndexSmallVec<I, T, CAP>
impl<'de, I: Idx, T, const CAP: usize> Deserialize<'de> for IndexSmallVec<I, T, CAP>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<I, T, const CAP: usize> Extend<T> for IndexSmallVec<I, T, CAP>
impl<I, T, const CAP: usize> Extend<T> for IndexSmallVec<I, T, CAP>
Source§fn extend<It: IntoIterator<Item = T>>(&mut self, iter: It)
fn extend<It: IntoIterator<Item = T>>(&mut self, iter: It)
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<I, T, const CAP: usize> From<IndexSmallVec<I, T, CAP>> for SmallVec<[T; CAP]>
impl<I, T, const CAP: usize> From<IndexSmallVec<I, T, CAP>> for SmallVec<[T; CAP]>
Source§fn from(value: IndexSmallVec<I, T, CAP>) -> Self
fn from(value: IndexSmallVec<I, T, CAP>) -> Self
Converts to this type from the input type.
Source§impl<I, T, const CAP: usize> FromIterator<T> for IndexSmallVec<I, T, CAP>
impl<I, T, const CAP: usize> FromIterator<T> for IndexSmallVec<I, T, CAP>
Source§fn from_iter<ITER: IntoIterator<Item = T>>(iter: ITER) -> Self
fn from_iter<ITER: IntoIterator<Item = T>>(iter: ITER) -> Self
Creates a value from an iterator. Read more
Source§impl<I: Idx, T, const CAP: usize> Index<RangeInclusive<I>> for IndexSmallVec<I, T, CAP>
impl<I: Idx, T, const CAP: usize> Index<RangeInclusive<I>> for IndexSmallVec<I, T, CAP>
Source§type Output = IndexSlice<I, T>
type Output = IndexSlice<I, T>
The returned type after indexing.
Source§impl<I: Idx, T, const CAP: usize> Index<RangeToInclusive<I>> for IndexSmallVec<I, T, CAP>
impl<I: Idx, T, const CAP: usize> Index<RangeToInclusive<I>> for IndexSmallVec<I, T, CAP>
Source§type Output = IndexSlice<I, T>
type Output = IndexSlice<I, T>
The returned type after indexing.
Source§impl<I: Idx, T, const CAP: usize> IndexMut<RangeInclusive<I>> for IndexSmallVec<I, T, CAP>
impl<I: Idx, T, const CAP: usize> IndexMut<RangeInclusive<I>> for IndexSmallVec<I, T, CAP>
Source§impl<I: Idx, T, const CAP: usize> IndexMut<RangeToInclusive<I>> for IndexSmallVec<I, T, CAP>
impl<I: Idx, T, const CAP: usize> IndexMut<RangeToInclusive<I>> for IndexSmallVec<I, T, CAP>
Source§impl<'a, I: Idx, T, const CAP: usize> IntoIterator for &'a IndexSmallVec<I, T, CAP>
impl<'a, I: Idx, T, const CAP: usize> IntoIterator for &'a IndexSmallVec<I, T, CAP>
Source§impl<'a, I: Idx, T, const CAP: usize> IntoIterator for &'a mut IndexSmallVec<I, T, CAP>
impl<'a, I: Idx, T, const CAP: usize> IntoIterator for &'a mut IndexSmallVec<I, T, CAP>
Source§impl<I: Idx, T, const CAP: usize> IntoIterator for IndexSmallVec<I, T, CAP>
impl<I: Idx, T, const CAP: usize> IntoIterator for IndexSmallVec<I, T, CAP>
Source§impl<I: Ord, T: Ord, const CAP: usize> Ord for IndexSmallVec<I, T, CAP>
impl<I: Ord, T: Ord, const CAP: usize> Ord for IndexSmallVec<I, T, CAP>
Source§fn cmp(&self, other: &IndexSmallVec<I, T, CAP>) -> Ordering
fn cmp(&self, other: &IndexSmallVec<I, T, CAP>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<I: Idx, T: PartialEq, const CAP: usize, const N: usize> PartialEq<[T; N]> for IndexSmallVec<I, T, CAP>
impl<I: Idx, T: PartialEq, const CAP: usize, const N: usize> PartialEq<[T; N]> for IndexSmallVec<I, T, CAP>
Source§impl<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSlice<I, T>> for IndexSmallVec<I, T, CAP>
impl<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSlice<I, T>> for IndexSmallVec<I, T, CAP>
Source§impl<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSmallVec<I, T, CAP>> for [T]
impl<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSmallVec<I, T, CAP>> for [T]
Source§fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<I: Idx, T: PartialEq, const CAP: usize, const N: usize> PartialEq<IndexSmallVec<I, T, CAP>> for [T; N]
impl<I: Idx, T: PartialEq, const CAP: usize, const N: usize> PartialEq<IndexSmallVec<I, T, CAP>> for [T; N]
Source§fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSmallVec<I, T, CAP>> for IndexSlice<I, T>
impl<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSmallVec<I, T, CAP>> for IndexSlice<I, T>
Source§fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<I: PartialEq, T: PartialEq, const CAP: usize> PartialEq for IndexSmallVec<I, T, CAP>
impl<I: PartialEq, T: PartialEq, const CAP: usize> PartialEq for IndexSmallVec<I, T, CAP>
Source§fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<I: PartialOrd, T: PartialOrd, const CAP: usize> PartialOrd for IndexSmallVec<I, T, CAP>
impl<I: PartialOrd, T: PartialOrd, const CAP: usize> PartialOrd for IndexSmallVec<I, T, CAP>
impl<I: Eq, T: Eq, const CAP: usize> Eq for IndexSmallVec<I, T, CAP>
impl<I, T, const CAP: usize> StructuralPartialEq for IndexSmallVec<I, T, CAP>
Auto Trait Implementations§
impl<I, T, const CAP: usize> Freeze for IndexSmallVec<I, T, CAP>where
T: Freeze,
impl<I, T, const CAP: usize> RefUnwindSafe for IndexSmallVec<I, T, CAP>where
T: RefUnwindSafe,
impl<I, T, const CAP: usize> Send for IndexSmallVec<I, T, CAP>where
T: Send,
impl<I, T, const CAP: usize> Sync for IndexSmallVec<I, T, CAP>where
T: Sync,
impl<I, T, const CAP: usize> Unpin for IndexSmallVec<I, T, CAP>where
T: Unpin,
impl<I, T, const CAP: usize> UnwindSafe for IndexSmallVec<I, T, CAP>where
T: RefUnwindSafe + UnwindSafe,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.