pub enum Executor<'a, DB>where
DB: Database,{
Pool(&'a Pool<DB>),
Conn(&'a mut <DB as Database>::Connection),
}Variants§
Pool(&'a Pool<DB>)
Conn(&'a mut <DB as Database>::Connection)
Implementations§
Source§impl<'a, DB> Executor<'a, DB>where
DB: Database,
impl<'a, DB> Executor<'a, DB>where
DB: Database,
pub async fn execute<'q, A>(
&mut self,
query: Query<'q, DB, A>,
) -> Result<<DB as Database>::QueryResult, Error>where
A: IntoArguments<'q, DB> + 'q,
DB: SqlDialect,
&'c mut <DB as Database>::Connection: for<'c> Executor<'c, Database = DB>,
pub async fn fetch_all<'q, T, A>(
&mut self,
query: QueryAs<'q, DB, T, A>,
) -> Result<Vec<T>, Error>where
T: for<'r> FromRow<'r, <DB as Database>::Row> + Send + Unpin,
A: IntoArguments<'q, DB> + 'q,
DB: SqlDialect,
&'c mut <DB as Database>::Connection: for<'c> Executor<'c, Database = DB>,
pub async fn fetch_optional<'q, T, A>(
&mut self,
query: QueryAs<'q, DB, T, A>,
) -> Result<Option<T>, Error>where
T: for<'r> FromRow<'r, <DB as Database>::Row> + Send + Unpin,
A: IntoArguments<'q, DB> + 'q,
DB: SqlDialect,
&'c mut <DB as Database>::Connection: for<'c> Executor<'c, Database = DB>,
Trait Implementations§
Source§impl<'a, DB> From<&'a mut <DB as Database>::Connection> for Executor<'a, DB>where
DB: Database,
impl<'a, DB> From<&'a mut <DB as Database>::Connection> for Executor<'a, DB>where
DB: Database,
Source§impl<'a, DB> IntoExecutor<'a> for Executor<'a, DB>where
DB: SqlDialect,
impl<'a, DB> IntoExecutor<'a> for Executor<'a, DB>where
DB: SqlDialect,
impl<'a, DB> Send for Executor<'a, DB>
impl<'a, DB> Sync for Executor<'a, DB>
Auto Trait Implementations§
impl<'a, DB> Freeze for Executor<'a, DB>
impl<'a, DB> !RefUnwindSafe for Executor<'a, DB>
impl<'a, DB> Unpin for Executor<'a, DB>
impl<'a, DB> !UnwindSafe for Executor<'a, DB>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more