pub struct Symbol {Show 18 fields
pub id: String,
pub project_id: String,
pub file_path: String,
pub name: String,
pub qualified_name: String,
pub kind: String,
pub language: String,
pub byte_start: usize,
pub byte_end: usize,
pub line_start: usize,
pub line_end: usize,
pub signature: Option<String>,
pub docstring: Option<String>,
pub parent_symbol_id: Option<String>,
pub content_hash: String,
pub summary: Option<String>,
pub created_at: String,
pub updated_at: String,
}Expand description
A code symbol extracted from AST parsing.
Fields§
§id: String§project_id: String§file_path: String§name: String§qualified_name: String§kind: String§language: String§byte_start: usize§byte_end: usize§line_start: usize§line_end: usize§signature: Option<String>§docstring: Option<String>§parent_symbol_id: Option<String>§content_hash: String§summary: Option<String>§created_at: String§updated_at: StringImplementations§
Source§impl Symbol
impl Symbol
Sourcepub fn make_id(
project_id: &str,
file_path: &str,
name: &str,
kind: &str,
byte_start: usize,
) -> String
pub fn make_id( project_id: &str, file_path: &str, name: &str, kind: &str, byte_start: usize, ) -> String
Generate deterministic UUID5 for a symbol. Must produce identical IDs to Python Symbol.make_id().
Sourcepub fn from_row(row: &Row) -> Result<Self>
pub fn from_row(row: &Row) -> Result<Self>
Read a Symbol from a PostgreSQL row.
Callers should select via crate::db::symbol_select_columns() so integer
and timestamp fields are cast to stable Rust-readable types.
Sourcepub fn to_outline(&self) -> OutlineSymbol
pub fn to_outline(&self) -> OutlineSymbol
Slim representation for outline output.
Sourcepub fn to_brief(&self) -> SearchResult
pub fn to_brief(&self) -> SearchResult
Brief dict-like representation for search results.
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§
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
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