pub struct ExtensionRegistry { /* private fields */ }Expand description
Registry for managing discovered extensions
Implementations§
Source§impl ExtensionRegistry
impl ExtensionRegistry
Sourcepub fn load_from_discovery(&mut self, result: DiscoveryResult)
pub fn load_from_discovery(&mut self, result: DiscoveryResult)
Load extensions from a discovery result
Sourcepub fn discover_and_load(
&mut self,
root: &Path,
options: DiscoveryOptions,
) -> Result<&mut Self, ExtensionError>
pub fn discover_and_load( &mut self, root: &Path, options: DiscoveryOptions, ) -> Result<&mut Self, ExtensionError>
Discover and load extensions from a directory
Sourcepub fn get(&self, id: &str) -> Option<&DiscoveredExtension>
pub fn get(&self, id: &str) -> Option<&DiscoveredExtension>
Get an extension by ID
Sourcepub fn get_or_error(
&self,
id: &str,
) -> Result<&DiscoveredExtension, ExtensionError>
pub fn get_or_error( &self, id: &str, ) -> Result<&DiscoveredExtension, ExtensionError>
Get an extension by ID (returns error if not found)
Sourcepub fn list(&self) -> Vec<&DiscoveredExtension>
pub fn list(&self) -> Vec<&DiscoveredExtension>
List all extensions
Sourcepub fn remove(&mut self, id: &str) -> Option<DiscoveredExtension>
pub fn remove(&mut self, id: &str) -> Option<DiscoveredExtension>
Remove an extension by ID
Sourcepub fn filter<F>(&self, predicate: F) -> Vec<&DiscoveredExtension>
pub fn filter<F>(&self, predicate: F) -> Vec<&DiscoveredExtension>
Filter extensions by predicate
Sourcepub fn legacy_extensions(&self) -> Vec<&DiscoveredExtension>
pub fn legacy_extensions(&self) -> Vec<&DiscoveredExtension>
Get all legacy extensions
Sourcepub fn modern_extensions(&self) -> Vec<&DiscoveredExtension>
pub fn modern_extensions(&self) -> Vec<&DiscoveredExtension>
Get all non-legacy extensions
Trait Implementations§
Source§impl Debug for ExtensionRegistry
impl Debug for ExtensionRegistry
Source§impl Default for ExtensionRegistry
impl Default for ExtensionRegistry
Source§fn default() -> ExtensionRegistry
fn default() -> ExtensionRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExtensionRegistry
impl RefUnwindSafe for ExtensionRegistry
impl Send for ExtensionRegistry
impl Sync for ExtensionRegistry
impl Unpin for ExtensionRegistry
impl UnwindSafe for ExtensionRegistry
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