Struct wasm_plugin_host::WasmPluginBuilder [−][src]
pub struct WasmPluginBuilder { /* fields omitted */ }
Constructs a WasmPlugin
Implementations
impl WasmPluginBuilder
[src]
impl WasmPluginBuilder
[src]pub fn from_file(path: impl AsRef<Path>) -> Result<Self>
[src]
pub fn from_file(path: impl AsRef<Path>) -> Result<Self>
[src]Load a plugin off disk and prepare it for use.
pub fn from_source(source: &[u8]) -> Result<Self>
[src]
pub fn from_source(source: &[u8]) -> Result<Self>
[src]Load a plugin from WASM source and prepare it for use.
pub fn import_function_with_context<Args, F: ImportableFnWithContext<C, Args> + Send + 'static, C: Send + Sync + Clone + 'static>(
self,
name: impl ToString,
ctx: C,
value: F
) -> Self
[src]
pub fn import_function_with_context<Args, F: ImportableFnWithContext<C, Args> + Send + 'static, C: Send + Sync + Clone + 'static>(
self,
name: impl ToString,
ctx: C,
value: F
) -> Self
[src]Import a function defined in the host into the guest. The function’s
arguments and return type must all be serializable.
An immutable reference to ctx
will be passed to the function as it’s
first argument each time it’s called.
NOTE: This method exists due to a limitation in the underlying Waswer engine which currently doesn’t support imported closures with captured context. The Wasamer developers have said they are interested in removing that limitation and when they do this method will be removed in favor of `import_function’ since context can be more idiomatically handled with captured values.
pub fn import_function<Args, F: ImportableFn<Args> + Send + 'static>(
self,
name: impl ToString,
value: F
) -> Self
[src]
pub fn import_function<Args, F: ImportableFn<Args> + Send + 'static>(
self,
name: impl ToString,
value: F
) -> Self
[src]Import a function defined in the host into the guest. The function’s arguments and return type must all be serializable.
pub fn finish(self) -> Result<WasmPlugin>
[src]
pub fn finish(self) -> Result<WasmPlugin>
[src]Finalize the builder and create the WasmPlugin ready for use.
Auto Trait Implementations
impl !RefUnwindSafe for WasmPluginBuilder
impl Send for WasmPluginBuilder
impl Sync for WasmPluginBuilder
impl Unpin for WasmPluginBuilder
impl !UnwindSafe for WasmPluginBuilder
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T