[−][src]Crate wascc_actor
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!{ http::OP_HANDLE_REQUEST => hello_world, core::OP_HEALTH_REQUEST => health } pub fn hello_world(ctx: &CapabilitiesContext, _req: http::Request) -> ReceiveResult { Ok(vec![]) } pub fn health(ctx: &CapabilitiesContext, _req: core::HealthRequest) -> ReceiveResult { Ok(vec![]) }
Re-exports
pub extern crate wapc_guest as wapc; |
Modules
errors | Errors |
events | |
extras | |
kv | Key-Value Store |
logger | |
msg | Message Broker |
objectstore | |
prelude | Glob imports for common actor module development |
raw | Raw capability provider interface |
Macros
actor_handlers | Actor developers will use this macro to set up their operation handlers |
Structs
CapabilitiesContext | The capabilities context is the gateway through which all actors communicate with a host runtime. A reference
to a capabilities context is passed to the receive function defined by the actor. Individual capabilities are separated
through function calls for each capability provider, including any bound opaque |
Traits
EventStreams | Interaction with append-only event streams. This API is not yet mature and is missing functionality. |
Extras | Miscellaneous utilities that are often needed regardless of capability providers |
KeyValueStore | Represents an abstraction around a client consuming a Key-Value store provided by the host |
Logger | |
MessageBroker | Represents an abstraction around a client consuming a message broker provided by the host |
ObjectStore | |
RawCapability | A loosely typed, opaque client consuming a capability provider in the host runtime |
Type Definitions
ReceiveResult | |
Result |