Trait connectorx::sources::PartitionParser
source · 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> { ... }
}
Required Associated Types§
type TypeSystem: TypeSystem
type Error: From<ConnectorXError> + Send + Debug
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.
Object Safety§
This trait is not object safe.