pub struct Symbol {Show 13 fields
pub id: SymbolId,
pub name: String,
pub kind: SymbolKind,
pub visibility: Visibility,
pub file: SourcePath,
pub span: Span,
pub parent: Option<SymbolId>,
pub signature: Option<String>,
pub doc: Option<String>,
pub generics: Vec<String>,
pub tags: Vec<String>,
pub members: Vec<Member>,
pub flow: Option<Flow>,
}Expand description
A named definition in the codebase.
Fields§
§id: SymbolIdCanonical id.
name: StringShort name.
kind: SymbolKindKind of definition.
visibility: VisibilityVisibility.
file: SourcePathFile the definition lives in.
span: SpanWhere in the file.
parent: Option<SymbolId>Enclosing symbol (the type for a method, the module for an item).
signature: Option<String>One-line signature, e.g. pub fn connect(&self, addr: &str) -> Result<Conn>.
doc: Option<String>First sentence of the doc comment, if any. Kept short on purpose: it is context for an agent, not a copy of the docs.
generics: Vec<String>Generic parameters as written (T: Clone, 'a, const N: usize).
Notable attributes / modifiers: derives (derive(Debug)), async,
unsafe, const, test, cfg(...), trait name for trait impls, etc.
members: Vec<Member>Fields, variants and associated items.
flow: Option<Flow>Ordered control/call flow of the body, for callables.
Implementations§
Source§impl Symbol
impl Symbol
Sourcepub fn new(
id: SymbolId,
name: impl Into<String>,
kind: SymbolKind,
file: SourcePath,
) -> Self
pub fn new( id: SymbolId, name: impl Into<String>, kind: SymbolKind, file: SourcePath, ) -> Self
A symbol with only the required fields set; everything else empty / private. Frontends fill in the rest.