pub struct ConnectorRegistry {
connectors: Vec<Box<dyn Connector>>,
}Expand description
Registry for connectors (built-in and custom).
Use ConnectorRegistry::from_config to create a registry pre-loaded
with all built-in connectors from the config file, then optionally
call register to add custom ones.
§Example
use context_harness::traits::ConnectorRegistry;
let mut connectors = ConnectorRegistry::new();
// connectors.register(Box::new(MyConnector::new()));Fields§
§connectors: Vec<Box<dyn Connector>>Implementations§
Source§impl ConnectorRegistry
impl ConnectorRegistry
Sourcepub fn from_config(config: &Config) -> Self
pub fn from_config(config: &Config) -> Self
Create a registry pre-loaded with all built-in connectors from the config.
This resolves all filesystem, git, S3, and script connector instances from the TOML config and wraps them as trait objects.
Sourcepub fn connectors(&self) -> &[Box<dyn Connector>]
pub fn connectors(&self) -> &[Box<dyn Connector>]
Get all registered connectors.
Sourcepub fn connectors_by_type(&self, connector_type: &str) -> Vec<&dyn Connector>
pub fn connectors_by_type(&self, connector_type: &str) -> Vec<&dyn Connector>
Get connectors filtered by type (e.g. "git", "filesystem").
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectorRegistry
impl !RefUnwindSafe for ConnectorRegistry
impl Send for ConnectorRegistry
impl Sync for ConnectorRegistry
impl Unpin for ConnectorRegistry
impl !UnwindSafe 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
§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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().