Trait gtest::WasmProgram

source ·
pub trait WasmProgram: Debug {
    // Required methods
    fn init(
        &mut self,
        payload: Vec<u8>
    ) -> Result<Option<Vec<u8>>, &'static str>;
    fn handle(
        &mut self,
        payload: Vec<u8>
    ) -> Result<Option<Vec<u8>>, &'static str>;
    fn handle_reply(&mut self, payload: Vec<u8>) -> Result<(), &'static str>;
    fn handle_signal(&mut self, payload: Vec<u8>) -> Result<(), &'static str>;
    fn state(&mut self) -> Result<Vec<u8>, &'static str>;

    // Provided method
    fn debug(&mut self, data: &str) { ... }
}

Required Methods§

source

fn init(&mut self, payload: Vec<u8>) -> Result<Option<Vec<u8>>, &'static str>

source

fn handle(&mut self, payload: Vec<u8>) -> Result<Option<Vec<u8>>, &'static str>

source

fn handle_reply(&mut self, payload: Vec<u8>) -> Result<(), &'static str>

source

fn handle_signal(&mut self, payload: Vec<u8>) -> Result<(), &'static str>

source

fn state(&mut self) -> Result<Vec<u8>, &'static str>

Provided Methods§

source

fn debug(&mut self, data: &str)

Implementors§