pub trait Routes<App>: Sized + Clonewhere
App: App,{
// Required method
fn new(router: Weak<EffectRouter<App, Self>>) -> Self;
}Expand description
A set of effect handlers (“routes”) owned by an EffectRouter.
Implement this on a type that groups together the individual routes your app
needs (for example a Serialized lane plus one or more
Parked lanes and core-local handlers). The router calls
Routes::new while it is being constructed, handing over a Weak
reference to itself so each route can later resolve requests and advance the
runtime.
The type must be Clone because a clone is given to the routing closure
built in EffectRouter::new; routes are typically wrapped in Arc so
cloning is cheap and shares the same underlying handlers.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.