Struct rustc_pattern_analysis::index::IdxContainer
source · #[repr(transparent)]pub struct IdxContainer<I, T>where
I: Idx,{
pub raw: Vec<T>,
_marker: PhantomData<fn(_: &I)>,
}Expand description
An owned contiguous collection of Ts, indexed by I rather than by usize.
Its purpose is to avoid mixing indexes.
While it’s possible to use u32 or usize directly for I,
you almost certainly want to use a newtype_index!-generated type instead.
This allows to index the IndexVec with the new index type.
Fields§
§raw: Vec<T>§_marker: PhantomData<fn(_: &I)>Auto Trait Implementations§
impl<I, T> RefUnwindSafe for IndexVec<I, T>where
T: RefUnwindSafe,
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> 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
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
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