guinea-core 0.18.8

guinea's core: actors, reducers, scopes and the event bus
Documentation
use crate::actor::Cx;
use crate::actor::event_bus::builder::EventSubscription;

pub trait Handler<M: 'static>: 'static {
    /// Where the handler was written; `#[handler]` fills it in.
    const DECLARED: Option<crate::actor::shape::Declared> = None;

    /// Whether handling `M` answers it: set for a request's handler, the one
    /// that returns the reply. A bus lets one subscriber answer each request
    /// type; the rest only hear it.
    const ANSWERS: bool = false;

    fn handle(&mut self, msg: M, cx: Cx<Self, M>)
    where
        Self: Sized;
}

pub trait ManagedActor: Sized + 'static {
    type Bus: EventSubscription<Self>;
    type Signals;
    /// Declared outgoing messages per handler, or `Open` when undeclared.
    type Flow;
    /// What `actor!` declared, for devtools.
    const SHAPE: crate::actor::shape::Shape = crate::actor::shape::Shape::UNKNOWN;
}

pub trait AllowedSignal<M: 'static> {}
impl<M: 'static> AllowedSignal<M> for M {}