pub struct Symbol {Show 15 fields
pub id: String,
pub file_path: String,
pub name: String,
pub qualified_name: Option<String>,
pub kind: SymbolKind,
pub visibility: Visibility,
pub signature: Option<String>,
pub brief: Option<String>,
pub docstring: Option<String>,
pub line_start: u32,
pub line_end: u32,
pub col_start: u32,
pub col_end: u32,
pub parent_id: Option<String>,
pub source: Option<String>,
}Expand description
A code symbol (function, struct, etc.).
Fields§
§id: StringUnique identifier: ‘file_path::symbol_name’ or ‘file_path::parent::symbol_name’
file_path: StringPath to the file containing this symbol
name: StringSimple name of the symbol
qualified_name: Option<String>Fully qualified name (e.g., module::submodule::name)
kind: SymbolKindKind of symbol
visibility: VisibilityVisibility
signature: Option<String>Function/method signature or type definition
brief: Option<String>Brief one-line description (from doc comment)
docstring: Option<String>Full docstring
line_start: u32Starting line (1-indexed)
line_end: u32Ending line (1-indexed)
col_start: u32Starting column (0-indexed)
col_end: u32Ending column (0-indexed)
parent_id: Option<String>Parent symbol ID (e.g., impl block for methods)
source: Option<String>Source code of just this symbol
Implementations§
Source§impl Symbol
impl Symbol
Sourcepub fn make_id(file_path: &str, name: &str, parent: Option<&str>) -> String
pub fn make_id(file_path: &str, name: &str, parent: Option<&str>) -> String
Create a unique ID for this symbol.
Sourcepub fn make_id_with_line(
file_path: &str,
name: &str,
parent: Option<&str>,
line: u32,
) -> String
pub fn make_id_with_line( file_path: &str, name: &str, parent: Option<&str>, line: u32, ) -> String
Create a unique ID for this symbol with line number for disambiguation.
Sourcepub fn to_embedding_text(&self) -> String
pub fn to_embedding_text(&self) -> String
Generate text for embedding (semantic search).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Symbol
impl<'de> Deserialize<'de> for Symbol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnsafeUnpin for Symbol
impl UnwindSafe for Symbol
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more