pub struct Tcp { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Transport<SocketAddr> for Tcp
impl Transport<SocketAddr> for Tcp
Source§type Stats = TcpStats
type Stats = TcpStats
The statistics for the transport (specifically its underlying IO object).
Source§type Connect = Pin<Box<dyn Future<Output = Result<<Tcp as Transport<SocketAddr>>::Io, <Tcp as Transport<SocketAddr>>::Error>> + Send>>
type Connect = Pin<Box<dyn Future<Output = Result<<Tcp as Transport<SocketAddr>>::Io, <Tcp as Transport<SocketAddr>>::Error>> + Send>>
A pending output for an outbound connection, obtained when calling
Transport::connect.Source§type Accept = Pin<Box<dyn Future<Output = Result<<Tcp as Transport<SocketAddr>>::Io, <Tcp as Transport<SocketAddr>>::Error>> + Send>>
type Accept = Pin<Box<dyn Future<Output = Result<<Tcp as Transport<SocketAddr>>::Io, <Tcp as Transport<SocketAddr>>::Error>> + Send>>
A pending output for an inbound connection, obtained when calling
Transport::poll_accept.Source§fn local_addr(&self) -> Option<SocketAddr>
fn local_addr(&self) -> Option<SocketAddr>
Returns the local address this transport is bound to (if it is bound).
Source§fn bind<'life0, 'async_trait>(
&'life0 mut self,
addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bind<'life0, 'async_trait>(
&'life0 mut self,
addr: SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Binds to the given address.
Source§fn connect(&mut self, addr: SocketAddr) -> Self::Connect
fn connect(&mut self, addr: SocketAddr) -> Self::Connect
Connects to the given address, returning a future representing a
pending outbound connection.
Source§fn poll_accept(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Accept>
fn poll_accept(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Accept>
Poll for incoming connections. If an inbound connection is received, a future representing
a pending inbound connection is returned. The future will resolve to
Transport::Accept.Source§fn on_control(&mut self, _ctrl: Self::Control)
fn on_control(&mut self, _ctrl: Self::Control)
Applies a control-plane message to the transport. It is expected to update internal state
only and should not perform long-running operations.
Source§impl TransportExt<SocketAddr> for Tcp
impl TransportExt<SocketAddr> for Tcp
Auto Trait Implementations§
impl !Freeze for Tcp
impl RefUnwindSafe for Tcp
impl Send for Tcp
impl Sync for Tcp
impl Unpin for Tcp
impl UnsafeUnpin for Tcp
impl UnwindSafe for Tcp
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