Skip to main content

ITcpStream

Trait ITcpStream 

Source
pub trait ITcpStream:
    AsyncRead
    + AsyncWrite
    + Unpin
    + Send
    + Sync {
    // Required methods
    fn peer_addr<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn local_addr<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A TcpStream.

Required Methods§

Source

fn peer_addr<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn local_addr<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SocketAddr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Blanket Implementations§

Source§

impl<T> IntoDyn<Box<dyn ITcpStream>> for T
where T: ITcpStream,

Source§

fn into_dyn(self) -> Box<dyn ITcpStream>
where T: Sized + 'static,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§