Skip to main content

Crate hexeract_core

Crate hexeract_core 

Source
Expand description

Core traits and types for the Hexeract messaging framework.

This crate is the cross-cutting foundation that every other Hexeract crate depends on. It defines the marker traits for messages (Command, Query, Notification), the matching handler traits (CommandHandler, QueryHandler, NotificationHandler), the MessageEnvelope and HandlerContext passed alongside every dispatch, the Middleware / Next / Terminal pipeline primitives, the unified HexeractError type, and the HandlerRegistration metadata collected by the #[handler] macro.

Re-exports§

pub use command::Command;
pub use context::HandlerContext;
pub use envelope::MessageEnvelope;
pub use error::HexeractError;
pub use error::NotificationFailure;
pub use handler::CommandHandler;
pub use handler::NotificationHandler;
pub use handler::QueryHandler;
pub use ids::CorrelationId;
pub use ids::MessageId;
pub use middleware::BoxOutput;
pub use middleware::Middleware;
pub use middleware::Next;
pub use middleware::Terminal;
pub use notification::Notification;
pub use query::Query;
pub use registration::HandlerKind;
pub use registration::HandlerRegistration;

Modules§

command
Marker trait for messages expressing the intent to mutate state.
context
Contextual information propagated into every handler invocation.
envelope
Type-erased metadata carried alongside every dispatch.
error
Unified framework error type.
handler
Async handler traits dispatched by the mediator.
ids
Unique identifier newtypes for messages and correlations.
middleware
Middleware pipeline primitives.
notification
Marker trait for broadcast messages with fan-out semantics.
query
Marker trait for read-only messages asking for information.
registration
Handler registration metadata collected at link time by the #[handler] macro. Handler registration metadata collected at link time by the #[handler] procedural macro from hexeract-macros.