pub struct ThriftConnectionManager<T>(/* private fields */);Expand description
An implementor of bb8::ManageConnection and/or r2d2::ManageConnection.
T should a MakeThriftConnection and T::Output should be a ThriftConnection
Implementations§
Source§impl<T> ThriftConnectionManager<T>
impl<T> ThriftConnectionManager<T>
Trait Implementations§
Source§impl<T: Clone> Clone for ThriftConnectionManager<T>
impl<T: Clone> Clone for ThriftConnectionManager<T>
Source§impl<T: Debug> Debug for ThriftConnectionManager<T>
impl<T: Debug> Debug for ThriftConnectionManager<T>
Source§impl<E: Send + Debug + 'static, C: ThriftConnection<Error = E> + Send + 'static, T: MakeThriftConnection<Output = C, Error = E> + Send + Sync + 'static> ManageConnection for ThriftConnectionManager<T>
impl<E: Send + Debug + 'static, C: ThriftConnection<Error = E> + Send + 'static, T: MakeThriftConnection<Output = C, Error = E> + Send + Sync + 'static> ManageConnection for ThriftConnectionManager<T>
Source§type Connection = C
type Connection = C
The connection type this manager deals with.
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Connection, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempts to create a new connection.
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.
Source§fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_valid<'life0, 'life1, 'async_trait>(
&'life0 self,
conn: &'life1 mut Self::Connection,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Determines if the connection is still connected to the database.
Source§impl<E: Error + 'static, C: ThriftConnection<Error = E> + Send + 'static, T: MakeThriftConnection<Output = C, Error = E> + Send + Sync + 'static> ManageConnection for ThriftConnectionManager<T>
Available on crate feature impl-r2d2 only.
impl<E: Error + 'static, C: ThriftConnection<Error = E> + Send + 'static, T: MakeThriftConnection<Output = C, Error = E> + Send + Sync + 'static> ManageConnection for ThriftConnectionManager<T>
Available on crate feature
impl-r2d2 only.Source§type Connection = C
type Connection = C
The connection type this manager deals with.
Source§fn connect(&self) -> Result<Self::Connection, Self::Error>
fn connect(&self) -> Result<Self::Connection, Self::Error>
Attempts to create a new connection.
Source§fn has_broken(&self, conn: &mut Self::Connection) -> bool
fn has_broken(&self, conn: &mut Self::Connection) -> bool
Quickly determines if the connection is no longer usable. Read more
Auto Trait Implementations§
impl<T> Freeze for ThriftConnectionManager<T>where
T: Freeze,
impl<T> RefUnwindSafe for ThriftConnectionManager<T>where
T: RefUnwindSafe,
impl<T> Send for ThriftConnectionManager<T>where
T: Send,
impl<T> Sync for ThriftConnectionManager<T>where
T: Sync,
impl<T> Unpin for ThriftConnectionManager<T>where
T: Unpin,
impl<T> UnwindSafe for ThriftConnectionManager<T>where
T: 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