pub trait CopyDestinationFactory<'a>: BaseCopyTarget {
type SequentialDestination: CopyDestination;
type ParallelDestination: CopyDestination + Clone + Sync;
// Required methods
fn create_destination(
&'a mut self,
) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialDestination, Self::ParallelDestination>>> + Send;
fn create_sequential_destination(
&'a mut self,
) -> impl Future<Output = Result<Self::SequentialDestination>> + Send;
fn supported_parallelism(&self) -> SupportedParallelism;
}Expand description
A factory for providing copy destinations. This is used to create a destination that can be used to write data to.
Required Associated Types§
Sourcetype SequentialDestination: CopyDestination
type SequentialDestination: CopyDestination
The implementation type when dealing with single-threaded workloads. The can optionally support multi-threading, but it is not needed.
Sourcetype ParallelDestination: CopyDestination + Clone + Sync
type ParallelDestination: CopyDestination + Clone + Sync
The implementation type when dealing with multithreaded workloads. This type has to support multi-threading.
Required Methods§
Sourcefn create_destination(
&'a mut self,
) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialDestination, Self::ParallelDestination>>> + Send
fn create_destination( &'a mut self, ) -> impl Future<Output = Result<SequentialOrParallel<Self::SequentialDestination, Self::ParallelDestination>>> + Send
Should create whatever type is needed to be able to write data to the destination.
Sourcefn create_sequential_destination(
&'a mut self,
) -> impl Future<Output = Result<Self::SequentialDestination>> + Send
fn create_sequential_destination( &'a mut self, ) -> impl Future<Output = Result<Self::SequentialDestination>> + Send
Should create a destination that works with single threaded writing.
Sourcefn supported_parallelism(&self) -> SupportedParallelism
fn supported_parallelism(&self) -> SupportedParallelism
Should return what kind of parallelism is supported by the destination. This is used for negotiation with the source.
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.