pub struct ClientConnectionManager<S> { /* private fields */ }Expand description
Struct to help implementing pooling with bb8
§TODO
- Move the cache out of the Client struct so we can share the cache across all connections in the pool
Implementations§
Source§impl<S: MembershipStorage + 'static> ClientConnectionManager<S>
impl<S: MembershipStorage + 'static> ClientConnectionManager<S>
Trait Implementations§
Source§impl<S: MembershipStorage + 'static> ManageConnection for ClientConnectionManager<S>
impl<S: MembershipStorage + 'static> ManageConnection for ClientConnectionManager<S>
Source§type Connection = Client<S>
type Connection = Client<S>
The connection type this manager deals with.
Source§type Error = ClientError
type Error = ClientError
The error type returned by
Connections.Source§fn connect(
&self,
) -> impl Future<Output = Result<Self::Connection, Self::Error>> + Send
fn connect( &self, ) -> impl Future<Output = Result<Self::Connection, Self::Error>> + Send
Attempts to create a new connection.
Source§fn is_valid(
&self,
_conn: &mut Self::Connection,
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn is_valid( &self, _conn: &mut Self::Connection, ) -> impl Future<Output = Result<(), Self::Error>> + Send
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<S> Freeze for ClientConnectionManager<S>where
S: Freeze,
impl<S> RefUnwindSafe for ClientConnectionManager<S>where
S: RefUnwindSafe,
impl<S> Send for ClientConnectionManager<S>where
S: Send,
impl<S> Sync for ClientConnectionManager<S>where
S: Sync,
impl<S> Unpin for ClientConnectionManager<S>where
S: Unpin,
impl<S> UnsafeUnpin for ClientConnectionManager<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ClientConnectionManager<S>where
S: 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
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