pub trait RouterDef<B, State = (), RetryPipeline = PublishIdentity>where
B: Broker,{ }Expand description
A mountable group of handler registrations.
Mounting applies the app’s global BlanketLayer to each handler and registers it, so the
app-wide layer stack reaches router handlers.
Implemented by Router and its internal registration list; you
obtain one from a builder and pass it to
include_router. You do not implement it.
State is the app’s shared-state type: a router whose handlers read typed state is
RouterDef<B, State> only for that State, while a state-agnostic router is generic over it, so it
mounts on any app.
RetryPipeline is the publish path a registration’s retry copies travel: a router hands its
own down to its registrations, and the parameter defaults to
PublishIdentity, which is the path of a router built
without publish middleware - so RouterDef<B> names what a builder function returns.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".