feat(axum): register checked handles

Add HandlerRegistry::register_handle for generated Handle<T> values and migrate examples away from passing raw numeric handle ids at registration sites.

req: ceremony/004

req: public_api/001
This commit is contained in:
slhx agent
2026-05-26 00:26:42 +02:00
parent 4803d681d2
commit bc8534a768
5 changed files with 34 additions and 21 deletions
+4 -4
View File
@@ -146,7 +146,7 @@ async fn events(Query(params): Query<BTreeMap<String, String>>) -> impl IntoResp
fn registry(state: Arc<AppState>) -> HandlerRegistry {
HandlerRegistry::new(ui::BUILD_FINGERPRINT)
.register(ui::board::handles::create_card.id().id, {
.register_handle(ui::board::handles::create_card, {
let state = state.clone();
move |form| {
// req: examples/001 req: form/002
@@ -161,7 +161,7 @@ fn registry(state: Arc<AppState>) -> HandlerRegistry {
board_effects(&board, "Card added")
}
})
.register(ui::board::handles::move_left.id().id, {
.register_handle(ui::board::handles::move_left, {
let state = state.clone();
move |form| {
// req: examples/001 req: list/003
@@ -172,7 +172,7 @@ fn registry(state: Arc<AppState>) -> HandlerRegistry {
board_effects(&board, if moved { "Card moved left" } else { "Card not found" })
}
})
.register(ui::board::handles::move_right.id().id, {
.register_handle(ui::board::handles::move_right, {
let state = state.clone();
move |form| {
// req: examples/001 req: list/003
@@ -183,7 +183,7 @@ fn registry(state: Arc<AppState>) -> HandlerRegistry {
board_effects(&board, if moved { "Card moved right" } else { "Card not found" })
}
})
.register(ui::board::handles::delete_card.id().id, {
.register_handle(ui::board::handles::delete_card, {
let state = state.clone();
move |form| {
// req: examples/001 req: list/003