pub struct ExtendedIdxVec<I: Idx, T> {
inner: IdxVec<I, T>,
num_imports: u32,
}Expand description
Index space for definitions that consist of imports and locals.
Fields§
§inner: IdxVec<I, T>§num_imports: u32Implementations§
Source§impl<I: Idx, T> ExtendedIdxVec<I, T>
impl<I: Idx, T> ExtendedIdxVec<I, T>
Sourcepub fn new(imports: Vec<T>, locals: Vec<T>) -> Result<Self, IdxVecOverflowError>
pub fn new(imports: Vec<T>, locals: Vec<T>) -> Result<Self, IdxVecOverflowError>
Creates a new IdxVec with the given imported and local elements in
it.
If the number of total elements is larger than what can be addressed by
a u32, i.e. u32::MAX elements, an error is returned instead.
Sourcepub fn len_local_definitions(&self) -> u32
pub fn len_local_definitions(&self) -> u32
Returns the length of the locally-defined definitions part of this index space
Sourcepub fn map<R>(
&self,
new_imported_definitions: Vec<R>,
new_local_definitions: Vec<R>,
) -> Option<ExtendedIdxVec<I, R>>
pub fn map<R>( &self, new_imported_definitions: Vec<R>, new_local_definitions: Vec<R>, ) -> Option<ExtendedIdxVec<I, R>>
Creates an equivalent index space for one that already exists while allowing elements to be mapped.
Returns None if lengths do not match.
pub fn iter_local_definitions(&self) -> Iter<'_, T>
pub fn inner(&self) -> &IdxVec<I, T>
pub fn into_inner(self) -> IdxVec<I, T>
Trait Implementations§
Auto Trait Implementations§
impl<I, T> Freeze for ExtendedIdxVec<I, T>
impl<I, T> RefUnwindSafe for ExtendedIdxVec<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> Send for ExtendedIdxVec<I, T>
impl<I, T> Sync for ExtendedIdxVec<I, T>
impl<I, T> Unpin for ExtendedIdxVec<I, T>where
I: Unpin,
impl<I, T> UnwindSafe for ExtendedIdxVec<I, T>where
I: UnwindSafe,
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