pub trait CopySourceFactory: BaseCopyTarget {
type SequentialSource: CopySource;
type ParallelSource: CopySource + Clone;
// Required methods
fn get_introspection(
&self,
) -> impl Future<Output = Result<PostgresDatabase>>;
fn create_source(
&self,
) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialSource, Self::ParallelSource>>>;
fn create_sequential_source(
&self,
) -> impl Future<Output = Result<Self::SequentialSource>>;
fn supported_parallelism(&self) -> SupportedParallelism;
}Expand description
A factory for providing copy sources. This is used to create a source that can be used to read data from.
Required Associated Types§
Sourcetype SequentialSource: CopySource
type SequentialSource: CopySource
A type that can be used to read data from the source. This type has to support single threaded reading, but can support multiple threads reading at the same time.
Sourcetype ParallelSource: CopySource + Clone
type ParallelSource: CopySource + Clone
A type that can be used to read data from the source. This type has to support multiple threads reading at the same time.
Required Methods§
Sourcefn get_introspection(&self) -> impl Future<Output = Result<PostgresDatabase>>
fn get_introspection(&self) -> impl Future<Output = Result<PostgresDatabase>>
Should provide introspection data of the source. This means poking the pg_catalog tables when
working with Postgres, for example.
Sourcefn create_source(
&self,
) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialSource, Self::ParallelSource>>>
fn create_source( &self, ) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialSource, Self::ParallelSource>>>
Should create whatever type is needed to be able to read data from the source.
Sourcefn create_sequential_source(
&self,
) -> impl Future<Output = Result<Self::SequentialSource>>
fn create_sequential_source( &self, ) -> impl Future<Output = Result<Self::SequentialSource>>
Should create a datasource that works with single threaded reading.
Sourcefn supported_parallelism(&self) -> SupportedParallelism
fn supported_parallelism(&self) -> SupportedParallelism
Should return what kind of parallelism is supported by the source. This is used for negotiation with the destination.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".