pub struct Span {
pub end_line: Option<i32>,
pub file: Option<String>,
pub kind: Option<String>,
pub line: Option<i32>,
pub repo: Option<String>,
pub role: Option<String>,
pub score: Option<f64>,
pub snippet: Option<String>,
pub symbol: Option<String>,
pub tier: Option<String>,
}Fields§
§end_line: Option<i32>EndLine is the last line of the span, inclusive. It equals Line for a one-line span rather than being zero or absent.
file: Option<String>File is the path inside the repo, relative to its root and never absolute.
kind: Option<String>Kind is what the indexer decided this chunk IS — "func", "method", "type", "struct", "interface", "var", "const", or "block" for a run of code that declares nothing. Absent when the chunker could not classify it.
line: Option<i32>Line is where the span starts, 1-based, as an editor counts.
repo: Option<String>Repo is the indexed repository the span was found in, as it was indexed ("owner/name"). A search may be scoped to one repo or run across all of them, so this is how a caller tells the results apart.
role: Option<String>context: match | definition | caller
score: Option<f64>Score ranks this span against the OTHERS IN THE SAME RESPONSE and means nothing across responses or between tiers: the hybrid tier’s number is a reciprocal-rank fusion sum (Σ 1/(60+rank), so tenths at best), the symbol tier’s is a descending position count, and the text and semantic tiers pass through bm25 and cosine. Compare within a list; never threshold on it.
snippet: Option<String>Snippet is the code itself: a bounded excerpt on /search, the whole chunk on /context — which is why the same type serves both and why a /context span is the one an agent pastes into its window.
symbol: Option<String>Symbol is the declared name, when the span declares one. Absent on a block.
tier: Option<String>Tier is which retrieval produced the span: "hybrid" (the default — all three fused), "text" (trigram/FTS), "regex", "semantic" (vector), or "symbol". It is what explains a Score, so the two travel together.