pub enum RecyclingMethod<C> {
Fast,
Verified,
CustomQuery(Cow<'static, str>),
CustomFunction(Box<RecycleCheckCallback<C>>),
}
Available on crate feature
pool
only.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> 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> 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> Pointable for T
impl<T> Pointable for T
Source§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