pub trait Executor: Send + Sized {
type Driver: Driver;
// Required methods
fn driver(&self) -> &Self::Driver;
fn prepare(
&mut self,
query: String,
) -> impl Future<Output = Result<Query<Self::Driver>>> + Send;
fn run(
&mut self,
query: Query<Self::Driver>,
) -> impl Stream<Item = Result<QueryResult>> + Send;
// Provided methods
fn fetch<'s>(
&'s mut self,
query: Query<Self::Driver>,
) -> impl Stream<Item = Result<RowLabeled>> + Send + 's { ... }
fn execute(
&mut self,
query: Query<Self::Driver>,
) -> impl Future<Output = Result<RowsAffected>> + Send { ... }
fn append<'a, E, It>(
&mut self,
entities: It,
) -> impl Future<Output = Result<RowsAffected>> + Send
where E: Entity + 'a,
It: IntoIterator<Item = &'a E> + Send { ... }
}
Required Associated Types§
Required Methods§
fn driver(&self) -> &Self::Driver
fn prepare( &mut self, query: String, ) -> impl Future<Output = Result<Query<Self::Driver>>> + Send
Provided Methods§
Sourcefn fetch<'s>(
&'s mut self,
query: Query<Self::Driver>,
) -> impl Stream<Item = Result<RowLabeled>> + Send + 's
fn fetch<'s>( &'s mut self, query: Query<Self::Driver>, ) -> impl Stream<Item = Result<RowLabeled>> + Send + 's
Execute the query and returns the rows.
Sourcefn execute(
&mut self,
query: Query<Self::Driver>,
) -> impl Future<Output = Result<RowsAffected>> + Send
fn execute( &mut self, query: Query<Self::Driver>, ) -> impl Future<Output = Result<RowsAffected>> + Send
Execute the query and return the total number of rows affected.
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.