pub struct PluginRegistry { /* private fields */ }Expand description
Plugin registry for dynamic language detection
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register(&mut self, plugin: Box<dyn LanguagePlugin>)
pub fn register(&mut self, plugin: Box<dyn LanguagePlugin>)
Register an additional language plugin. Detection order is
registration order; built-ins come first in Self::new.
Sourcepub fn detect(&self, path: &Path) -> Option<&dyn LanguagePlugin>
pub fn detect(&self, path: &Path) -> Option<&dyn LanguagePlugin>
Detect which plugin should handle the given path (first match)
Sourcepub fn detect_all(&self, path: &Path) -> Vec<&dyn LanguagePlugin>
pub fn detect_all(&self, path: &Path) -> Vec<&dyn LanguagePlugin>
PSP-5: Detect ALL plugins that match the given path (polyglot support)
Returns all matching plugins instead of just the first, enabling multi-language verification in polyglot repositories.
Sourcepub fn get(&self, name: &str) -> Option<&dyn LanguagePlugin>
pub fn get(&self, name: &str) -> Option<&dyn LanguagePlugin>
Get a plugin by name
Sourcepub fn all(&self) -> &[Box<dyn LanguagePlugin>]
pub fn all(&self) -> &[Box<dyn LanguagePlugin>]
Get all registered plugins
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginRegistry
impl !RefUnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
impl !UnwindSafe for PluginRegistry
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.