pub trait PartitionParser<'a>: Send {
type TypeSystem: TypeSystem;
type Error: From<ConnectorXError> + Send + Debug;
// Required method
fn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>;
// Provided method
fn parse<'r, T>(
&'r mut self,
) -> Result<T, <Self as PartitionParser<'a>>::Error>
where T: TypeAssoc<Self::TypeSystem>,
Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error> { ... }
}Expand description
A PartitionParser reads the values of one partition’s result, one cell at a time.
The dispatcher calls fetch_next to buffer a batch of rows,
then parse once per cell in the negotiated
DataOrder. Each cell’s type comes from the source schema.
Required Associated Types§
Sourcetype TypeSystem: TypeSystem
type TypeSystem: TypeSystem
The type system of the parent Source.
Required Methods§
Sourcefn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>
fn fetch_next(&mut self) -> Result<(usize, bool), Self::Error>
Fetch next batch of rows from database, return (number of rows fetched to local, whether all rows are fechted from database). There might be rows that are not consumed yet when calling the next fetch_next. The function might be called even after the last batch is fetched.
Provided Methods§
Sourcefn parse<'r, T>(&'r mut self) -> Result<T, <Self as PartitionParser<'a>>::Error>where
T: TypeAssoc<Self::TypeSystem>,
Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error>,
fn parse<'r, T>(&'r mut self) -> Result<T, <Self as PartitionParser<'a>>::Error>where
T: TypeAssoc<Self::TypeSystem>,
Self: Produce<'r, T, Error = <Self as PartitionParser<'a>>::Error>,
Read a value T by calling Produce<T>::produce. Usually this function does not need to be
implemented.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".