pub struct WasmHandle { /* private fields */ }Expand description
Thread-safe handle to WasmPackageHost for use in async Axum handlers.
Implementations§
Source§impl WasmHandle
impl WasmHandle
pub fn new(host: WasmPackageHost) -> Self
Sourcepub fn call(
&self,
package_name: &str,
func: &str,
input: &str,
) -> Result<String>
pub fn call( &self, package_name: &str, func: &str, input: &str, ) -> Result<String>
Call a package function. Safe to call from async context.
pub fn call_isolated( &self, package_name: &str, func: &str, input: &str, ) -> Result<String>
pub fn has_package(&self, name: &str) -> bool
pub fn package_names(&self) -> Vec<String>
Sourcepub fn kv_set(&self, key: &str, value: &str)
pub fn kv_set(&self, key: &str, value: &str)
Write a value into the shared KV store (see WasmPackageHost::kv_set).
pub fn set_app_state(&self, app_state: AppState) -> Result<()>
Sourcepub fn load_package(&self, info: &PackageLoadInfo) -> Result<()>
pub fn load_package(&self, info: &PackageLoadInfo) -> Result<()>
Dynamically load a new plugin.
Sourcepub fn unload_package(&self, name: &str) -> Result<()>
pub fn unload_package(&self, name: &str) -> Result<()>
Unload a package by name.
Sourcepub fn reload_package(&self, info: &PackageLoadInfo) -> Result<()>
pub fn reload_package(&self, info: &PackageLoadInfo) -> Result<()>
Reload a package (unload + load).
Trait Implementations§
Source§impl Clone for WasmHandle
impl Clone for WasmHandle
Source§fn clone(&self) -> WasmHandle
fn clone(&self) -> WasmHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WasmHandle
impl RefUnwindSafe for WasmHandle
impl Send for WasmHandle
impl Sync for WasmHandle
impl Unpin for WasmHandle
impl UnsafeUnpin for WasmHandle
impl UnwindSafe for WasmHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + 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