class

Analyzer::Rust::Poem

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

Poem analyzer (tree-sitter port). Poem registers routes two ways:

  1. Route chain: Route::new().at("/path", get(handler)). The second argument to .at is a single call_expression or a chain of .<verb>(handler) calls — each method registered this way creates a separate endpoint sharing the same path.

  2. poem-openapi macros: #[oai(path = "/p", method = "get")] attached to functions inside an impl Api { ... } block.

Constants

HTTP_VERBS = Set {"get", "post", "put", "delete", "patch", "head", "options"}

Class methods

tech_name
Source

Instance methods

analyze_file(path : String) : Array(Endpoint)
Source
extract_path_params(route : String, endpoint : Endpoint)
Source
normalize_path(route : String) : String

Convert :param syntax to {param} and ensure leading slash.

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