Trait connectorx::sources::SourcePartition

source ·
pub trait SourcePartition {
    type TypeSystem: TypeSystem;
    type Parser<'a>: PartitionParser<'a, TypeSystem = Self::TypeSystem, Error = Self::Error>
       where Self: 'a;
    type Error: From<ConnectorXError> + Send + Debug;

    // Required methods
    fn result_rows(&mut self) -> Result<(), Self::Error>;
    fn parser(&mut self) -> Result<Self::Parser<'_>, Self::Error>;
    fn nrows(&self) -> usize;
    fn ncols(&self) -> usize;
}
Expand description

In general, a DataSource abstracts the data source as a stream, which can produce a sequence of values of variate types by repetitively calling the function produce.

Required Associated Types§

source

type TypeSystem: TypeSystem

source

type Parser<'a>: PartitionParser<'a, TypeSystem = Self::TypeSystem, Error = Self::Error> where Self: 'a

source

type Error: From<ConnectorXError> + Send + Debug

Required Methods§

source

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

Count total number of rows in each partition.

source

fn parser(&mut self) -> Result<Self::Parser<'_>, Self::Error>

source

fn nrows(&self) -> usize

Number of rows this DataSource got. Sometimes it is not possible for the source to know how many rows it gets before reading the whole data.

source

fn ncols(&self) -> usize

Number of cols this DataSource got.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SourcePartition for BigQuerySourcePartition

source§

impl SourcePartition for CSVSourcePartition

source§

impl SourcePartition for DummySourcePartition

source§

impl SourcePartition for MsSQLSourcePartition

source§

impl SourcePartition for MySQLSourcePartition<BinaryProtocol>

source§

impl SourcePartition for MySQLSourcePartition<TextProtocol>

source§

impl SourcePartition for OracleSourcePartition

source§

impl SourcePartition for SQLiteSourcePartition

source§

impl SourcePartition for TrinoSourcePartition

source§

impl<C> SourcePartition for PostgresSourcePartition<BinaryProtocol, C>
where C: MakeTlsConnect<Socket> + Clone + 'static + Sync + Send, C::TlsConnect: Send, C::Stream: Send, <C::TlsConnect as TlsConnect<Socket>>::Future: Send,

source§

impl<C> SourcePartition for PostgresSourcePartition<CSVProtocol, C>
where C: MakeTlsConnect<Socket> + Clone + 'static + Sync + Send, C::TlsConnect: Send, C::Stream: Send, <C::TlsConnect as TlsConnect<Socket>>::Future: Send,

source§

impl<C> SourcePartition for PostgresSourcePartition<CursorProtocol, C>
where C: MakeTlsConnect<Socket> + Clone + 'static + Sync + Send, C::TlsConnect: Send, C::Stream: Send, <C::TlsConnect as TlsConnect<Socket>>::Future: Send,

source§

impl<C> SourcePartition for PostgresSourcePartition<SimpleProtocol, C>
where C: MakeTlsConnect<Socket> + Clone + 'static + Sync + Send, C::TlsConnect: Send, C::Stream: Send, <C::TlsConnect as TlsConnect<Socket>>::Future: Send,