Skip to main content

Symbol

Trait Symbol 

Source
pub trait Symbol {
    // Required methods
    fn name(&self) -> &str;
    fn kind(&self) -> &str;
    fn byte_start(&self) -> usize;
    fn byte_end(&self) -> usize;
    fn line_start(&self) -> usize;
    fn line_end(&self) -> usize;
    fn col_start(&self) -> usize;
    fn col_end(&self) -> usize;
    fn fully_qualified(&self) -> &str;
    fn language(&self) -> Language;
}
Expand description

Common trait that all language-specific symbols implement.

This trait provides access to the common properties shared across all languages:

  • Name (local and fully qualified)
  • Byte and line/column spans
  • Language identification

Required Methods§

Source

fn name(&self) -> &str

Get the local symbol name (e.g., foo).

Source

fn kind(&self) -> &str

Get the symbol kind as a string (e.g., “function”, “class”).

Source

fn byte_start(&self) -> usize

Get the start byte offset.

Source

fn byte_end(&self) -> usize

Get the end byte offset.

Source

fn line_start(&self) -> usize

Get the start line (1-based).

Source

fn line_end(&self) -> usize

Get the end line (1-based).

Source

fn col_start(&self) -> usize

Get the start column (0-based, in bytes).

Source

fn col_end(&self) -> usize

Get the end column (0-based, in bytes).

Source

fn fully_qualified(&self) -> &str

Get the fully qualified name (e.g., module::foo).

Source

fn language(&self) -> Language

Get the programming language this symbol belongs to.

Implementors§