CopyDestinationFactory

Trait CopyDestinationFactory 

Source
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§

Source

type SequentialDestination: CopyDestination

The implementation type when dealing with single-threaded workloads. The can optionally support multi-threading, but it is not needed.

Source

type ParallelDestination: CopyDestination + Clone + Sync

The implementation type when dealing with multithreaded workloads. This type has to support multi-threading.

Required Methods§

Source

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.

Source

fn create_sequential_destination( &'a mut self, ) -> impl Future<Output = Result<Self::SequentialDestination>> + Send

Should create a destination that works with single threaded writing.

Source

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.

Implementors§

Source§

impl<'a> CopyDestinationFactory<'a> for PostgresInstanceStorage<'a>

Source§

type SequentialDestination = SequentialSafePostgresInstanceCopyDestinationStorage<'a>

Source§

type ParallelDestination = ParallelSafePostgresInstanceCopyDestinationStorage<'a>

Source§

impl<'a, F: AsyncWrite + Unpin + Send + Sync + 'a> CopyDestinationFactory<'a> for SqlFile<F>