runact 1.2.0

A Rust-native actor runtime with BEAM-style processes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::actor::context::ActorContext;
use crate::actor::error::ActorError;

/// Actor trait — the fundamental unit of computation.
pub trait Actor: Send + 'static {
    /// Message type this actor handles.
    type Message: Send + 'static;

    /// Handle a message.
    ///
    /// Called for each message received by the actor.
    /// Must return quickly — don't block or loop forever.
    fn handle(
        &mut self,
        message: Self::Message,
        context: &mut ActorContext,
    ) -> Result<(), ActorError>;
}