pub enum RecyclingMethod<C> {
Fast,
Verified,
CustomQuery(Cow<'static, str>),
CustomFunction(Box<RecycleCheckCallback<C>>),
}
Expand description
Possible methods of how a connection is recycled.
Variants§
Fast
Only check for open transactions when recycling existing connections Unless you have special needs this is a safe choice.
If the database connection is closed you will recieve an error on the first place you actually try to use the connection
Verified
In addition to checking for open transactions a test query is executed
This is slower, but guarantees that the database connection is ready to be used.
CustomQuery(Cow<'static, str>)
Like Verified
but with a custom query
CustomFunction(Box<RecycleCheckCallback<C>>)
Like Verified
but with a custom callback that allows to perform more checks
The connection is only recycled if the callback returns Ok(())
Trait Implementations§
source§impl<C: Debug> Debug for RecyclingMethod<C>
impl<C: Debug> Debug for RecyclingMethod<C>
source§impl<C> Default for RecyclingMethod<C>
impl<C> Default for RecyclingMethod<C>
source§fn default() -> RecyclingMethod<C>
fn default() -> RecyclingMethod<C>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<C> Freeze for RecyclingMethod<C>
impl<C> !RefUnwindSafe for RecyclingMethod<C>
impl<C> Send for RecyclingMethod<C>
impl<C> Sync for RecyclingMethod<C>
impl<C> Unpin for RecyclingMethod<C>
impl<C> !UnwindSafe for RecyclingMethod<C>
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> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read moresource§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> Conn::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> Conn::ExecuteFuture<'conn, 'query>
Executes the given command, returning the number of rows affected. Read more
source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> LoadFuture<'conn, 'query, Self, Conn, U>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> LoadFuture<'conn, 'query, Self, Conn, U>
source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
source§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> GetResult<'conn, 'query, Self, Conn, U>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> GetResult<'conn, 'query, Self, Conn, U>
Runs the command, and returns the affected row. Read more
source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> LoadFuture<'conn, 'query, Self, Conn, U>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> LoadFuture<'conn, 'query, Self, Conn, U>
Runs the command, returning an
Vec
with the affected rows. Read more