[][src]Struct wapc::ModuleState

pub struct ModuleState { /* fields omitted */ }

Module state is essentially a 'handle' that is passed to a runtime engine to allow it to read and write relevant data as different low-level functions are executed during a waPC conversation

Implementations

impl ModuleState[src]

pub fn get_guest_request(&self) -> Option<Invocation>[src]

Retrieves the value, if any, of the current guest request

pub fn get_host_response(&self) -> Option<Vec<u8>>[src]

Retrieves the value of the current host response

pub fn set_guest_error(&self, error: String)[src]

Sets a value indicating that an error occurred inside the execution of a guest call

pub fn set_guest_response(&self, response: Vec<u8>)[src]

Sets the value indicating the response data from a guest call

pub fn get_guest_response(&self) -> Option<Vec<u8>>[src]

Queries the value of the current guest response

pub fn get_host_error(&self) -> Option<String>[src]

Queries the value of the current host error

pub fn do_host_call(
    &self,
    binding: &str,
    namespace: &str,
    operation: &str,
    payload: &[u8]
) -> Result<i32, Box<dyn Error>>
[src]

Invoked when the guest module wishes to make a call on the host

pub fn do_console_log(&self, msg: &str)[src]

Invoked when the guest module wants to write a message to the host's stdout

Trait Implementations

impl Default for ModuleState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.