pub struct ParserRegistry { /* private fields */ }Expand description
Registry of language parsers with extension-based dispatch.
Implementations§
Source§impl ParserRegistry
impl ParserRegistry
Sourcepub fn parser_for_file(&self, path: &Path) -> Option<&dyn LanguageParser>
pub fn parser_for_file(&self, path: &Path) -> Option<&dyn LanguageParser>
Get the parser for a file based on its extension.
Sourcepub fn parser_for_language(&self, lang: Language) -> Option<&dyn LanguageParser>
pub fn parser_for_language(&self, lang: Language) -> Option<&dyn LanguageParser>
Get the parser for a specific Language enum value.
Sourcepub fn supported_extensions(&self) -> Vec<&str>
pub fn supported_extensions(&self) -> Vec<&str>
List all supported file extensions.
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