class

Analyzer::Rust::Rocket

Inherits Analyzer::Rust::RustEngine < FileScanEngine < Analyzer < FileHelper < Reference < Object

Rocket analyzer (tree-sitter port). Rocket attaches routes via #[get("/x")] / #[post("/x", data = "<body>")] outer attribute macros. tree-sitter-rust leaves macro argument lists as token_tree, but the lexer still tags string_literal / identifier children inside — we walk those for the route path, the data = "<...>" form, query / path angle-bracket params, and CookieJar / headers().get(...) body uses.

Constants

BODY_GUARDS = {"Json" => "json", "Form" => "form", "MsgPack" => "body"}

Rocket's data guards that decode a body into a type, by wire format.

MOUNT_INDEX_EVIDENCE_RE = Regex.union("routes!", ".mount(", "routes as")

Precompiled union for build_mount_index's per-file evidence gate, so it costs a single PCRE2 match instead of three naive substring scans.

TRANSPARENT_WRAPPERS = Set {"Option", "Vec", "Box", "Strict", "Lenient"}

Wrappers that change how a value decodes or whether it is required, not which fields it reads.

Class methods

tech_name
Source

Instance methods

analyze
Source
analyze_file(path : String) : Array(Endpoint)
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source

Nested types