pub struct LanguageRegistry { /* private fields */ }Implementations§
Source§impl LanguageRegistry
impl LanguageRegistry
pub fn new() -> Self
pub fn register(&mut self, name: String, extractor: Box<dyn LanguageExtractor>)
pub fn get(&self, lang_name: &str) -> Option<&dyn LanguageExtractor>
pub fn extractor_for_extension( &self, ext: &str, ) -> Option<&dyn LanguageExtractor>
pub fn complexity_for_source( &self, lang: Lang, source: &[u8], ) -> Result<ComplexityMetrics>
pub fn registered_languages(&self) -> Vec<&str>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LanguageRegistry
impl !UnwindSafe for LanguageRegistry
impl Freeze for LanguageRegistry
impl Send for LanguageRegistry
impl Sync for LanguageRegistry
impl Unpin for LanguageRegistry
impl UnsafeUnpin for LanguageRegistry
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