connectorx::typesystem

Trait Transport

Source
pub trait Transport {
    type TSS: TypeSystem;
    type TSD: TypeSystem;
    type S: Source;
    type D: Destination;
    type Error: From<ConnectorXError> + From<<Self::S as Source>::Error> + From<<Self::D as Destination>::Error> + Send + Debug;

    // Required methods
    fn convert_typesystem(ts: Self::TSS) -> CXResult<Self::TSD>;
    fn process<'s, 'd, 'r>(
        ts1: Self::TSS,
        ts2: Self::TSD,
        src: &'r mut <<Self::S as Source>::Partition as SourcePartition>::Parser<'s>,
        dst: &'r mut <Self::D as Destination>::Partition<'d>,
    ) -> Result<(), Self::Error>
       where Self: 'd;
    fn processor<'s, 'd>(
        ts1: Self::TSS,
        ts2: Self::TSD,
    ) -> CXResult<fn(src: &mut <<Self::S as Source>::Partition as SourcePartition>::Parser<'s>, dst: &mut <Self::D as Destination>::Partition<'d>) -> Result<(), Self::Error>>
       where Self: 'd;

    // Provided method
    fn convert_type<T1, T2>(val: T1) -> T2
       where Self: TypeConversion<T1, T2> { ... }
}
Expand description

Transport asks the source to produce a value, do type conversion and then write the value to a destination. Do not manually implement this trait for types. Use [impl_transport!] to create a struct that implements this trait instead.

Required Associated Types§

Source

type TSS: TypeSystem

Source

type TSD: TypeSystem

Source

type S: Source

Source

type D: Destination

Source

type Error: From<ConnectorXError> + From<<Self::S as Source>::Error> + From<<Self::D as Destination>::Error> + Send + Debug

Required Methods§

Source

fn convert_typesystem(ts: Self::TSS) -> CXResult<Self::TSD>

convert_typesystem convert the source type system TSS to the destination type system TSD.

Source

fn process<'s, 'd, 'r>( ts1: Self::TSS, ts2: Self::TSD, src: &'r mut <<Self::S as Source>::Partition as SourcePartition>::Parser<'s>, dst: &'r mut <Self::D as Destination>::Partition<'d>, ) -> Result<(), Self::Error>
where Self: 'd,

process will ask source to produce a value with type T1, based on TSS, and then do type conversion using convert_type to get value with type T2, which is associated to TSD. Finally, it will write the value with type T2 to the destination.

Source

fn processor<'s, 'd>( ts1: Self::TSS, ts2: Self::TSD, ) -> CXResult<fn(src: &mut <<Self::S as Source>::Partition as SourcePartition>::Parser<'s>, dst: &mut <Self::D as Destination>::Partition<'d>) -> Result<(), Self::Error>>
where Self: 'd,

Provided Methods§

Source

fn convert_type<T1, T2>(val: T1) -> T2
where Self: TypeConversion<T1, T2>,

convert_type convert the type T1 associated with the source type system TSS to a type T2 which is associated with the destination type system TSD.

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<'tp> Transport for BigQueryArrow2Transport

Source§

impl<'tp> Transport for connectorx::transports::BigQueryArrowStreamTransport

Source§

impl<'tp> Transport for connectorx::transports::BigQueryArrowTransport

Source§

impl<'tp> Transport for CSVArrowTransport

Source§

impl<'tp> Transport for DummyArrow2Transport

Source§

impl<'tp> Transport for DummyArrowTransport

Source§

impl<'tp> Transport for MsSQLArrow2Transport

Source§

impl<'tp> Transport for connectorx::transports::MsSQLArrowStreamTransport

Source§

impl<'tp> Transport for connectorx::transports::MsSQLArrowTransport

Source§

impl<'tp> Transport for MySQLArrow2Transport<BinaryProtocol>

Source§

impl<'tp> Transport for MySQLArrow2Transport<TextProtocol>

Source§

impl<'tp> Transport for connectorx::transports::MySQLArrowStreamTransport<BinaryProtocol>

Source§

impl<'tp> Transport for connectorx::transports::MySQLArrowStreamTransport<TextProtocol>

Source§

impl<'tp> Transport for connectorx::transports::MySQLArrowTransport<BinaryProtocol>

Source§

impl<'tp> Transport for connectorx::transports::MySQLArrowTransport<TextProtocol>

Source§

impl<'tp> Transport for OracleArrow2Transport

Source§

impl<'tp> Transport for connectorx::transports::OracleArrowStreamTransport

Source§

impl<'tp> Transport for connectorx::transports::OracleArrowTransport

Source§

impl<'tp> Transport for PostgresArrow2Transport<BinaryProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for PostgresArrow2Transport<BinaryProtocol, NoTls>

Source§

impl<'tp> Transport for PostgresArrow2Transport<CSVProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for PostgresArrow2Transport<CSVProtocol, NoTls>

Source§

impl<'tp> Transport for PostgresArrow2Transport<CursorProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for PostgresArrow2Transport<CursorProtocol, NoTls>

Source§

impl<'tp> Transport for PostgresArrow2Transport<SimpleProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for PostgresArrow2Transport<SimpleProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<BinaryProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<BinaryProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<CSVProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<CSVProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<CursorProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<CursorProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<SimpleProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowStreamTransport<SimpleProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<BinaryProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<BinaryProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<CSVProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<CSVProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<CursorProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<CursorProtocol, NoTls>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<SimpleProtocol, MakeTlsConnector>

Source§

impl<'tp> Transport for connectorx::transports::PostgresArrowTransport<SimpleProtocol, NoTls>

Source§

impl<'tp> Transport for SQLiteArrow2Transport

Source§

impl<'tp> Transport for connectorx::transports::SQLiteArrowStreamTransport

Source§

impl<'tp> Transport for connectorx::transports::SQLiteArrowTransport

Source§

impl<'tp> Transport for TrinoArrow2Transport

Source§

impl<'tp> Transport for connectorx::transports::TrinoArrowStreamTransport

Source§

impl<'tp> Transport for connectorx::transports::TrinoArrowTransport