Skip to main content

StatefulHandlerV2

Trait StatefulHandlerV2 

Source
pub trait StatefulHandlerV2:
    Send
    + Sync
    + Debug {
    // Required methods
    fn metadata(&self) -> &StatefulHandlerMetadataV2;
    fn handle(
        &self,
        event_json: &[u8],
        current_state: &[u8],
        deterministic_seed: Option<u64>,
    ) -> Result<StatefulHandlerResultV2, StatefulHandlerErrorV2>;
}
Expand description

Host abstraction implemented by sandboxed ABI v2 handlers and test doubles. It grants no filesystem, network, process, time or randomness; deterministic randomness is supplied only through deterministic_seed.

Required Methods§

Source

fn metadata(&self) -> &StatefulHandlerMetadataV2

Source

fn handle( &self, event_json: &[u8], current_state: &[u8], deterministic_seed: Option<u64>, ) -> Result<StatefulHandlerResultV2, StatefulHandlerErrorV2>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§