pub trait Destination: Sized {
    type TypeSystem: TypeSystem;
    type Partition<'a>: DestinationPartition<'a, TypeSystem = Self::TypeSystem, Error = Self::Error>
       where Self: 'a;
    type Error: From<ConnectorXError> + Send;

    const DATA_ORDERS: &'static [DataOrder];

    // Required methods
    fn needs_count(&self) -> bool;
    fn allocate<S: AsRef<str>>(
        &mut self,
        nrow: usize,
        names: &[S],
        schema: &[Self::TypeSystem],
        data_order: DataOrder
    ) -> Result<(), Self::Error>;
    fn partition(
        &mut self,
        counts: usize
    ) -> Result<Vec<Self::Partition<'_>>, Self::Error>;
    fn schema(&self) -> &[Self::TypeSystem];
}
Expand description

A Destination is associated with a TypeSystem and a PartitionDestination. PartitionDestination allows multiple threads write data into the buffer owned by Destination.

Required Associated Types§

source

type TypeSystem: TypeSystem

source

type Partition<'a>: DestinationPartition<'a, TypeSystem = Self::TypeSystem, Error = Self::Error> where Self: 'a

source

type Error: From<ConnectorXError> + Send

Required Associated Constants§

source

const DATA_ORDERS: &'static [DataOrder]

Required Methods§

source

fn needs_count(&self) -> bool

Specify whether the destination needs total rows in advance in order to pre-allocate the buffer.

source

fn allocate<S: AsRef<str>>( &mut self, nrow: usize, names: &[S], schema: &[Self::TypeSystem], data_order: DataOrder ) -> Result<(), Self::Error>

Construct the Destination. This allocates the memory based on the types of each columns and the number of rows.

source

fn partition( &mut self, counts: usize ) -> Result<Vec<Self::Partition<'_>>, Self::Error>

Create a bunch of partition destinations, with each write count number of rows.

source

fn schema(&self) -> &[Self::TypeSystem]

Return the schema of the destination.

Object Safety§

This trait is not object safe.

Implementors§