Skip to main content

Crate stagecraft

Crate stagecraft 

Source
Expand description

Tokio-based actor framework.

Stagecraft provides four actor traits and a Context type that orchestrates their lifecycle. Actors communicate through typed message channels via Handle.

§Actor Variants

TraitSend requiredEvent stream
Actoryesno
StreamActoryesyes
LocalActornono
LocalStreamActornoyes

Use Actor for the common case. Use LocalActor when actor state is !Send (e.g. it holds a libinput context). Append Stream to also react to a Stream.

Structs§

ActorDead
Error returned when a message cannot be delivered because the actor is no longer running.
Context
Lifecycle context passed to actor methods.
Handle
A cloneable handle to a running actor.

Traits§

Actor
An asynchronous, Send-safe actor.
HasMailbox
Base trait for all actors.
LocalActor
An actor that runs on a dedicated OS thread with a LocalSet.
LocalStreamActor
A LocalActor that also processes events from a Stream.
StreamActor
An Actor that also processes events from a Stream.

Functions§

spawn
Spawn a root Actor onto the current Tokio runtime.

Attribute Macros§

message
Derive actor message convenience methods on a Handle.