pub struct ImportType<T = ExternType> {
module: String,
name: String,
ty: T,
}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.
Fields§
§module: String§name: String§ty: TImplementations§
Source§impl<T> ImportType<T>
impl<T> ImportType<T>
Sourcepub fn new(module: &str, name: &str, ty: T) -> Self
pub fn new(module: &str, name: &str, 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§
Source§impl<T> Archive for ImportType<T>where
String: Archive,
T: Archive,
impl<T> Archive for ImportType<T>where
String: Archive,
T: Archive,
Source§type Archived = ArchivedImportType<T>
type Archived = ArchivedImportType<T>
The archived representation of this type. Read more
Source§type Resolver = ImportTypeResolver<T>
type Resolver = ImportTypeResolver<T>
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Creates the archived version of this value at the given position and
writes it to the given output. Read more
§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§impl<T: Clone> Clone for ImportType<T>
impl<T: Clone> Clone for ImportType<T>
Source§fn clone(&self) -> ImportType<T>
fn clone(&self) -> ImportType<T>
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<T: Debug> Debug for ImportType<T>
impl<T: Debug> Debug for ImportType<T>
Source§impl<'de, T> Deserialize<'de> for ImportType<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ImportType<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<__D: Fallible + ?Sized, T> Deserialize<ImportType<T>, __D> for Archived<ImportType<T>>
impl<__D: Fallible + ?Sized, T> Deserialize<ImportType<T>, __D> for Archived<ImportType<T>>
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<ImportType<T>, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ImportType<T>, <__D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl<T: Hash> Hash for ImportType<T>
impl<T: Hash> Hash for ImportType<T>
Source§impl<T: PartialEq> PartialEq for ImportType<T>
impl<T: PartialEq> PartialEq for ImportType<T>
Source§impl<__S: Fallible + ?Sized, T> Serialize<__S> for ImportType<T>where
String: Serialize<__S>,
T: Serialize<__S>,
impl<__S: Fallible + ?Sized, T> Serialize<__S> for ImportType<T>where
String: Serialize<__S>,
T: Serialize<__S>,
Source§impl<T> Serialize for ImportType<T>where
T: Serialize,
impl<T> Serialize for ImportType<T>where
T: Serialize,
impl<T: Eq> Eq for ImportType<T>
impl<T> StructuralPartialEq for ImportType<T>
Auto Trait Implementations§
impl<T> Freeze for ImportType<T>where
T: Freeze,
impl<T> RefUnwindSafe for ImportType<T>where
T: RefUnwindSafe,
impl<T> Send for ImportType<T>where
T: Send,
impl<T> Sync for ImportType<T>where
T: Sync,
impl<T> Unpin for ImportType<T>where
T: Unpin,
impl<T> UnwindSafe for ImportType<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§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.
§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read more§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T, S> SerializeUnsized<S> for Twhere
T: Serialize<S>,
S: Fallible + Writer + ?Sized,
impl<T, S> SerializeUnsized<S> for Twhere
T: Serialize<S>,
S: Fallible + Writer + ?Sized,
§fn serialize_unsized(
&self,
serializer: &mut S,
) -> Result<usize, <S as Fallible>::Error>
fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>
Writes the object and returns the position of the archived type.