pub struct FileParser { /* private fields */ }Expand description
Core parsing engine. Handles language detection, parse tree caching, and query pattern execution via tree-sitter.
Implementations§
Source§impl FileParser
impl FileParser
Sourcepub fn parse(&mut self, path: &Path) -> Result<(&Tree, LangId), AftError>
pub fn parse(&mut self, path: &Path) -> Result<(&Tree, LangId), AftError>
Parse a file, returning the tree and detected language. Uses cache if the file hasn’t been modified since last parse.
Sourcepub fn parse_cloned(&mut self, path: &Path) -> Result<(Tree, LangId), AftError>
pub fn parse_cloned(&mut self, path: &Path) -> Result<(Tree, LangId), AftError>
Like FileParser::parse but returns an owned Tree clone.
Useful when the caller needs to hold the tree while also calling other mutable methods on this parser.
Auto Trait Implementations§
impl Freeze for FileParser
impl RefUnwindSafe for FileParser
impl Send for FileParser
impl Sync for FileParser
impl Unpin for FileParser
impl UnsafeUnpin for FileParser
impl UnwindSafe for FileParser
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> 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