Trait connectorx::sources::Source
source · pub trait Source {
type TypeSystem: TypeSystem;
type Partition: SourcePartition<TypeSystem = Self::TypeSystem, Error = Self::Error> + Send;
type Error: From<ConnectorXError> + Send + Debug;
const DATA_ORDERS: &'static [DataOrder];
// Required methods
fn set_data_order(
&mut self,
data_order: DataOrder,
) -> Result<(), Self::Error>;
fn set_queries<Q: ToString>(&mut self, queries: &[CXQuery<Q>]);
fn set_origin_query(&mut self, query: Option<String>);
fn fetch_metadata(&mut self) -> Result<(), Self::Error>;
fn result_rows(&mut self) -> Result<Option<usize>, Self::Error>;
fn names(&self) -> Vec<String>;
fn schema(&self) -> Vec<Self::TypeSystem>;
fn partition(self) -> Result<Vec<Self::Partition>, Self::Error>;
}
Required Associated Types§
sourcetype TypeSystem: TypeSystem
type TypeSystem: TypeSystem
The type system this Source
associated with.
type Partition: SourcePartition<TypeSystem = Self::TypeSystem, Error = Self::Error> + Send
type Error: From<ConnectorXError> + Send + Debug
Required Associated Constants§
sourceconst DATA_ORDERS: &'static [DataOrder]
const DATA_ORDERS: &'static [DataOrder]
Supported data orders, ordering by preference.
Required Methods§
fn set_data_order(&mut self, data_order: DataOrder) -> Result<(), Self::Error>
fn set_queries<Q: ToString>(&mut self, queries: &[CXQuery<Q>])
fn set_origin_query(&mut self, query: Option<String>)
fn fetch_metadata(&mut self) -> Result<(), Self::Error>
sourcefn result_rows(&mut self) -> Result<Option<usize>, Self::Error>
fn result_rows(&mut self) -> Result<Option<usize>, Self::Error>
Get total number of rows if available
fn names(&self) -> Vec<String>
fn schema(&self) -> Vec<Self::TypeSystem>
fn partition(self) -> Result<Vec<Self::Partition>, Self::Error>
Object Safety§
This trait is not object safe.