pub trait PromisedStream:
Connection
+ Unpin
+ Send
+ Sync
+ 'static {
type Instant: Instant + Send + Sync + 'static;
// Required methods
fn local_addr(&self) -> SocketAddr;
fn peer_addr(&self) -> SocketAddr;
}Expand description
Represents a network connection.
This trait encapsulates functionality for a network connection that supports asynchronous read/write operations and can be split into separate read and write halves.
Required Associated Types§
Required Methods§
Sourcefn local_addr(&self) -> SocketAddr
fn local_addr(&self) -> SocketAddr
Returns the address of the local endpoint of the connection.
Sourcefn peer_addr(&self) -> SocketAddr
fn peer_addr(&self) -> SocketAddr
Returns the address of the remote endpoint of the connection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<R: Runtime> PromisedStream for TcpStream<R>
impl<R: Runtime> PromisedStream for TcpStream<R>
type Instant = <R as RuntimeLite>::Instant
Source§impl<R: Runtime> PromisedStream for TlsStream<R>
Available on crate feature tls only.
impl<R: Runtime> PromisedStream for TlsStream<R>
Available on crate feature
tls only.