pub struct FailsafeConnectionManager<T, U>{ /* private fields */ }Expand description
A genric bb8::ConnectionManager wrapped in failsafe-rs
Implementations§
Source§impl<T, U> FailsafeConnectionManager<T, U>
impl<T, U> FailsafeConnectionManager<T, U>
Sourcepub fn new(
connection_manager: T,
circuit_breaker: U,
) -> FailsafeConnectionManager<T, U>
pub fn new( connection_manager: T, circuit_breaker: U, ) -> FailsafeConnectionManager<T, U>
Create a new FailsafeConnectionManager consuming a ConnectionManager and CircuitBreaker
Trait Implementations§
Source§impl<T, U> Clone for FailsafeConnectionManager<T, U>
impl<T, U> Clone for FailsafeConnectionManager<T, U>
Source§fn clone(&self) -> FailsafeConnectionManager<T, U>
fn clone(&self) -> FailsafeConnectionManager<T, U>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, U> ManageConnection for FailsafeConnectionManager<T, U>
impl<T, U> ManageConnection for FailsafeConnectionManager<T, U>
Source§type Connection = <T as ManageConnection>::Connection
type Connection = <T as ManageConnection>::Connection
The connection type this manager deals with.
Source§async fn connect(&self) -> Result<Self::Connection, Self::Error>
async fn connect(&self) -> Result<Self::Connection, Self::Error>
Attempts to create a new connection.
Source§async fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
async fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error>
Determines if the connection is still connected to the database.
Source§fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Synchronously determine if the connection is no longer usable, if possible.
Auto Trait Implementations§
impl<T, U> Freeze for FailsafeConnectionManager<T, U>
impl<T, U> RefUnwindSafe for FailsafeConnectionManager<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for FailsafeConnectionManager<T, U>
impl<T, U> Sync for FailsafeConnectionManager<T, U>
impl<T, U> Unpin for FailsafeConnectionManager<T, U>
impl<T, U> UnwindSafe for FailsafeConnectionManager<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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