pub struct ConnectorRegistry { /* private fields */ }Expand description
Re-export the connector registry for custom connector registration. Registry of available connector implementations.
Connectors register themselves with a factory function that creates
new instances. The runtime uses the registry to instantiate connectors
based on the connector property in the configuration.
§Example
use laminar_connectors::registry::ConnectorRegistry;
let mut registry = ConnectorRegistry::new();
registry.register_source("kafka", info, Arc::new(|| Box::new(KafkaSource::new())));
let connector = registry.create_source("kafka", &config)?;Implementations§
Source§impl ConnectorRegistry
impl ConnectorRegistry
Sourcepub fn new() -> ConnectorRegistry
pub fn new() -> ConnectorRegistry
Creates a new empty registry.
Sourcepub fn register_source(
&self,
name: impl Into<String>,
info: ConnectorInfo,
factory: Arc<dyn Fn() -> Box<dyn SourceConnector> + Sync + Send>,
)
pub fn register_source( &self, name: impl Into<String>, info: ConnectorInfo, factory: Arc<dyn Fn() -> Box<dyn SourceConnector> + Sync + Send>, )
Registers a source connector factory.
Sourcepub fn register_sink(
&self,
name: impl Into<String>,
info: ConnectorInfo,
factory: Arc<dyn Fn() -> Box<dyn SinkConnector> + Sync + Send>,
)
pub fn register_sink( &self, name: impl Into<String>, info: ConnectorInfo, factory: Arc<dyn Fn() -> Box<dyn SinkConnector> + Sync + Send>, )
Registers a sink connector factory.
Sourcepub fn create_source(
&self,
config: &ConnectorConfig,
) -> Result<Box<dyn SourceConnector>, ConnectorError>
pub fn create_source( &self, config: &ConnectorConfig, ) -> Result<Box<dyn SourceConnector>, ConnectorError>
Creates a new source connector instance.
The connector type is determined by config.connector_type().
§Errors
Returns ConnectorError::ConfigurationError if the connector type
is not registered.
The factory creates a default-configured connector. The caller must
subsequently call open(config) to forward WITH clause properties.
Sourcepub fn create_sink(
&self,
config: &ConnectorConfig,
) -> Result<Box<dyn SinkConnector>, ConnectorError>
pub fn create_sink( &self, config: &ConnectorConfig, ) -> Result<Box<dyn SinkConnector>, ConnectorError>
Creates a new sink connector instance.
The connector type is determined by config.connector_type().
§Errors
Returns ConnectorError::ConfigurationError if the connector type
is not registered.
Sourcepub fn register_table_source(
&self,
name: impl Into<String>,
info: ConnectorInfo,
factory: Arc<dyn Fn(&ConnectorConfig) -> Result<Box<dyn ReferenceTableSource>, ConnectorError> + Sync + Send>,
)
pub fn register_table_source( &self, name: impl Into<String>, info: ConnectorInfo, factory: Arc<dyn Fn(&ConnectorConfig) -> Result<Box<dyn ReferenceTableSource>, ConnectorError> + Sync + Send>, )
Registers a reference table source factory.
Sourcepub fn create_table_source(
&self,
config: &ConnectorConfig,
) -> Result<Box<dyn ReferenceTableSource>, ConnectorError>
pub fn create_table_source( &self, config: &ConnectorConfig, ) -> Result<Box<dyn ReferenceTableSource>, ConnectorError>
Creates a new reference table source instance.
The connector type is determined by config.connector_type().
§Errors
Returns ConnectorError::ConfigurationError if the connector type
is not registered as a table source.
Sourcepub fn list_table_sources(&self) -> Vec<String>
pub fn list_table_sources(&self) -> Vec<String>
Lists all registered table source connector names.
Sourcepub fn source_info(&self, name: &str) -> Option<ConnectorInfo>
pub fn source_info(&self, name: &str) -> Option<ConnectorInfo>
Returns information about a registered source connector.
Sourcepub fn sink_info(&self, name: &str) -> Option<ConnectorInfo>
pub fn sink_info(&self, name: &str) -> Option<ConnectorInfo>
Returns information about a registered sink connector.
Sourcepub fn list_sources(&self) -> Vec<String>
pub fn list_sources(&self) -> Vec<String>
Lists all registered source connector names.
Sourcepub fn list_sinks(&self) -> Vec<String>
pub fn list_sinks(&self) -> Vec<String>
Lists all registered sink connector names.
Sourcepub fn create_deserializer(
&self,
format: &str,
) -> Result<Box<dyn RecordDeserializer>, ConnectorError>
pub fn create_deserializer( &self, format: &str, ) -> Result<Box<dyn RecordDeserializer>, ConnectorError>
Creates a deserializer for the given format string.
§Errors
Returns ConnectorError::Serde if the format is not supported.
Sourcepub fn create_serializer(
&self,
format: &str,
) -> Result<Box<dyn RecordSerializer>, ConnectorError>
pub fn create_serializer( &self, format: &str, ) -> Result<Box<dyn RecordSerializer>, ConnectorError>
Creates a serializer for the given format string.
§Errors
Returns ConnectorError::Serde if the format is not supported.
Trait Implementations§
Source§impl Clone for ConnectorRegistry
impl Clone for ConnectorRegistry
Source§fn clone(&self) -> ConnectorRegistry
fn clone(&self) -> ConnectorRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Auto Trait Implementations§
impl Freeze for ConnectorRegistry
impl !RefUnwindSafe for ConnectorRegistry
impl Send for ConnectorRegistry
impl Sync for ConnectorRegistry
impl Unpin for ConnectorRegistry
impl UnsafeUnpin for ConnectorRegistry
impl !UnwindSafe for ConnectorRegistry
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.