[−][src]Struct wapc::ModuleState
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]
&self,
binding: &str,
namespace: &str,
operation: &str,
payload: &[u8]
) -> Result<i32, Box<dyn Error>>
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]
fn default() -> ModuleState
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ModuleState
impl Send for ModuleState
impl Sync for ModuleState
impl Unpin for ModuleState
impl !UnwindSafe for ModuleState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,