pub struct AdapterRegistry { /* private fields */ }Expand description
Global registry for language adapters.
Implementations§
Source§impl AdapterRegistry
impl AdapterRegistry
Sourcepub fn register<F>(&self, language: &str, factory: F)
pub fn register<F>(&self, language: &str, factory: F)
Registers an adapter factory for a language.
§Arguments
language- The language identifier (e.g., “js”, “rust”)factory- A function that creates an instance of the adapter
Sourcepub fn get(&self, language: &str) -> Option<Box<dyn LanguageAdapter>>
pub fn get(&self, language: &str) -> Option<Box<dyn LanguageAdapter>>
Gets an adapter for a language.
Returns None if no adapter is registered for the language.
Sourcepub fn get_for_language(
&self,
language: &Language,
) -> Option<Box<dyn LanguageAdapter>>
pub fn get_for_language( &self, language: &Language, ) -> Option<Box<dyn LanguageAdapter>>
Gets an adapter for a Language enum.
Sourcepub fn registered_languages(&self) -> Vec<String>
pub fn registered_languages(&self) -> Vec<String>
Lists all registered languages.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AdapterRegistry
impl RefUnwindSafe for AdapterRegistry
impl Send for AdapterRegistry
impl Sync for AdapterRegistry
impl Unpin for AdapterRegistry
impl UnwindSafe for AdapterRegistry
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