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: Clone + ToSocketAddrs + Send + Sync + Clone + 'static> Clone for TcpConnectionManager<A>
impl<A: Clone + ToSocketAddrs + Send + Sync + Clone + 'static> Clone for TcpConnectionManager<A>
Source§fn clone(&self) -> TcpConnectionManager<A>
fn clone(&self) -> TcpConnectionManager<A>
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<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 mut Self::Connection,
) -> Self::ValidFut<'a>
fn is_valid<'a>( &'a self, stream: &'a mut 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> UnsafeUnpin for TcpConnectionManager<A>where
A: UnsafeUnpin,
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