pub trait DestinationPartition<'a>: Send {
    type TypeSystem: TypeSystem;
    type Error: From<ConnectorXError> + Send;

    // Required methods
    fn ncols(&self) -> usize;
    fn finalize(&mut self) -> Result<(), Self::Error>;
    fn aquire_row(&mut self, n: usize) -> Result<usize, Self::Error>;

    // Provided method
    fn write<T>(
        &mut self,
        value: T
    ) -> Result<(), <Self as DestinationPartition<'a>>::Error>
       where T: TypeAssoc<Self::TypeSystem>,
             Self: Consume<T, Error = <Self as DestinationPartition<'a>>::Error> { ... }
}
Expand description

PartitionDestination writes values to its own region. PartitionDestination is parameterized on lifetime 'a, which is the lifetime of the parent Destination. Usually, a PartitionDestination can never live longer than the parent.

Required Associated Types§

Required Methods§

source

fn ncols(&self) -> usize

Number of rows this PartitionDestination controls.

source

fn finalize(&mut self) -> Result<(), Self::Error>

Final clean ups

source

fn aquire_row(&mut self, n: usize) -> Result<usize, Self::Error>

Aquire n rows in final destination

Provided Methods§

source

fn write<T>( &mut self, value: T ) -> Result<(), <Self as DestinationPartition<'a>>::Error>
where T: TypeAssoc<Self::TypeSystem>, Self: Consume<T, Error = <Self as DestinationPartition<'a>>::Error>,

Write a value of type T to the location (row, col). If T mismatch with the schema, ConnectorXError::TypeCheckFailed will return.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> DestinationPartition<'a> for connectorx::destinations::arrow2::ArrowPartitionWriter

source§

impl<'a> DestinationPartition<'a> for connectorx::destinations::arrow::ArrowPartitionWriter

source§

impl<'a> DestinationPartition<'a> for connectorx::destinations::arrowstream::ArrowPartitionWriter