wrpc_runtime_wasmtime

Trait WrpcView

Source
pub trait WrpcView: IoView + Send {
    type Invoke: Invoke;

    // Required methods
    fn context(&self) -> <Self::Invoke as Invoke>::Context;
    fn client(&self) -> &Self::Invoke;
    fn shared_resources(&mut self) -> &mut SharedResourceTable;

    // Provided method
    fn timeout(&self) -> Option<Duration> { ... }
}

Required Associated Types§

Required Methods§

Source

fn context(&self) -> <Self::Invoke as Invoke>::Context

Returns context to use for invocation

Source

fn client(&self) -> &Self::Invoke

Returns an Invoke implementation used to satisfy polyfilled imports

Source

fn shared_resources(&mut self) -> &mut SharedResourceTable

Returns a table of shared exported resources

Provided Methods§

Source

fn timeout(&self) -> Option<Duration>

Optional invocation timeout, component will trap if invocation is not finished within the returned Duration. If this method returns None, then no timeout will be used.

Implementations on Foreign Types§

Source§

impl<T: WrpcView> WrpcView for &mut T

Source§

type Invoke = <T as WrpcView>::Invoke

Source§

fn context(&self) -> <Self::Invoke as Invoke>::Context

Source§

fn client(&self) -> &Self::Invoke

Source§

fn shared_resources(&mut self) -> &mut SharedResourceTable

Source§

fn timeout(&self) -> Option<Duration>

Implementors§