Crate wascc_actor

Source
Expand description

§wascc-actor

The wascc-actor library provides WebAssembly module developers with access to the wascc host runtime. Each actor module has a single receive function, declared with the actor_receive! macro. Inside this receive function, the actor module should check the operation of the delivered message and handle it accordingly, returning any binary payload in response. It is the responsibility of the actor module to ensure that the capability provider will be able to understand whichever messages it sends.

§Example

extern crate wascc_actor as actor;

use actor::prelude::*;

actor_handlers!{
   codec::http::OP_HANDLE_REQUEST => hello_world,
   codec::core::OP_HEALTH_REQUEST => health
}

pub fn hello_world(_req: codec::http::Request) -> HandlerResult<codec::http::Response> {
  Ok(codec::http::Response::ok())
}

pub fn health(_req: codec::core::HealthRequest) -> HandlerResult<()> {
  Ok(())
}

Re-exports§

Modules§

Macros§

  • Actor developers will use this macro to set up their operation handlers

Functions§

  • Use this function for simple, unstructured logging outside the usual log macros

Type Aliases§