Trait NamedResolver

Source
pub trait NamedResolver {
    // Required method
    fn resolve_by_name(&self, module: &str, field: &str) -> Option<Export>;
}
Expand description

Import resolver connects imports with available exported values.

This is a specific subtrait for Resolver for those users who don’t care about the index, but only about the module and field for the resolution.

Required Methods§

Source

fn resolve_by_name(&self, module: &str, field: &str) -> Option<Export>

Resolves an import a WebAssembly module to an export it’s hooked up to.

It receives the module and field names and return the Export in case it’s found.

Trait Implementations§

Source§

impl NamedResolver for Box<dyn NamedResolver + Send + Sync>

Source§

fn resolve_by_name(&self, module: &str, field: &str) -> Option<Export>

Resolves an import a WebAssembly module to an export it’s hooked up to. Read more

Implementations on Foreign Types§

Source§

impl NamedResolver for ()

Source§

fn resolve_by_name(&self, _module: &str, _field: &str) -> Option<Export>

Always returns None.

Source§

impl NamedResolver for Box<dyn NamedResolver + Send + Sync>

Source§

fn resolve_by_name(&self, module: &str, field: &str) -> Option<Export>

Source§

impl<T: NamedResolver> NamedResolver for &T

Source§

fn resolve_by_name(&self, module: &str, field: &str) -> Option<Export>

Implementors§