pub struct Plugin {
pub modules: BTreeMap<String, Module>,
pub linker: Linker<Internal>,
pub store: Store<Internal>,
pub instance: Option<Instance>,
pub instance_pre: InstancePre<Internal>,
pub timer_id: Uuid,
/* private fields */
}
Expand description
Plugin contains everything needed to execute a WASM function
Fields§
§modules: BTreeMap<String, Module>
All modules that were provided to the linker
linker: Linker<Internal>
Used to define functions and create new instances
store: Store<Internal>
§instance: Option<Instance>
Instance provides the ability to call functions in a module
instance_pre: InstancePre<Internal>
§timer_id: Uuid
The ID used to identify this plugin with the Timer
Implementations§
Trait Implementations§
Source§impl InternalExt for Plugin
impl InternalExt for Plugin
fn store(&self) -> &Store<Internal>
fn store_mut(&mut self) -> &mut Store<Internal>
fn linker(&self) -> &Linker<Internal>
fn linker_mut(&mut self) -> &mut Linker<Internal>
fn linker_and_store(&mut self) -> (&mut Linker<Internal>, &mut Store<Internal>)
fn internal(&self) -> &Internal
fn internal_mut(&mut self) -> &mut Internal
fn memory_ptr(&mut self) -> *mut u8
fn memory(&mut self) -> &mut [u8] ⓘ
fn memory_read(&mut self, offs: u64, len: Size) -> &[u8] ⓘ
fn memory_read_str(&mut self, offs: u64) -> Result<&str, Utf8Error>
fn memory_write(&mut self, offs: u64, bytes: impl AsRef<[u8]>)
fn memory_alloc(&mut self, n: Size) -> Result<u64, Error>
fn memory_alloc_bytes(&mut self, bytes: impl AsRef<[u8]>) -> Result<u64, Error>
fn memory_free(&mut self, offs: u64)
fn memory_length(&mut self, offs: u64) -> u64
fn error<E>(&mut self, e: impl Debug, x: E) -> E
fn clear_error(&mut self)
fn has_error(&mut self) -> bool
fn get_error(&mut self) -> Option<&str>
Auto Trait Implementations§
impl Freeze for Plugin
impl !RefUnwindSafe for Plugin
impl !Send for Plugin
impl !Sync for Plugin
impl Unpin for Plugin
impl !UnwindSafe for Plugin
Blanket Implementations§
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§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.Source§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,
Source§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 moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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