pub trait OwnedReadHalf:
AsyncRead
+ Unpin
+ Send
+ Sync
+ 'static {
type Runtime: RuntimeLite;
// Required methods
fn local_addr(&self) -> Result<SocketAddr>;
fn peer_addr(&self) -> Result<SocketAddr>;
fn peek(
&mut self,
buf: &mut [u8],
) -> impl Future<Output = Result<usize>> + Send;
}Expand description
The abstraction of a owned read half of a TcpStream.
Required Associated Types§
Sourcetype Runtime: RuntimeLite
type Runtime: RuntimeLite
The async runtime.
Required Methods§
Sourcefn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
Returns the local address that this stream is bound to.
Sourcefn peer_addr(&self) -> Result<SocketAddr>
fn peer_addr(&self) -> Result<SocketAddr>
Returns the remote address that this stream is connected to.
Sourcefn peek(&mut self, buf: &mut [u8]) -> impl Future<Output = Result<usize>> + Send
fn peek(&mut self, buf: &mut [u8]) -> impl Future<Output = Result<usize>> + Send
Receives data on the socket from the remote address to which it is connected, without removing that data from the queue.
On success, returns the number of bytes peeked.
Successive calls return the same data. This is accomplished by passing MSG_PEEK as a flag
to the underlying recv system call.
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.