pub struct CrossModuleImports<'a> { /* private fields */ }Expand description
Provides efficient access to imported types and IDs from other modules.
This can be used to resolve cross module references. See ItemIndex::is_cross_module for more
information.
Implementations§
Source§impl<'a> CrossModuleImports<'a>
impl<'a> CrossModuleImports<'a>
Sourcepub fn resolve_import<I>(&self, index: I) -> Result<CrossModuleRef<I>>where
I: ItemIndex,
pub fn resolve_import<I>(&self, index: I) -> Result<CrossModuleRef<I>>where
I: ItemIndex,
Resolves the referenced module and local index for the index.
The given index must be a cross module reference. Use ItemIndex::is_cross_module to
check this before invoking this function. If successful, this function returns a reference
to the module that declares the type, as well as the local index of the type in that module.
§Errors
Error::NotACrossModuleRefif the given index is already a global index and not a cross module reference.Error::CrossModuleRefNotFoundif the cross module reference points to a module or local index that is not indexed by this import table.
Trait Implementations§
Source§impl<'a> Clone for CrossModuleImports<'a>
impl<'a> Clone for CrossModuleImports<'a>
Source§fn clone(&self) -> CrossModuleImports<'a>
fn clone(&self) -> CrossModuleImports<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for CrossModuleImports<'a>
impl<'a> Debug for CrossModuleImports<'a>
Source§impl<'a> Default for CrossModuleImports<'a>
impl<'a> Default for CrossModuleImports<'a>
Source§fn default() -> CrossModuleImports<'a>
fn default() -> CrossModuleImports<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for CrossModuleImports<'a>
impl<'a> RefUnwindSafe for CrossModuleImports<'a>
impl<'a> Send for CrossModuleImports<'a>
impl<'a> Sync for CrossModuleImports<'a>
impl<'a> Unpin for CrossModuleImports<'a>
impl<'a> UnwindSafe for CrossModuleImports<'a>
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