pub trait CopySourceFactory: BaseCopyTarget {
type SequentialSource: CopySource;
type ParallelSource: CopySource + Clone + Sync;
// Required methods
fn create_source(
&self,
) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialSource, Self::ParallelSource>>> + Send;
fn create_sequential_source(
&self,
) -> impl Future<Output = Result<Self::SequentialSource>> + Send;
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 + Sync
type ParallelSource: CopySource + Clone + Sync
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 create_source(
&self,
) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialSource, Self::ParallelSource>>> + Send
fn create_source( &self, ) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialSource, Self::ParallelSource>>> + Send
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>> + Send
fn create_sequential_source( &self, ) -> impl Future<Output = Result<Self::SequentialSource>> + Send
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", so this trait is not object safe.