pub struct Symbol {
pub name: String,
pub kind: SymbolKind,
pub signature: String,
pub docstring: Option<String>,
pub attributes: Vec<String>,
pub start_line: usize,
pub end_line: usize,
pub visibility: Visibility,
pub children: Vec<Symbol>,
pub is_interface_impl: bool,
pub implements: Vec<String>,
}Expand description
A code symbol extracted from source
Fields§
§name: StringThe symbol’s unqualified name.
kind: SymbolKindClassification of the symbol (function, class, heading, etc.).
signature: StringFull signature string (e.g., fn foo(x: i32) -> bool). Empty if not applicable.
docstring: Option<String>Documentation comment or docstring attached to this symbol, if present.
attributes: Vec<String>Language-specific decorators, annotations, or attributes (e.g., #[derive(...)] in Rust,
@decorator in Python). Each entry is the raw text of one attribute.
start_line: usize1-based line number where the symbol starts.
end_line: usize1-based line number where the symbol ends (inclusive).
visibility: VisibilityVisibility of the symbol.
children: Vec<Symbol>Nested symbols (e.g., methods inside a class). Empty for leaf symbols.
is_interface_impl: boolTrue if this symbol implements an interface/trait (e.g., method in impl Trait for Type)
implements: Vec<String>Parent interfaces/classes this symbol extends or implements (for semantic matching)