pub struct Import<S = String, T = ExternType> { /* private fields */ }
Expand description
A descriptor for an imported value into a wasm module.
This type is primarily accessed from the Module::imports
API. Each ImportType
describes an import into the wasm module
with the module/name that it’s imported from as well as the type
of item that’s being imported.
Implementations§
Source§impl<S: AsRef<str>, T> Import<S, T>
impl<S: AsRef<str>, T> Import<S, T>
Sourcepub fn new(module: S, name: S, index: u32, ty: T) -> Self
pub fn new(module: S, name: S, index: u32, ty: T) -> Self
Creates a new import descriptor which comes from module
and name
and
is of type ty
.
Sourcepub fn module(&self) -> &str
pub fn module(&self) -> &str
Returns the module name that this import is expected to come from.
Trait Implementations§
impl<S: Eq, T: Eq> Eq for Import<S, T>
impl<S, T> StructuralPartialEq for Import<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for Import<S, T>
impl<S, T> RefUnwindSafe for Import<S, T>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T> Send for Import<S, T>
impl<S, T> Sync for Import<S, T>
impl<S, T> Unpin for Import<S, T>
impl<S, T> UnwindSafe for Import<S, T>where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.