Skip to main content

CanonicalUserTypeAnnotations

Type Alias CanonicalUserTypeAnnotations 

Source
pub type CanonicalUserTypeAnnotations<'tcx> = IndexVec<UserTypeAnnotationIndex, CanonicalUserTypeAnnotation<'tcx>>;
Expand description

Mapping of type annotation indices to canonical user type annotations.

Aliased Type§

#[repr(transparent)]
pub struct CanonicalUserTypeAnnotations<'tcx> { pub raw: Vec<CanonicalUserTypeAnnotation<'tcx>>, /* private fields */ }

Fields§

§raw: Vec<CanonicalUserTypeAnnotation<'tcx>>

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

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn next_index(&self) -> I

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

Manual bounds checks can be done using idx < slice.next_index() (as opposed to idx.index() < slice.len()).

Source

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

Source

pub fn iter_enumerated(&self) -> impl DoubleEndedIterator + ExactSizeIterator

Source

pub fn indices( &self, ) -> impl DoubleEndedIterator + ExactSizeIterator + Clone + 'static

Source

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

Source

pub fn iter_enumerated_mut( &mut self, ) -> impl DoubleEndedIterator + ExactSizeIterator

Source

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

Source

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

Source

pub fn copy_within( &mut self, src: impl IntoSliceIdx>, dest: I, )
where T: Copy, <impl IntoSliceIdx<I, [T]> as IntoSliceIdx<I, [T]>>::Output: RangeBounds<usize>,

Source

pub fn get<R>( &self, index: R, ) -> Option<&<<R as IntoSliceIdx<I, [T]>>::Output as SliceIndex<[T]>>::Output>
where R: IntoSliceIdx<I, [T]>,

Source

pub fn get_mut<R>( &mut self, index: R, ) -> Option<&mut <<R as IntoSliceIdx<I, [T]>>::Output as SliceIndex<[T]>>::Output>
where R: IntoSliceIdx<I, [T]>,

Source

pub fn pick2_mut(&mut self, a: I, b: I) -> (&mut T, &mut T)

Returns mutable references to two distinct elements, a and b.

Panics if a == b or if some of them are out of bounds.

Source

pub fn pick3_mut(&mut self, a: I, b: I, c: I) -> (&mut T, &mut T, &mut T)

Returns mutable references to three distinct elements.

Panics if the elements are not distinct or if some of them are out of bounds.

Source

pub fn invert_bijective_mapping(&self) -> IndexVec<J, I>

Invert a bijective mapping, i.e. invert(map)[y] = x if map[x] = y, assuming the values in self are a permutation of 0..self.len().

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes