pub struct Plugin {
pub module: Module,
pub linker: Linker<Internal>,
pub instance: Instance,
pub last_error: Option<CString>,
pub memory: PluginMemory,
pub manifest: Manifest,
}Expand description
Plugin contains everything needed to execute a WASM function
Fields
module: Modulelinker: Linker<Internal>instance: Instancelast_error: Option<CString>memory: PluginMemorymanifest: ManifestImplementations
sourceimpl Plugin
impl Plugin
sourcepub fn new(wasm: impl AsRef<[u8]>, with_wasi: bool) -> Result<Plugin, Error>
pub fn new(wasm: impl AsRef<[u8]>, with_wasi: bool) -> Result<Plugin, Error>
Create a new plugin from the given WASM code
pub fn error<E>(&mut self, e: impl Debug, x: E) -> E
sourcepub fn clear_error(&mut self)
pub fn clear_error(&mut self)
Unset last_error field
sourcepub fn set_input(&mut self, handle: MemoryBlock)
pub fn set_input(&mut self, handle: MemoryBlock)
Store input in memory and initialize Internal pointer
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Plugin
impl !Send for Plugin
impl !Sync for Plugin
impl Unpin for Plugin
impl !UnwindSafe for Plugin
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
fn get_fd_flags(&self) -> Result<FdFlags, Error> where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error> where
T: AsFilelike,
Query the “status” flags for the self file descriptor.
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error> where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error> where
T: AsFilelike,
Create a new SetFdFlags value for use with set_fd_flags. Read more
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error> where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error> where
T: AsFilelike,
Set the “status” flags for the self file descriptor. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more