Provide the extension point that lets users and built-in components intercept every dispatch without coupling to the handler type.
Scope
MessageEnvelope carrying type_name, MessageId and CorrelationId for middleware inspection.
BoxOutput type alias (Box<dyn Any + Send + Sync>) for type-erased handler output inside the pipeline.
Next<'a> opaque struct wrapping the remainder of the middleware chain.
Middleware async trait via trait_variant::make(Send) receiving (&MessageEnvelope, &HandlerContext, Next).
Acceptance criteria
Provide the extension point that lets users and built-in components intercept every dispatch without coupling to the handler type.
Scope
MessageEnvelopecarryingtype_name,MessageIdandCorrelationIdfor middleware inspection.BoxOutputtype alias (Box<dyn Any + Send + Sync>) for type-erased handler output inside the pipeline.Next<'a>opaque struct wrapping the remainder of the middleware chain.Middlewareasync trait viatrait_variant::make(Send)receiving(&MessageEnvelope, &HandlerContext, Next).Acceptance criteria
Next::runpropagatesHexeractErrorfrom the inner handler unchanged.next.runreturns its own error without panicking.cargo clippy -p hexeract-core -- -D warningspasses.