pub struct ProviderRegistry { /* private fields */ }Expand description
Registry managing host providers.
Pre-populated with the built-in well-known provider.
Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a registry with the built-in well-known provider.
Sourcepub fn register(&mut self, provider: impl HostProvider + 'static)
pub fn register(&mut self, provider: impl HostProvider + 'static)
Register a new provider.
Sourcepub fn find_match(&self, url: &str) -> Option<(&dyn HostProvider, String)>
pub fn find_match(&self, url: &str) -> Option<(&dyn HostProvider, String)>
Find the first provider matching url.
Returns the provider reference and its source identifier.
Sourcepub fn providers(&self) -> &[Box<dyn HostProvider>]
pub fn providers(&self) -> &[Box<dyn HostProvider>]
Get all registered providers.
Trait Implementations§
Source§impl Debug for ProviderRegistry
impl Debug for ProviderRegistry
Auto Trait Implementations§
impl Freeze for ProviderRegistry
impl !RefUnwindSafe for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl UnsafeUnpin for ProviderRegistry
impl !UnwindSafe for ProviderRegistry
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