pub struct Host { /* private fields */ }
Expand description
A wasmRS native Host.
Implementations§
Source§impl Host
impl Host
Sourcepub async fn new<E: EngineProvider + Send + Sync + 'static>(
engine: E,
) -> Result<Self, Error>
pub async fn new<E: EngineProvider + Send + Sync + 'static>( engine: E, ) -> Result<Self, Error>
Create a new Host with an EngineProvider implementation.
Sourcepub async fn new_context(
&self,
host_buffer_size: u32,
guest_buffer_size: u32,
) -> Result<CallContext, Error>
pub async fn new_context( &self, host_buffer_size: u32, guest_buffer_size: u32, ) -> Result<CallContext, Error>
Create a new CallContext, a way to bucket calls together with the same memory and configuration.
Sourcepub fn register_request_response(
&self,
ns: impl AsRef<str>,
op: impl AsRef<str>,
handler: OperationHandler<IncomingMono, OutgoingMono>,
) -> usize
pub fn register_request_response( &self, ns: impl AsRef<str>, op: impl AsRef<str>, handler: OperationHandler<IncomingMono, OutgoingMono>, ) -> usize
Register a Request/Response style handler on the host.
Sourcepub fn register_request_stream(
&self,
ns: impl AsRef<str>,
op: impl AsRef<str>,
handler: OperationHandler<IncomingMono, OutgoingStream>,
) -> usize
pub fn register_request_stream( &self, ns: impl AsRef<str>, op: impl AsRef<str>, handler: OperationHandler<IncomingMono, OutgoingStream>, ) -> usize
Register a Request/Response style handler on the host.
Sourcepub fn register_request_channel(
&self,
ns: impl AsRef<str>,
op: impl AsRef<str>,
handler: OperationHandler<IncomingStream, OutgoingStream>,
) -> usize
pub fn register_request_channel( &self, ns: impl AsRef<str>, op: impl AsRef<str>, handler: OperationHandler<IncomingStream, OutgoingStream>, ) -> usize
Register a Request/Response style handler on the host.
Sourcepub fn register_fire_and_forget(
&self,
ns: impl AsRef<str>,
op: impl AsRef<str>,
handler: OperationHandler<IncomingMono, ()>,
) -> usize
pub fn register_fire_and_forget( &self, ns: impl AsRef<str>, op: impl AsRef<str>, handler: OperationHandler<IncomingMono, ()>, ) -> usize
Register a Request/Response style handler on the host.
Auto Trait Implementations§
impl Freeze for Host
impl !RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl !UnwindSafe for Host
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