pub struct CodeAstParser { /* private fields */ }Expand description
Parses Rust source into SymbolAnchor records.
Implementations§
Source§impl CodeAstParser
impl CodeAstParser
Sourcepub fn new_rust() -> Result<Self, AstError>
pub fn new_rust() -> Result<Self, AstError>
Create a parser loaded with the tree-sitter Rust grammar.
Sourcepub fn parse_symbols(
&mut self,
crate_name: &str,
file_path: &str,
source_code: &str,
) -> Result<Vec<SymbolAnchor>, AstError>
pub fn parse_symbols( &mut self, crate_name: &str, file_path: &str, source_code: &str, ) -> Result<Vec<SymbolAnchor>, AstError>
Extract symbol anchors from Rust source.
module_path should be a logical module path (e.g. storage::db), not an
absolute filesystem path. Callers may derive it from a relative file path.
Impl methods are recorded as Type::method for stable, location-independent
identity within the module.
Sourcepub fn scan_directory(
&mut self,
crate_name: &str,
dir_path: &Path,
) -> Result<Vec<SymbolAnchor>, AstError>
pub fn scan_directory( &mut self, crate_name: &str, dir_path: &Path, ) -> Result<Vec<SymbolAnchor>, AstError>
Recursively scan a directory for .rs files.
Auto Trait Implementations§
impl Freeze for CodeAstParser
impl RefUnwindSafe for CodeAstParser
impl Send for CodeAstParser
impl Sync for CodeAstParser
impl Unpin for CodeAstParser
impl UnsafeUnpin for CodeAstParser
impl UnwindSafe for CodeAstParser
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