IndexVec

Struct IndexVec 

Source
pub struct IndexVec<I, T>
where I: Idx,
{ vector: IndexVec<I, T>, }
Expand description

Contiguous indexed vector.

Fields§

§vector: IndexVec<I, T>

Implementations§

Source§

impl<I, T> IndexVec<I, T>
where I: Idx,

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn from_vec(v: Vec<T>) -> Self

Source

pub fn from_array<const N: usize>(v: [T; N]) -> Self

Source

pub fn remove(&mut self, _: I) -> Option<T>
where String: Copy,

Shadow the index_vec::IndexVec method because it silently shifts ids.

Source

pub fn push_with(&mut self, f: impl FnOnce(I) -> T) -> I

Source

pub fn extend_from_slice(&mut self, other: &Self)
where T: Clone,

Source

pub fn insert_and_shift_ids(&mut self, id: I, x: T)

Insert a value at that index, shifting all the values with equal or larger indices.

Source

pub fn map<U>(self, f: impl FnMut(T) -> U) -> IndexVec<I, U>

Map each entry to a new one, keeping the same ids.

Source

pub fn map_ref<'a, U>(&'a self, f: impl FnMut(&'a T) -> U) -> IndexVec<I, U>

Map each entry to a new one, keeping the same ids.

Source

pub fn map_ref_mut<'a, U>( &'a mut self, f: impl FnMut(&'a mut T) -> U, ) -> IndexVec<I, U>

Map each entry to a new one, keeping the same ids.

Source

pub fn map_ref_indexed<'a, U>( &'a self, f: impl FnMut(I, &'a T) -> U, ) -> IndexVec<I, U>

Map each entry to a new one, keeping the same ids.

Source

pub fn iter_indexed(&self) -> impl Iterator<Item = (I, &T)>

Source

pub fn iter_mut_indexed(&mut self) -> impl Iterator<Item = (I, &mut T)>

Source

pub fn into_iter_indexed(self) -> impl Iterator<Item = (I, T)>

Source

pub fn iter_indexed_values(&self) -> impl Iterator<Item = (I, &T)>

Source

pub fn into_iter_indexed_values(self) -> impl Iterator<Item = (I, T)>

Source

pub fn iter_indices(&self) -> impl Iterator<Item = I> + '_

Source

pub fn all_indices(&self) -> impl Iterator<Item = I> + use<I, T>

Source

pub fn split_off(&mut self, at: usize) -> Self

Like Vec::split_off.

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

pub fn splice<R, It>( &mut self, range: R, replace_with: It, ) -> Splice<'_, <It as IntoIterator>::IntoIter>
where It: IntoIterator<Item = T>, R: IdxRangeBounds<I>,

Creates a splicing iterator that replaces the specified range in the vector with the given replace_with iterator and yields the removed items. See Vec::splice

pub fn drain_enumerated<R>( &mut self, range: R, ) -> Map<Enumerate<Drain<'_, T>>, fn((usize, T)) -> (I, T)>
where R: IdxRangeBounds<I>,

Similar to self.drain(r).enumerate() but with indices of I and not usize.

pub fn next_idx(&self) -> I

Gives the next index that will be assigned when push is called.

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

Get a the storage as a &[T]

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

Get a the storage as a &mut [T]

pub fn as_vec(&self) -> &Vec<T>

Equivalent to accessing our raw field, but as a function.

pub fn as_mut_vec(&mut self) -> &mut Vec<T>

Equivalent to accessing our raw field mutably, but as a function, if that’s what you’d prefer.

pub fn push(&mut self, d: T) -> I

Push a new item onto the vector, and return it’s index.

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

Pops the last item off, returning it. See Vec::pop.

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T>
where R: IdxRangeBounds<I>,

Return an iterator that removes the items from the requested range. See Vec::drain.

See also [IndexVec::drain_enumerated], which gives you indices (of the correct type) as you iterate.

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

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

Shortens the vector, keeping the first len elements and dropping the rest. See Vec::truncate

pub fn clear(&mut self)

Clear our vector. See Vec::clear.

pub fn reserve(&mut self, c: usize)

Reserve capacity for c more elements. See Vec::reserve

pub fn get<J>(&self, index: J) -> Option<&<J as IdxSliceIndex<I, T>>::Output>
where J: IdxSliceIndex<I, T>,

Get a ref to the item at the provided index, or None for out of bounds.

pub fn get_mut<J>( &mut self, index: J, ) -> Option<&mut <J as IdxSliceIndex<I, T>>::Output>
where J: IdxSliceIndex<I, T>,

Get a mut ref to the item at the provided index, or None for out of bounds

pub fn resize(&mut self, new_len: usize, value: T)
where T: Clone,

Resize ourselves in-place to new_len. See Vec::resize.

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

Resize ourselves in-place to new_len. See Vec::resize_with.

pub fn append(&mut self, other: &mut IndexVec<I, T>)

Moves all the elements of other into Self, leaving other empty. See Vec::append.

pub fn split_off(&mut self, idx: I) -> IndexVec<I, T>

Splits the collection into two at the given index. See Vec::split_off.

pub fn remove(&mut self, index: I) -> T

Remove the item at index. See Vec::remove.

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

Remove the item at index without maintaining order. See Vec::swap_remove.

pub fn insert(&mut self, index: I, element: T)

Insert an item at index. See Vec::insert.

pub fn extend_from_slice(&mut self, other: &IndexSlice<I, [T]>)
where T: Clone,

Append all items in the slice to the end of our vector.

See Vec::extend_from_slice.

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

Forwards to the Vec::retain implementation.

pub fn dedup_by_key<F, K>(&mut self, key: F)
where F: FnMut(&mut T) -> K, K: PartialEq,

Forwards to the Vec::dedup_by_key implementation.

pub fn dedup(&mut self)
where T: PartialEq,

Forwards to the Vec::dedup implementation.

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

Forwards to the Vec::dedup_by implementation.

pub fn as_slice(&self) -> &IndexSlice<I, [T]>

Get a IndexSlice over this vector. See as_raw_slice for converting to a &[T] (or access self.raw).

pub fn as_mut_slice(&mut self) -> &mut IndexSlice<I, [T]>

Get a mutable IndexSlice over this vector. See as_raw_slice_mut for converting to a &mut [T] (or access self.raw).

Methods from Deref<Target = IndexSlice<I, [A]>>§

pub fn to_vec(&self) -> IndexVec<I, T>
where T: Clone,

Copies self into a new IndexVec.

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

Returns the underlying slice.

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

Returns the underlying slice.

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

pub fn as_ptr(&self) -> *const T

Returns an unsafe pointer to the slice’s buffer.

pub fn last_idx(&self) -> I

Return the index of the last element, or panic.

pub fn len(&self) -> usize

Returns the length of our slice.

pub fn len_idx(&self) -> I

Returns the length of our slice as an I.

pub fn is_empty(&self) -> bool

Returns true if we’re empty.

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

Get a iterator over reverences to our values.

See also [IndexSlice::iter_enumerated], which gives you indices (of the correct type) as you iterate.

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

Get a iterator over mut reverences to our values.

See also [IndexSlice::iter_mut_enumerated], which gives you indices (of the correct type) as you iterate.

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

Similar to self.iter().enumerate() but with indices of I and not usize.

pub fn indices(&self) -> Map<Range<usize>, fn(usize) -> I>

Get an interator over all our indices.

pub fn iter_mut_enumerated( &mut self, ) -> Map<Enumerate<IterMut<'_, T>>, fn((usize, &mut T)) -> (I, &mut T)>

Similar to self.iter_mut().enumerate() but with indices of I and not usize.

pub fn sort(&mut self)
where T: Ord,

Forwards to the slice’s sort implementation.

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Forwards to the slice’s sort_by implementation.

pub fn sort_by_key<F, K>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Forwards to the slice’s sort_by_key implementation.

pub fn sort_by_cached_key<F, K>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Forwards to the slice’s sort_by_cached_key implementation.

pub fn sort_unstable(&mut self)
where T: Ord,

Forwards to the slice’s sort_unstable implementation.

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Forwards to the slice’s sort_unstable_by implementation.

pub fn sort_unstable_by_key<F, K>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Forwards to the slice’s sort_unstable_by_key implementation.

pub fn ends_with<S>(&self, needle: &S) -> bool
where S: AsRef<[T]> + ?Sized, T: PartialEq,

Forwards to the slice’s ends_with implementation.

pub fn starts_with<S>(&self, needle: &S) -> bool
where S: AsRef<[T]> + ?Sized, T: PartialEq,

Forwards to the slice’s starts_with implementation.

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Forwards to the slice’s contains implementation.

pub fn reverse(&mut self)

Forwards to the slice’s reverse implementation.

Call slice::binary_search converting the indices it gives us back as needed.

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<I, I>
where F: FnMut(&'a T) -> Ordering,

Binary searches this sorted vec with a comparator function, converting the indices it gives us back to our Idx type.

pub fn copy_from_slice(&mut self, src: &IndexSlice<I, [T]>)
where T: Copy,

Copies all elements from src into self, using a memcpy.

pub fn clone_from_slice(&mut self, src: &IndexSlice<I, [T]>)
where T: Clone,

Copies the elements from src into self.

pub fn swap_with_slice(&mut self, other: &mut IndexSlice<I, [T]>)

Swaps all elements in self with those in other.

pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<I, I>
where B: Ord, F: FnMut(&'a T) -> B,

Binary searches this sorted vec with a key extraction function, converting the indices it gives us back to our Idx type.

pub fn position<F>(&self, f: F) -> Option<I>
where F: FnMut(&T) -> bool,

Searches for an element in an iterator, returning its index. This is equivalent to Iterator::position, but returns I and not usize.

pub fn rposition<F>(&self, f: F) -> Option<I>
where F: FnMut(&T) -> bool,

Searches for an element in an iterator from the right, returning its index. This is equivalent to Iterator::position, but returns I and not usize.

pub fn swap(&mut self, a: I, b: I)

Swaps two elements in our vector.

pub fn split_at(&self, a: I) -> (&IndexSlice<I, [T]>, &IndexSlice<I, [T]>)

Divides our slice into two at an index.

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

Divides our slice into two at an index.

pub fn rotate_left(&mut self, mid: I)

Rotates our data in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front

pub fn rotate_right(&mut self, k: I)

Rotates our data in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front

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

Return the the last element, if we are not empty.

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

Return the the last element, if we are not empty.

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

Return the the first element, if we are not empty.

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

Return the the first element, if we are not empty.

pub fn copy_within<R>(&mut self, src: R, dst: I)
where R: IdxRangeBounds<I>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

pub fn get<J>(&self, index: J) -> Option<&<J as IdxSliceIndex<I, T>>::Output>
where J: IdxSliceIndex<I, T>,

Get a ref to the item at the provided index, or None for out of bounds.

pub fn get_mut<J>( &mut self, index: J, ) -> Option<&mut <J as IdxSliceIndex<I, T>>::Output>
where J: IdxSliceIndex<I, T>,

Get a mut ref to the item at the provided index, or None for out of bounds

pub fn windows( &self, size: usize, ) -> Map<Windows<'_, T>, fn(&[T]) -> &IndexSlice<I, [T]>>

Wraps the underlying slice’s windows iterator with one that yields IndexSlices with the correct index type.

pub fn chunks( &self, size: usize, ) -> Map<Chunks<'_, T>, fn(&[T]) -> &IndexSlice<I, [T]>>

Wraps the underlying slice’s chunks iterator with one that yields IndexSlices with the correct index type.

pub fn chunks_mut( &mut self, size: usize, ) -> Map<ChunksMut<'_, T>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>

Wraps the underlying slice’s chunks_mut iterator with one that yields IndexSlices with the correct index type.

pub fn chunks_exact( &self, chunk_size: usize, ) -> Map<ChunksExact<'_, T>, fn(&[T]) -> &IndexSlice<I, [T]>>

Wraps the underlying slice’s chunks_exact iterator with one that yields IndexSlices with the correct index type.

pub fn chunks_exact_mut( &mut self, chunk_size: usize, ) -> Map<ChunksExactMut<'_, T>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>

Wraps the underlying slice’s chunks_exact_mut iterator with one that yields IndexSlices with the correct index type.

pub fn rchunks( &self, size: usize, ) -> Map<RChunks<'_, T>, fn(&[T]) -> &IndexSlice<I, [T]>>

Wraps the underlying slice’s rchunks iterator with one that yields IndexSlices with the correct index type.

pub fn rchunks_mut( &mut self, size: usize, ) -> Map<RChunksMut<'_, T>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>

Wraps the underlying slice’s rchunks_mut iterator with one that yields IndexSlices with the correct index type.

pub fn rchunks_exact( &self, chunk_size: usize, ) -> Map<RChunksExact<'_, T>, fn(&[T]) -> &IndexSlice<I, [T]>>

Wraps the underlying slice’s rchunks_exact iterator with one that yields IndexSlices with the correct index type.

pub fn rchunks_exact_mut( &mut self, chunk_size: usize, ) -> Map<RChunksExactMut<'_, T>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>

Wraps the underlying slice’s rchunks_exact_mut iterator with one that yields IndexSlices with the correct index type.

pub fn split<F>( &self, f: F, ) -> Map<Split<'_, T, F>, fn(&[T]) -> &IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s split iterator with one that yields IndexSlices with the correct index type.

pub fn split_mut<F>( &mut self, f: F, ) -> Map<SplitMut<'_, T, F>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s split_mut iterator with one that yields IndexSlices with the correct index type.

pub fn rsplit<F>( &self, f: F, ) -> Map<RSplit<'_, T, F>, fn(&[T]) -> &IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s rsplit iterator with one that yields IndexSlices with the correct index type.

pub fn rsplit_mut<F>( &mut self, f: F, ) -> Map<RSplitMut<'_, T, F>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s rsplit_mut iterator with one that yields IndexSlices with the correct index type.

pub fn splitn<F>( &self, n: usize, f: F, ) -> Map<SplitN<'_, T, F>, fn(&[T]) -> &IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s splitn iterator with one that yields IndexSlices with the correct index type.

pub fn splitn_mut<F>( &mut self, n: usize, f: F, ) -> Map<SplitNMut<'_, T, F>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s splitn_mut iterator with one that yields IndexSlices with the correct index type.

pub fn rsplitn<F>( &self, n: usize, f: F, ) -> Map<RSplitN<'_, T, F>, fn(&[T]) -> &IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s rsplitn iterator with one that yields IndexSlices with the correct index type.

pub fn rsplitn_mut<F>( &mut self, n: usize, f: F, ) -> Map<RSplitNMut<'_, T, F>, fn(&mut [T]) -> &mut IndexSlice<I, [T]>>
where F: FnMut(&T) -> bool,

Wraps the underlying slice’s rsplitn_mut iterator with one that yields IndexSlices with the correct index type.

pub fn split_first(&self) -> Option<(&T, &IndexSlice<I, [T]>)>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut IndexSlice<I, [T]>)>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

pub fn split_last(&self) -> Option<(&T, &IndexSlice<I, [T]>)>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut IndexSlice<I, [T]>)>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

Trait Implementations§

Source§

impl<I: Idx, T: AstVisitable> AstVisitable for IndexVec<I, T>

Source§

fn drive<V: VisitAst>(&self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn drive_mut<V: VisitAstMut>(&mut self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn name(&self) -> &'static str

The name of the type, used for debug logging.
Source§

fn dyn_visit<T: AstVisitable>(&self, f: impl FnMut(&T))

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

fn dyn_visit_mut<T: AstVisitable>(&mut self, f: impl FnMut(&mut T))

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

impl<I: Idx, T: BodyVisitable> BodyVisitable for IndexVec<I, T>

Source§

fn drive_body<V: VisitBody>(&self, v: &mut V) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn drive_body_mut<V: VisitBodyMut>( &mut self, v: &mut V, ) -> ControlFlow<V::Break>

Recursively visit this type with the provided visitor. This calls the visitor’s visit_$any method if it exists, otherwise visit_inner.
Source§

fn dyn_visit_in_body<T: BodyVisitable>(&self, f: impl FnMut(&T))

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

fn dyn_visit_in_body_mut<T: BodyVisitable>(&mut self, f: impl FnMut(&mut T))

Visit all occurrences of that type inside self, in pre-order traversal.
Source§

impl<I, T: Clone> Clone for IndexVec<I, T>
where I: Idx + Clone,

Source§

fn clone(&self) -> IndexVec<I, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I, T: Debug> Debug for IndexVec<I, T>
where I: Idx + Debug,

Source§

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

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

impl<I: Idx, T> Default for IndexVec<I, T>

Source§

fn default() -> Self

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

impl<I: Idx, T> Deref for IndexVec<I, T>

Source§

type Target = IndexVec<I, T>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<I: Idx, T> DerefMut for IndexVec<I, T>

Source§

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

Mutably dereferences the value.
Source§

impl<'de, I: Idx, T: Deserialize<'de>> Deserialize<'de> for IndexVec<I, T>

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<'de, I: Idx, State, T: DeserializeState<'de, State>> DeserializeState<'de, State> for IndexVec<I, T>

Source§

fn deserialize_state<D>( state: &State, deserializer: D, ) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Source§

impl<'s, I: Idx, T, V: Visit<'s, T>> Drive<'s, V> for IndexVec<I, T>

Source§

fn drive_inner(&'s self, v: &mut V) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self.
Source§

impl<'s, I: Idx, T, V: VisitMut<'s, T>> DriveMut<'s, V> for IndexVec<I, T>

Source§

fn drive_inner_mut(&'s mut self, v: &mut V) -> ControlFlow<V::Break>

Call v.visit() on the immediate contents of self.
Source§

impl<I, T> FromIterator<T> for IndexVec<I, T>
where I: Idx,

Source§

fn from_iter<It: IntoIterator<Item = T>>(iter: It) -> IndexVec<I, T>

Creates a value from an iterator. Read more
Source§

impl<I, T: Hash> Hash for IndexVec<I, T>
where I: Idx + Hash,

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, R, T> Index<R> for IndexVec<I, T>
where I: Idx, R: IdxSliceIndex<I, T, Output = T>,

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<I, R, T> IndexMut<R> for IndexVec<I, T>
where I: Idx, R: IdxSliceIndex<I, T, Output = T>,

Source§

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

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

impl<'a, I, T> IntoIterator for &'a IndexVec<I, T>
where I: Idx,

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = impl Iterator<Item = &'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, T> IntoIterator for &'a mut IndexVec<I, T>
where I: Idx,

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = impl Iterator<Item = &'a mut 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, T> IntoIterator for IndexVec<I, T>
where I: Idx,

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = impl Iterator<Item = 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, T: Ord> Ord for IndexVec<I, T>
where I: Idx + Ord,

Source§

fn cmp(&self, other: &IndexVec<I, T>) -> 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, T: PartialEq> PartialEq for IndexVec<I, T>
where I: Idx + PartialEq,

Source§

fn eq(&self, other: &IndexVec<I, T>) -> 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<I, T: PartialOrd> PartialOrd for IndexVec<I, T>
where I: Idx + PartialOrd,

Source§

fn partial_cmp(&self, other: &IndexVec<I, T>) -> 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: Serialize> Serialize for IndexVec<I, T>

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: Idx, State, T: SerializeState<State>> SerializeState<State> for IndexVec<I, T>

Source§

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

Source§

impl<I, T: Eq> Eq for IndexVec<I, T>
where I: Idx + Eq,

Source§

impl<I, T> StructuralPartialEq for IndexVec<I, T>
where I: Idx,

Auto Trait Implementations§

§

impl<I, T> Freeze for IndexVec<I, T>

§

impl<I, T> RefUnwindSafe for IndexVec<I, T>
where T: RefUnwindSafe,

§

impl<I, T> Send for IndexVec<I, T>
where T: Send,

§

impl<I, T> Sync for IndexVec<I, T>
where T: Sync,

§

impl<I, T> Unpin for IndexVec<I, T>
where T: Unpin,

§

impl<I, T> UnwindSafe for IndexVec<I, T>
where T: UnwindSafe,

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
§

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

§

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

Compare self to key and return their ordering.
§

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

§

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

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

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

§

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

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

impl<I, T> ExtractContext<I, ()> for T

§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Joinable for T
where &'a T: for<'a> IntoIterator,

§

type Collection = T

§

fn join_with<S>(self, sep: S) -> Join<T, S>

Combine this object with a separator to create a new [Join] instance. Note that the separator does not have to share the same type as the iterator’s values. Read more
§

fn join_concat(self) -> Join<Self::Collection, NoSeparator>

Join this object with an empty separator. When rendered with Display, the underlying elements will be directly concatenated. Note that the separator, while empty, is still present, and will show up if you iterate this instance. Read more
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.
§

impl<I> RecreateContext<I> for I

§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
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> TyVisitable for T
where T: AstVisitable,

Source§

fn visit_vars(&mut self, v: &mut impl VarsVisitor)

Visit the variables contained in self, as seen from the outside of self. This means that any variable bound inside self will be skipped, and all the seen De Bruijn indices will count from the outside of self.
Source§

fn substitute(self, generics: &GenericArgs) -> Self

Substitute the generic variables inside self by replacing them with the provided values. Note: if self is an item that comes from a TraitDecl, you most likely want to use substitute_with_self.
Source§

fn substitute_explicits(self, generics: &GenericArgs) -> Self

Substitute only the type, region and const generic args.
Source§

fn substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Self

Substitute the generic variables as well as the TraitRefKind::Self trait ref.
Source§

fn try_substitute( self, generics: &GenericArgs, ) -> Result<Self, GenericsMismatch>

Source§

fn try_substitute_with_self( self, generics: &GenericArgs, self_ref: &TraitRefKind, ) -> Result<Self, GenericsMismatch>

Source§

fn move_under_binder(self) -> Self

Move under one binder.
Source§

fn move_under_binders(self, depth: DeBruijnId) -> Self

Move under depth binders.
Source§

fn move_from_under_binder(self) -> Option<Self>

Move from under one binder.
Source§

fn move_from_under_binders(self, depth: DeBruijnId) -> Option<Self>

Move the value out of depth binders. Returns None if it contains a variable bound in one of these depth binders.
Source§

fn visit_db_id<B>( &mut self, f: impl FnMut(&mut DeBruijnId) -> ControlFlow<B>, ) -> ControlFlow<B>

Visit the de Bruijn ids contained in self, as seen from the outside of self. This means that any variable bound inside self will be skipped, and all the seen indices will count from the outside of self.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

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