feat(axum): start stateful interactions tersely
Add state_interactions as a small helper for app-owned stateful registries, and use it in the workout exemplar to remove one layer of repetitive route wiring without hiding generated handles or app handlers. req: axum_integration/003 req: ceremony/001 req: dx/003 req: codegen/002 req: examples/001
This commit is contained in:
@@ -460,6 +460,14 @@ pub const fn interactions(fingerprint: BuildFingerprint) -> HandlerRegistry {
|
||||
HandlerRegistry::new(fingerprint)
|
||||
}
|
||||
|
||||
pub fn state_interactions<S>(fingerprint: BuildFingerprint, state: S) -> StateHandlerRegistry<S>
|
||||
where
|
||||
S: Clone + Send + Sync + 'static,
|
||||
{
|
||||
// req: axum_integration/003 req: ceremony/001
|
||||
interactions(fingerprint).with_state(state)
|
||||
}
|
||||
|
||||
impl InteractionRequest {
|
||||
pub fn dispatch(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user