pub struct TcpConnectionManager<A: ToSocketAddrs + Send + Sync + Clone + 'static> {
pub address: A,
}Expand description
Example implementation for TcpStream
Fields§
§address: ATrait Implementations§
Source§impl<A> ConnectionManager for TcpConnectionManager<A>
impl<A> ConnectionManager for TcpConnectionManager<A>
Source§type Connection = TcpStream
type Connection = TcpStream
Type of
ConnectionManager::Connections that this ConnectionManager creates and recycles.Source§type Error = Error
type Error = Error
Error that this
ConnectionManager can return when creating and/or recycling ConnectionManager::Connections.Source§type CreateFut = Pin<Box<dyn Future<Output = Result<TcpStream, <TcpConnectionManager<A> as ConnectionManager>::Error>> + Send>>
type CreateFut = Pin<Box<dyn Future<Output = Result<TcpStream, <TcpConnectionManager<A> as ConnectionManager>::Error>> + Send>>
Future that resolves to a new
ConnectionManager::Connection when created.Source§type ValidFut<'a> = Pin<Box<dyn Future<Output = bool> + Send + 'a>>
type ValidFut<'a> = Pin<Box<dyn Future<Output = bool> + Send + 'a>>
Future that resolves to true if the connection is valid, false otherwise.
Source§fn create_connection(&self) -> Self::CreateFut
fn create_connection(&self) -> Self::CreateFut
Create a new connection.
Source§fn is_valid<'a>(&'a self, stream: &'a Self::Connection) -> Self::ValidFut<'a>
fn is_valid<'a>(&'a self, stream: &'a Self::Connection) -> Self::ValidFut<'a>
Check if a connection is valid.
Auto Trait Implementations§
impl<A> Freeze for TcpConnectionManager<A>where
A: Freeze,
impl<A> RefUnwindSafe for TcpConnectionManager<A>where
A: RefUnwindSafe,
impl<A> Send for TcpConnectionManager<A>
impl<A> Sync for TcpConnectionManager<A>
impl<A> Unpin for TcpConnectionManager<A>where
A: Unpin,
impl<A> UnwindSafe for TcpConnectionManager<A>where
A: 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