pub struct ConnectorRegistry { /* private fields */ }Expand description
The connectors an application was built with.
Populated by the composition root and then read-only — there is no runtime registration, so the set of external services a build can reach is fixed at compile time and auditable.
Implementations§
Source§impl ConnectorRegistry
impl ConnectorRegistry
pub fn new() -> Self
pub fn insert(&mut self, connector: Arc<dyn Connector>)
pub fn get(&self, id: &ConnectorId) -> Option<Arc<dyn Connector>>
Sourcepub fn require(&self, id: &ConnectorId) -> Result<Arc<dyn Connector>>
pub fn require(&self, id: &ConnectorId) -> Result<Arc<dyn Connector>>
Resolve a connector or fail with a configuration error naming it.
pub fn ids(&self) -> Vec<ConnectorId>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn Connector>>
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for ConnectorRegistry
impl Clone for ConnectorRegistry
Source§fn clone(&self) -> ConnectorRegistry
fn clone(&self) -> ConnectorRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConnectorRegistry
impl Debug for ConnectorRegistry
Source§impl Default for ConnectorRegistry
impl Default for ConnectorRegistry
Source§fn default() -> ConnectorRegistry
fn default() -> ConnectorRegistry
Returns the “default value” for a type. Read more
Source§impl FromIterator<Arc<dyn Connector>> for ConnectorRegistry
Constructed from the composition root.
impl FromIterator<Arc<dyn Connector>> for ConnectorRegistry
Constructed from the composition root.
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectorRegistry
impl !UnwindSafe for ConnectorRegistry
impl Freeze for ConnectorRegistry
impl Send for ConnectorRegistry
impl Sync for ConnectorRegistry
impl Unpin for ConnectorRegistry
impl UnsafeUnpin for ConnectorRegistry
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