Crate wasmcloud_actor_core[][src]

Core wasmCloud Actor Interface

This crate contains the data types required by all actors, namely the health check request and health check response, and CapabilityConfiguration, a struct used by capability providers to receive link data for an actor.

If you use the init macro, then a default health check handler will be created for you, as shown in this example. If you want to provide your own custom health check handler, then simply call Handlers::register_health_check with your handler function.


extern crate wasmcloud_actor_core as actor;

pub fn init() {
    // register handlers here


Your init function is called by the wasmcloud host runtime when the actor is first loaded into the host. This function is only ever called once, and is called before any provider linking takes place. In other words, code written inside this function cannot communicate with capability providers.

Also, in keeping with the notion of stateless actors, avoid using this function to initialize or create global state.



Used to register core message handlers


A request sent to the actor by the host itself in order to determine health status


All actors must return a health check response to the host upon receipt of a health request. Returning in Err indicates total actor failure, while returning a valid response with the healthy flag set to false indicates that the actor has somehow detected that it cannot perform its given task



The standard function for de-serializing codec structs from a format suitable for message exchange between actor and host. Use of any other function to deserialize could result in breaking incompatibilities.


The standard function for serializing codec structs into a format that can be used for message exchange between actor and host. Use of any other function to serialize could result in breaking incompatibilities.