serve: give the json layer its trait and drop the qualifiers #95

Merged
PerishFire merged 1 commit from serve-words into main 2026-07-21 05:23:20 +00:00
Owner
No description provided.
serve: give the json layer its trait and drop the qualifiers
All checks were successful
guard / guard (pull_request) Successful in 27s
20cbb9d3e4
Seven of these were one shape: pack_json, row_json, tie_json and
cell_json are four functions of the form T -> Value. That is a trait, and
naming the type in the function is what a missing trait looks like. Emit
takes them, and Bag gets an impl too, which folds the match that pack_json
was carrying inline.

The method is emit, not show: Cell already has an inherent show() -> String,
and an inherent method wins over a trait one, so a Show trait would have
compiled and silently returned the wrong type at every Cell.

unit_name and bond_name were methods on Core wearing a first argument.
Reach makes them methods -- which also sidesteps a shadowing trap, since
route.rs binds locals called unit and bond that would have hidden any
free function by those names. cells_skip was cells with an argument
missing; cells now always takes skip and callers pass &[].

The last three are qualifiers that said nothing: QueryBody -> Body,
no_read -> refuse, patch_tie -> retie, the last two joining the handler
vocabulary already in the file (list, create, one, edit, remove, attach,
detach).

Nothing here is registered in vocabulary.toml. That file's own header
says almost every compound should be refactored rather than registered,
and [compound] is still empty.

serve/ is now clean apart from into_response, which is axum's trait
method -- a binding site, not a naming site, and being handled in
negentropy rather than here.

Debt 88 -> 81, all of it word (63 -> 56). guard clean, 45 tests green.
PerishFire deleted branch serve-words 2026-07-21 05:23:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PerishLab/keel!95
No description provided.