class
Analyzer::Rust::Gotham
- Analyzer::Rust::Gotham
- Analyzer::Rust::RustEngine
- Analyzer
- Reference
- Object
Overview
Gotham analyzer (tree-sitter port). Gotham wires routes with a
builder chain that pairs each verb call with a following .to:
Router::builder()
.get("/users/:id").to(user_handler)
.post("/users").to(create_user_handler)
The analyzer walks call_expression nodes whose function is a
field_expression named to — the receiver of .to(handler) is
the .<verb>("/path") call, so each routing entry has both
pieces locally and we don't need to thread state through the
chain.
Defined in:
analyzer/analyzers/rust/gotham.crConstant Summary
-
HTTP_VERBS =
Set {"get", "post", "put", "delete", "patch", "head", "options"} -
TERMINAL_NAMES =
Set {"to", "to_file", "to_dir", "to_new_handler", "to_async_borrowing"} -
Route terminals:
.to(handler)binds a handler fn;.to_file/.to_dir/.to_new_handlerbind static/dynamic handlers (no fn name, but still a real route).