Implement the mediator that routes commands and queries to their registered handlers through the middleware pipeline.
Scope
MediatorBuilder fluent builder: .with_handler(h), .with_middleware(m), .with_middleware_for::<C, M>(m), .verify_handlers(), .build().
Mediator with send::<C> and query::<Q> dispatching through the global then per-type middleware chain.
- Handler registry backed by
inventory for compile-time type discovery.
build() returns Err when verify_handlers() detects a registered type with no instance.
Acceptance criteria
Implement the mediator that routes commands and queries to their registered handlers through the middleware pipeline.
Scope
MediatorBuilderfluent builder:.with_handler(h),.with_middleware(m),.with_middleware_for::<C, M>(m),.verify_handlers(),.build().Mediatorwithsend::<C>andquery::<Q>dispatching through the global then per-type middleware chain.inventoryfor compile-time type discovery.build()returnsErrwhenverify_handlers()detects a registered type with no instance.Acceptance criteria
Mediator::builder().with_handler(h).build()dispatches a command to the correct handler.sendandquerycall.build()returnsErr(HandlerNotFound)whenverify_handlers()is active and an instance is missing.