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§

pub extern crate wapc_guest as wapc;

Modules§

errors
Errors
events
extras
http_client
HTTP Client
keyvalue
Key-Value Store
logger
messaging
Message Broker
objectstore
prelude
Glob imports for common actor module development
untyped
Message Broker

Macros§

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

Functions§

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

Type Aliases§

HandlerResult