pub struct Runtime { /* private fields */ }Expand description
Composable Runtime for invoking Wasm Components
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn builder() -> RuntimeBuilder
pub fn builder() -> RuntimeBuilder
Create a RuntimeBuilder
Sourcepub fn list_components(&self) -> Vec<Component>
pub fn list_components(&self) -> Vec<Component>
List all components
Sourcepub fn get_component(&self, name: &str) -> Option<Component>
pub fn get_component(&self, name: &str) -> Option<Component>
Get a specific component by name
Sourcepub async fn invoke(
&self,
component_name: &str,
function_name: &str,
args: Vec<Value>,
) -> Result<Value>
pub async fn invoke( &self, component_name: &str, function_name: &str, args: Vec<Value>, ) -> Result<Value>
Invoke a component function
Sourcepub async fn invoke_with_env(
&self,
component_name: &str,
function_name: &str,
args: Vec<Value>,
env_vars: &[(&str, &str)],
) -> Result<Value>
pub async fn invoke_with_env( &self, component_name: &str, function_name: &str, args: Vec<Value>, env_vars: &[(&str, &str)], ) -> Result<Value>
Invoke a component function with environment variables
Sourcepub async fn instantiate(
&self,
component_name: &str,
) -> Result<(Store<ComponentState>, Instance)>
pub async fn instantiate( &self, component_name: &str, ) -> Result<(Store<ComponentState>, Instance)>
Instantiate a component
Sourcepub async fn instantiate_with_env(
&self,
component_name: &str,
env_vars: &[(&str, &str)],
) -> Result<(Store<ComponentState>, Instance)>
pub async fn instantiate_with_env( &self, component_name: &str, env_vars: &[(&str, &str)], ) -> Result<(Store<ComponentState>, Instance)>
Instantiate a component with environment variables
Sourcepub fn invoker(&self) -> Arc<dyn ComponentInvoker>
pub fn invoker(&self) -> Arc<dyn ComponentInvoker>
Get a component invoker for this runtime.
Sourcepub fn publisher(&self) -> Arc<dyn MessagePublisher>
pub fn publisher(&self) -> Arc<dyn MessagePublisher>
Get a message publisher for this runtime (messaging feature only).
Auto Trait Implementations§
impl Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
impl !UnwindSafe for Runtime
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