pub trait Executor: Send + Sized {
type Driver: Driver;
// Required methods
fn do_prepare(
&mut self,
sql: String,
) -> impl Future<Output = Result<Query<Self::Driver>>> + Send;
fn run<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<QueryResult>> + Send;
// Provided methods
fn accepts_multiple_statements(&self) -> bool { ... }
fn driver(&self) -> Self::Driver
where Self: Sized { ... }
fn prepare<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<Query<Self::Driver>>> + Send { ... }
fn fetch<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<RowLabeled>> + Send { ... }
fn execute<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> 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,
<It as IntoIterator>::IntoIter: Send { ... }
}Expand description
Async query execution.
Implemented by connections.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn accepts_multiple_statements(&self) -> bool
fn accepts_multiple_statements(&self) -> bool
Supports multiple statements per request.
Sourcefn prepare<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<Query<Self::Driver>>> + Send
fn prepare<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<Query<Self::Driver>>> + Send
Prepare query.
Sourcefn fetch<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Stream<Item = Result<RowLabeled>> + Send
fn fetch<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Stream<Item = Result<RowLabeled>> + Send
Execute a query yielding RowLabeled from the resulting stream (filtering out RowsAffected).
Sourcefn execute<'s>(
&'s mut self,
query: impl AsQuery<Self::Driver> + 's,
) -> impl Future<Output = Result<RowsAffected>> + Send
fn execute<'s>( &'s mut self, query: impl AsQuery<Self::Driver> + 's, ) -> impl Future<Output = Result<RowsAffected>> + Send
Execute and aggregate affected rows counter.
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.