pub struct Registry { /* private fields */ }Expand description
Registry that stores components by their URI scheme.
Also harvests and indexes ComponentMetadata for each registered
component, so the metadata can be queried through a
ComponentMetadataCatalog
without re-invoking the component.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn register(&mut self, component: Arc<dyn Component>)
pub fn register(&mut self, component: Arc<dyn Component>)
Register a component. Replaces any existing component with the same scheme.
Harvests the component’s ComponentMetadata and indexes it by scheme
in parallel with the component insertion. Validates that the metadata’s
scheme matches the component’s scheme, normalizing on mismatch with a
warning log.
Sourcepub fn get_or_err(&self, scheme: &str) -> Result<Arc<dyn Component>, CamelError>
pub fn get_or_err(&self, scheme: &str) -> Result<Arc<dyn Component>, CamelError>
Look up a component by scheme, returning an error if not found.
Sourcepub fn get_metadata(&self, scheme: &str) -> Option<ComponentMetadata>
pub fn get_metadata(&self, scheme: &str) -> Option<ComponentMetadata>
Look up harvested metadata for a component by scheme.
Sourcepub fn all_metadata(&self) -> Vec<ComponentMetadata>
pub fn all_metadata(&self) -> Vec<ComponentMetadata>
Return metadata for every registered component.
Sourcepub fn metadata_schemes(&self) -> Vec<String>
pub fn metadata_schemes(&self) -> Vec<String>
Return the schemes of every registered component’s metadata.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Freeze for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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