pub struct ParserRegistry { /* private fields */ }Expand description
Registry that maps Language variants to their LanguageParser implementations.
Constructed with all built-in parsers pre-registered. Use ParserRegistry::parse
for a single file or ParserRegistry::parse_all for parallel batch processing.
Implementations§
Source§impl ParserRegistry
impl ParserRegistry
Sourcepub fn parse(&self, file: &SourceFile) -> Result<ParseResult>
pub fn parse(&self, file: &SourceFile) -> Result<ParseResult>
Parse a single file, returning an empty result for unknown languages.
Sourcepub fn parse_all(&self, files: &[SourceFile]) -> Vec<ParseResult>
pub fn parse_all(&self, files: &[SourceFile]) -> Vec<ParseResult>
Parse all files in parallel using Rayon, logging warnings on individual failures.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParserRegistry
impl !RefUnwindSafe for ParserRegistry
impl Send for ParserRegistry
impl Sync for ParserRegistry
impl Unpin for ParserRegistry
impl UnsafeUnpin for ParserRegistry
impl !UnwindSafe for ParserRegistry
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> 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