Struct IndexSmallVec

Source
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>

Source

pub const fn new() -> Self

Source

pub fn swap_remove(&mut self, idx: I) -> T

Source

pub fn reserve(&mut self, additional: I)

Source

pub fn reserve_len(&mut self, additional: usize)

Source

pub fn extend_from_slice(&mut self, slice: &[T])
where T: Clone,

Source

pub fn push(&mut self, v: T)

Source

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

Source

pub fn clear(&mut self)

Source

pub fn as_array_vec(&self) -> &SmallVec<[T; CAP]>

Source

pub fn as_array_vec_mut(&mut self) -> &mut SmallVec<[T; CAP]>

Source

pub fn into_array_vec(self) -> SmallVec<[T; CAP]>

Source

pub fn push_get_id(&mut self, v: T) -> I

Source

pub fn truncate(&mut self, end: I)

Source

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

Source

pub fn iter_enumerated(&self) -> IdxEnumerate<I, Iter<'_, T>>

Source

pub fn iter_enumerated_mut(&mut self) -> IdxEnumerate<I, IterMut<'_, T>>

Source

pub fn into_iter_enumerated(self) -> IdxEnumerate<I, IntoIter<[T; CAP]>>

Source

pub fn indices(&self) -> IdxRange<I>

Source

pub fn capacity(&self) -> usize

Source

pub fn as_index_slice(&self) -> &IndexSlice<I, T>

Source

pub fn as_index_slice_mut(&mut self) -> &IndexSlice<I, T>

Methods from Deref<Target = IndexSlice<I, T>>§

Source

pub fn iter_enumerated(&self, initial_offset: I) -> IdxEnumerate<I, Iter<'_, T>>

Source

pub fn iter_enumerated_mut( &mut self, initial_offset: I, ) -> IdxEnumerate<I, IterMut<'_, T>>

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn len_idx(&self) -> I

Source

pub fn last_idx(&self) -> Option<I>

Source

pub fn first(&self) -> Option<&T>

Source

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

Source

pub fn last(&self) -> Option<&T>

Source

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

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn as_slice_mut(&mut self) -> &mut [T]

Source

pub fn get(&self, idx: I) -> Option<&T>

Source

pub fn get_mut(&mut self, idx: I) -> Option<&mut T>

Source

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

Source

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

Source

pub fn split_at_mut( &mut self, idx: I, ) -> (&mut IndexSlice<I, T>, &mut IndexSlice<I, T>)

Source

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.

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<I: Idx, T: Debug, const CAP: usize> Debug for IndexSmallVec<I, T, CAP>

Source§

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

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

impl<I, T, const CAP: usize> Default for IndexSmallVec<I, T, CAP>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<I: Idx, T, const CAP: usize> Deref for IndexSmallVec<I, T, CAP>

Source§

type Target = IndexSlice<I, T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<I: Idx, T, const CAP: usize> DerefMut for IndexSmallVec<I, T, CAP>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

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>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<I, T, const CAP: usize> Extend<T> for IndexSmallVec<I, T, CAP>

Source§

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)

🔬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<I, T, const CAP: usize> From<IndexSmallVec<I, T, CAP>> for SmallVec<[T; CAP]>

Source§

fn from(value: IndexSmallVec<I, T, CAP>) -> Self

Converts to this type from the input type.
Source§

impl<I, T, const CAP: usize> From<SmallVec<[T; CAP]>> for IndexSmallVec<I, T, CAP>

Source§

