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§
Sourcetype TypeSystem: TypeSystem
type TypeSystem: TypeSystem
The type system of the parent Source.
Sourcetype Parser<'a>: PartitionParser<'a, TypeSystem = Self::TypeSystem, Error = Self::Error>
where
Self: 'a
type Parser<'a>: PartitionParser<'a, TypeSystem = Self::TypeSystem, Error = Self::Error> where Self: 'a
The parser that reads the rows of this partition, borrowing from it.
Required Methods§
Sourcefn result_rows(&mut self) -> Result<(), Self::Error>
fn result_rows(&mut self) -> Result<(), Self::Error>
Count total number of rows in each partition.
The count is stored in the partition and reported by nrows.
It is only called when the destination needs a count and
Source::result_rows returned None.
Sourcefn parser(&mut self) -> Result<Self::Parser<'_>, Self::Error>
fn parser(&mut self) -> Result<Self::Parser<'_>, Self::Error>
Run the partition’s query and return a parser over its result.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".