pub trait HostWasmRpc: Sized + Send {
// Required methods
fn new(
&mut self,
agent_id: AgentId,
) -> impl Future<Output = Result<Resource<WasmRpc>>> + Send;
fn invoke_and_await(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Result<WitValue, RpcError>>> + Send;
fn invoke(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Result<(), RpcError>>> + Send;
fn async_invoke_and_await(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Resource<FutureInvokeResult>>> + Send;
fn schedule_invocation(
&mut self,
self_: Resource<WasmRpc>,
scheduled_time: Datetime,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<()>> + Send;
fn schedule_cancelable_invocation(
&mut self,
self_: Resource<WasmRpc>,
scheduled_time: Datetime,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Resource<CancellationToken>>> + Send;
fn drop(
&mut self,
rep: Resource<WasmRpc>,
) -> impl Future<Output = Result<()>> + Send;
}Required Methods§
Sourcefn new(
&mut self,
agent_id: AgentId,
) -> impl Future<Output = Result<Resource<WasmRpc>>> + Send
fn new( &mut self, agent_id: AgentId, ) -> impl Future<Output = Result<Resource<WasmRpc>>> + Send
Constructs the RPC client connecting to the given target agent
Sourcefn invoke_and_await(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Result<WitValue, RpcError>>> + Send
fn invoke_and_await( &mut self, self_: Resource<WasmRpc>, function_name: String, function_params: Vec<WitValue>, ) -> impl Future<Output = Result<Result<WitValue, RpcError>>> + Send
Invokes a remote function with the given parameters, and awaits the result
Sourcefn invoke(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Result<(), RpcError>>> + Send
fn invoke( &mut self, self_: Resource<WasmRpc>, function_name: String, function_params: Vec<WitValue>, ) -> impl Future<Output = Result<Result<(), RpcError>>> + Send
Triggers the invocation of a remote function with the given parameters, and returns immediately.
Sourcefn async_invoke_and_await(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Resource<FutureInvokeResult>>> + Send
fn async_invoke_and_await( &mut self, self_: Resource<WasmRpc>, function_name: String, function_params: Vec<WitValue>, ) -> impl Future<Output = Result<Resource<FutureInvokeResult>>> + Send
Invokes a remote function with the given parameters, and returns a future-invoke-result value which can
be polled for the result.
With this function it is possible to call multiple (different) agents simultaneously.
Sourcefn schedule_invocation(
&mut self,
self_: Resource<WasmRpc>,
scheduled_time: Datetime,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<()>> + Send
fn schedule_invocation( &mut self, self_: Resource<WasmRpc>, scheduled_time: Datetime, function_name: String, function_params: Vec<WitValue>, ) -> impl Future<Output = Result<()>> + Send
Schedule invocation for later
Sourcefn schedule_cancelable_invocation(
&mut self,
self_: Resource<WasmRpc>,
scheduled_time: Datetime,
function_name: String,
function_params: Vec<WitValue>,
) -> impl Future<Output = Result<Resource<CancellationToken>>> + Send
fn schedule_cancelable_invocation( &mut self, self_: Resource<WasmRpc>, scheduled_time: Datetime, function_name: String, function_params: Vec<WitValue>, ) -> impl Future<Output = Result<Resource<CancellationToken>>> + Send
Schedule invocation for later. Call cancel on the returned resource to cancel the invocation before the scheduled time.
fn drop( &mut self, rep: Resource<WasmRpc>, ) -> impl Future<Output = Result<()>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<_T: HostWasmRpc + ?Sized + Send> HostWasmRpc for &mut _T
impl<_T: HostWasmRpc + ?Sized + Send> HostWasmRpc for &mut _T
Source§async fn new(&mut self, agent_id: AgentId) -> Result<Resource<WasmRpc>>
async fn new(&mut self, agent_id: AgentId) -> Result<Resource<WasmRpc>>
Constructs the RPC client connecting to the given target agent
Source§async fn invoke_and_await(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> Result<Result<WitValue, RpcError>>
async fn invoke_and_await( &mut self, self_: Resource<WasmRpc>, function_name: String, function_params: Vec<WitValue>, ) -> Result<Result<WitValue, RpcError>>
Invokes a remote function with the given parameters, and awaits the result
Source§async fn invoke(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> Result<Result<(), RpcError>>
async fn invoke( &mut self, self_: Resource<WasmRpc>, function_name: String, function_params: Vec<WitValue>, ) -> Result<Result<(), RpcError>>
Triggers the invocation of a remote function with the given parameters, and returns immediately.
Source§async fn async_invoke_and_await(
&mut self,
self_: Resource<WasmRpc>,
function_name: String,
function_params: Vec<WitValue>,
) -> Result<Resource<FutureInvokeResult>>
async fn async_invoke_and_await( &mut self, self_: Resource<WasmRpc>, function_name: String, function_params: Vec<WitValue>, ) -> Result<Resource<FutureInvokeResult>>
Invokes a remote function with the given parameters, and returns a future-invoke-result value which can
be polled for the result.
With this function it is possible to call multiple (different) agents simultaneously.
Source§async fn schedule_invocation(
&mut self,
self_: Resource<WasmRpc>,
scheduled_time: Datetime,
function_name: String,
function_params: Vec<WitValue>,
) -> Result<()>
async fn schedule_invocation( &mut self, self_: Resource<WasmRpc>, scheduled_time: Datetime, function_name: String, function_params: Vec<WitValue>, ) -> Result<()>
Schedule invocation for later
Source§async fn schedule_cancelable_invocation(
&mut self,
self_: Resource<WasmRpc>,
scheduled_time: Datetime,
function_name: String,
function_params: Vec<WitValue>,
) -> Result<Resource<CancellationToken>>
async fn schedule_cancelable_invocation( &mut self, self_: Resource<WasmRpc>, scheduled_time: Datetime, function_name: String, function_params: Vec<WitValue>, ) -> Result<Resource<CancellationToken>>
Schedule invocation for later. Call cancel on the returned resource to cancel the invocation before the scheduled time.