fn from(v: SmallVec<[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>

Source§

fn from_iter<ITER: IntoIterator<Item = T>>(iter: ITER) -> Self

Creates a value from an iterator. Read more
Source§

impl<I: Hash, T: Hash, const CAP: usize> Hash for IndexSmallVec<I, T, CAP>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I: Idx, T, const CAP: usize> Index<I> for IndexSmallVec<I, T, CAP>

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<I: Idx, T, const CAP: usize> Index<Range<I>> for IndexSmallVec<I, T, CAP>

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

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

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

impl<I: Idx, T, const CAP: usize> Index<RangeFrom<I>> for IndexSmallVec<I, T, CAP>

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index(&self, rb: RangeFrom<I>) -> &Self::Output

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

impl<I: Idx, T, const CAP: usize> Index<RangeInclusive<I>> for IndexSmallVec<I, T, CAP>

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index(&self, rb: RangeInclusive<I>) -> &Self::Output

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

impl<I: Idx, T, const CAP: usize> Index<RangeTo<I>> for IndexSmallVec<I, T, CAP>

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index(&self, rb: RangeTo<I>) -> &Self::Output

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

impl<I: Idx, T, const CAP: usize> Index<RangeToInclusive<I>> for IndexSmallVec<I, T, CAP>

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index(&self, rb: RangeToInclusive<I>) -> &Self::Output

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

impl<I: Idx, T, const CAP: usize> IndexMut<I> for IndexSmallVec<I, T, CAP>

Source§

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

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

impl<I: Idx, T, const CAP: usize> IndexMut<Range<I>> for IndexSmallVec<I, T, CAP>

Source§

fn index_mut(&mut self, index: Range<I>) -> &mut Self::Output

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

impl<I: Idx, T, const CAP: usize> IndexMut<RangeFrom<I>> for IndexSmallVec<I, T, CAP>

Source§

fn index_mut(&mut self, rb: RangeFrom<I>) -> &mut Self::Output

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

impl<I: Idx, T, const CAP: usize> IndexMut<RangeInclusive<I>> for IndexSmallVec<I, T, CAP>

Source§

fn index_mut(&mut self, rb: RangeInclusive<I>) -> &mut Self::Output

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

impl<I: Idx, T, const CAP: usize> IndexMut<RangeTo<I>> for IndexSmallVec<I, T, CAP>

Source§

fn index_mut(&mut self, rb: RangeTo<I>) -> &mut Self::Output

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

impl<I: Idx, T, const CAP: usize> IndexMut<RangeToInclusive<I>> for IndexSmallVec<I, T, CAP>

Source§

fn index_mut(&mut self, rb: RangeToInclusive<I>) -> &mut Self::Output

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

impl<'a, I: Idx, T, const CAP: usize> IntoIterator for &'a IndexSmallVec<I, T, CAP>

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, I: Idx, T, const CAP: usize> IntoIterator for &'a mut IndexSmallVec<I, T, CAP>

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<I: Idx, T, const CAP: usize> IntoIterator for IndexSmallVec<I, T, CAP>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<[T; CAP]>

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<I: Ord, T: Ord, const CAP: usize> Ord for IndexSmallVec<I, T, CAP>

Source§

fn cmp(&self, other: &IndexSmallVec<I, T, CAP>) -> 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<I: Idx, T: PartialEq, const CAP: usize> PartialEq<[T]> for IndexSmallVec<I, T, CAP>

Source§

fn eq(&self, other: &[T]) -> bool

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

const 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<I: Idx, T: PartialEq, const CAP: usize, const N: usize> PartialEq<[T; N]> for IndexSmallVec<I, T, CAP>

Source§

fn eq(&self, other: &[T; N]) -> bool

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

const 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<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSlice<I, T>> for IndexSmallVec<I, T, CAP>

Source§

fn eq(&self, other: &IndexSlice<I, T>) -> bool

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

const 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<I: Idx, T: PartialEq, const CAP: usize> PartialEq<IndexSmallVec<I, T, CAP>> for [T]

Source§

fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool

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

const 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<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

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

const 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<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

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

const 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<I: PartialEq, T: PartialEq, const CAP: usize> PartialEq for IndexSmallVec<I, T, CAP>

Source§

fn eq(&self, other: &IndexSmallVec<I, T, CAP>) -> bool

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

const 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<I: PartialOrd, T: PartialOrd, const CAP: usize> PartialOrd for IndexSmallVec<I, T, CAP>

Source§

fn partial_cmp(&self, other: &IndexSmallVec<I, T, CAP>) -> 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<I: Idx, T, const CAP: usize> Serialize for IndexSmallVec<I, T, CAP>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<I: Eq, T: Eq, const CAP: usize> Eq for IndexSmallVec<I, T, CAP>

Source§

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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,