Struct fluvio_future::net::TcpStream
source · [−]pub struct TcpStream { /* private fields */ }Expand description
A TCP connection.
A TcpStream can be created by connecting to an endpoint or by
accepting an incoming connection.
TcpStream is a bidirectional stream that implements traits AsyncRead and
AsyncWrite.
Cloning a TcpStream creates another handle to the same socket. The socket will be closed
when all handles to it are dropped. The reading and writing portions of the connection can also
be shut down individually with the shutdown() method.
The Transmission Control Protocol is specified in IETF RFC 793.
Examples
use async_net::TcpStream;
use futures_lite::prelude::*;
let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
stream.write_all(b"hello").await?;
let mut buf = vec![0u8; 1024];
let n = stream.read(&mut buf).await?;Implementations
sourceimpl TcpStream
impl TcpStream
sourcepub async fn connect<A>(addr: A) -> Result<TcpStream, Error> where
A: AsyncToSocketAddrs,
pub async fn connect<A>(addr: A) -> Result<TcpStream, Error> where
A: AsyncToSocketAddrs,
Creates a TCP connection to the specified address.
This method will create a new TCP socket and attempt to connect it to the provided addr,
If addr yields multiple addresses, connecting will be attempted with each of the
addresses until connecting to one succeeds. If none of the addresses result in a successful
connection, the error from the last connect attempt is returned.
Examples
Connect to example.com:80:
use async_net::TcpStream;
let stream = TcpStream::connect("example.com:80").await?;Connect to 127.0.0.1:8080. If that fails, then try connecting to 127.0.0.1:8081:
use async_net::{SocketAddr, TcpStream};
let addrs = [
SocketAddr::from(([127, 0, 0, 1], 8080)),
SocketAddr::from(([127, 0, 0, 1], 8081)),
];
let stream = TcpStream::connect(&addrs[..]).await?;sourcepub fn local_addr(&self) -> Result<SocketAddr, Error>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
Returns the local address this stream is bound to.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("example.com:80").await?;
println!("Local address is {}", stream.local_addr()?);sourcepub fn peer_addr(&self) -> Result<SocketAddr, Error>
pub fn peer_addr(&self) -> Result<SocketAddr, Error>
Returns the remote address this stream is connected to.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("example.com:80").await?;
println!("Connected to {}", stream.peer_addr()?);sourcepub fn shutdown(&self, how: Shutdown) -> Result<(), Error>
pub fn shutdown(&self, how: Shutdown) -> Result<(), Error>
Shuts down the read half, write half, or both halves of this connection.
This method will cause all pending and future I/O in the given directions to return
immediately with an appropriate value (see the documentation of Shutdown).
Examples
use async_net::{Shutdown, TcpStream};
let stream = TcpStream::connect("127.0.0.1:8080").await?;
stream.shutdown(Shutdown::Both)?;sourcepub async fn peek(&self, buf: &mut [u8]) -> Result<usize, Error>
pub async fn peek(&self, buf: &mut [u8]) -> Result<usize, Error>
Receives data without removing it 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.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080").await?;
let mut buf = vec![0; 1024];
let n = stream.peek(&mut buf).await?;sourcepub fn nodelay(&self) -> Result<bool, Error>
pub fn nodelay(&self) -> Result<bool, Error>
Gets the value of the TCP_NODELAY option for this socket.
If set to true, this option disables the Nagle algorithm. This means that
written data is always sent as soon as possible, even if there is only a small amount of
it.
When set to false, written data is buffered until there is a certain amount to send out,
thereby avoiding the frequent sending of small packets.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080").await?;
println!("TCP_NODELAY is set to {}", stream.nodelay()?);sourcepub fn set_nodelay(&self, nodelay: bool) -> Result<(), Error>
pub fn set_nodelay(&self, nodelay: bool) -> Result<(), Error>
Sets the value of the TCP_NODELAY option for this socket.
If set to true, this option disables the Nagle algorithm. This means that
written data is always sent as soon as possible, even if there is only a small amount of
it.
When set to false, written data is buffered until there is a certain amount to send out,
thereby avoiding the frequent sending of small packets.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080").await?;
stream.set_nodelay(false)?;sourcepub fn ttl(&self) -> Result<u32, Error>
pub fn ttl(&self) -> Result<u32, Error>
Gets the value of the IP_TTL option for this socket.
This option configures the time-to-live field that is used in every packet sent from this socket.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080").await?;
println!("IP_TTL is set to {}", stream.ttl()?);sourcepub fn set_ttl(&self, ttl: u32) -> Result<(), Error>
pub fn set_ttl(&self, ttl: u32) -> Result<(), Error>
Sets the value of the IP_TTL option for this socket.
This option configures the time-to-live field that is used in every packet sent from this socket.
Examples
use async_net::TcpStream;
let stream = TcpStream::connect("127.0.0.1:8080").await?;
stream.set_ttl(100)?;Trait Implementations
sourceimpl AsConnectionFd for TcpStream
impl AsConnectionFd for TcpStream
fn as_connection_fd(&self) -> ConnectionFd
sourceimpl AsFd for TcpStream
impl AsFd for TcpStream
sourcefn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
sourceimpl AsyncRead for TcpStream
impl AsyncRead for TcpStream
sourcefn poll_read(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
fn poll_read(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
Attempt to read from the AsyncRead into buf. Read more
fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
Attempt to read from the AsyncRead into bufs using vectored
IO operations. Read more
sourceimpl AsyncWrite for TcpStream
impl AsyncWrite for TcpStream
sourcefn poll_write(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
Attempt to write bytes from buf into the object. Read more
sourcefn poll_flush(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
sourceimpl SplitConnection for TcpStream
impl SplitConnection for TcpStream
fn split_connection(self) -> (BoxWriteConnection, BoxReadConnection)
impl RefUnwindSafe for TcpStream
impl UnwindSafe for TcpStream
Auto Trait Implementations
Blanket Implementations
sourceimpl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
sourcefn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>ⓘNotable traits for ReadFuture<'_, R>impl<R> Future for ReadFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>ⓘNotable traits for ReadFuture<'_, R>impl<R> Future for ReadFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>;
Reads some bytes from the byte stream. Read more
sourcefn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self>ⓘNotable traits for ReadVectoredFuture<'_, R>impl<R> Future for ReadVectoredFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self>ⓘNotable traits for ReadVectoredFuture<'_, R>impl<R> Future for ReadVectoredFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>;
sourcefn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self>ⓘNotable traits for ReadToEndFuture<'_, R>impl<R> Future for ReadToEndFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self>ⓘNotable traits for ReadToEndFuture<'_, R>impl<R> Future for ReadToEndFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>;
sourcefn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self>ⓘNotable traits for ReadToStringFuture<'_, R>impl<R> Future for ReadToStringFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self>ⓘNotable traits for ReadToStringFuture<'_, R>impl<R> Future for ReadToStringFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
R: AsyncRead + Unpin + ?Sized, type Output = Result<usize, Error>;
sourcefn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>ⓘNotable traits for ReadExactFuture<'_, R>impl<R> Future for ReadExactFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>ⓘNotable traits for ReadExactFuture<'_, R>impl<R> Future for ReadExactFuture<'_, R> where
R: AsyncRead + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
R: AsyncRead + Unpin + ?Sized, type Output = Result<(), Error>;
Reads the exact number of bytes required to fill buf. Read more
sourcefn take(self, limit: u64) -> Take<Self>
fn take(self, limit: u64) -> Take<Self>
Creates an adapter which will read at most limit bytes from it. Read more
sourcefn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
Creates an adapter which will chain this stream with another. Read more
sourcefn boxed_reader<'a>(self) -> Pin<Box<dyn AsyncRead + Send + 'a, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; where
Self: 'a + Send,
fn boxed_reader<'a>(self) -> Pin<Box<dyn AsyncRead + Send + 'a, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; where
Self: 'a + Send,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Boxes the reader and changes its type to dyn AsyncRead + Send + 'a. Read more
sourceimpl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
sourcefn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
Creates an adaptor which will chain this stream with another. Read more
sourcefn read(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> where
Self: Unpin,
fn read(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self> where
Self: Unpin,
Tries to read some bytes directly into the given buf in asynchronous
manner, returning a future type. Read more
sourcefn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectored<'a, Self> where
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectored<'a, Self> where
Self: Unpin,
Creates a future which will read from the AsyncRead into bufs using vectored
IO operations. Read more
sourcefn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self> where
Self: Unpin,
Creates a future which will read exactly enough bytes to fill buf,
returning an error if end of file (EOF) is hit sooner. Read more
sourcefn read_to_end(&'a mut self, buf: &'a mut Vec<u8, Global>) -> ReadToEnd<'a, Self> where
Self: Unpin,
fn read_to_end(&'a mut self, buf: &'a mut Vec<u8, Global>) -> ReadToEnd<'a, Self> where
Self: Unpin,
Creates a future which will read all the bytes from this AsyncRead. Read more
sourcefn read_to_string(&'a mut self, buf: &'a mut String) -> ReadToString<'a, Self> where
Self: Unpin,
fn read_to_string(&'a mut self, buf: &'a mut String) -> ReadToString<'a, Self> where
Self: Unpin,
Creates a future which will read all the bytes from this AsyncRead. Read more
sourcefn split(self) -> (ReadHalf<Self>, WriteHalf<Self>) where
Self: AsyncWrite,
fn split(self) -> (ReadHalf<Self>, WriteHalf<Self>) where
Self: AsyncWrite,
Helper method for splitting this read/write object into two halves. Read more
sourceimpl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
sourcefn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>ⓘNotable traits for WriteFuture<'_, W>impl<W> Future for WriteFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
fn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>ⓘNotable traits for WriteFuture<'_, W>impl<W> Future for WriteFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>;
Writes some bytes into the byte stream. Read more
sourcefn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self>ⓘNotable traits for WriteVectoredFuture<'_, W>impl<W> Future for WriteVectoredFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self>ⓘNotable traits for WriteVectoredFuture<'_, W>impl<W> Future for WriteVectoredFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>; where
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized, type Output = Result<usize, Error>;
sourcefn write_all(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>ⓘNotable traits for WriteAllFuture<'_, W>impl<W> Future for WriteAllFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>ⓘNotable traits for WriteAllFuture<'_, W>impl<W> Future for WriteAllFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>;
Writes an entire buffer into the byte stream. Read more
sourcefn flush(&mut self) -> FlushFuture<'_, Self>ⓘNotable traits for FlushFuture<'_, W>impl<W> Future for FlushFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>ⓘNotable traits for FlushFuture<'_, W>impl<W> Future for FlushFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>;
Flushes the stream to ensure that all buffered contents reach their destination. Read more
sourcefn close(&mut self) -> CloseFuture<'_, Self>ⓘNotable traits for CloseFuture<'_, W>impl<W> Future for CloseFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
fn close(&mut self) -> CloseFuture<'_, Self>ⓘNotable traits for CloseFuture<'_, W>impl<W> Future for CloseFuture<'_, W> where
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>; where
Self: Unpin,
W: AsyncWrite + Unpin + ?Sized, type Output = Result<(), Error>;
Closes the writer. Read more
sourcefn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; where
Self: 'a + Send,
fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a, Global>>ⓘNotable traits for Pin<P>impl<P> Future for Pin<P> where
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output; where
Self: 'a + Send,
P: DerefMut,
<P as Deref>::Target: Future, type Output = <<P as Deref>::Target as Future>::Output;
Boxes the writer and changes its type to dyn AsyncWrite + Send + 'a. Read more
sourceimpl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
sourcefn flush(&mut self) -> Flush<'_, Self> where
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self> where
Self: Unpin,
Creates a future which will entirely flush this AsyncWrite. Read more
sourcefn close(&mut self) -> Close<'_, Self> where
Self: Unpin,
fn close(&mut self) -> Close<'_, Self> where
Self: Unpin,
Creates a future which will entirely close this AsyncWrite.
sourcefn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> where
Self: Unpin,
fn write(&'a mut self, buf: &'a [u8]) -> Write<'a, Self> where
Self: Unpin,
Creates a future which will write bytes from buf into the object. Read more
sourcefn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self> where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectored<'a, Self> where
Self: Unpin,
Creates a future which will write bytes from bufs into the object using vectored
IO operations. Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourceimpl<T> ReadExt for T where
T: AsyncRead + ?Sized,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
sourcefn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
Reads some bytes from the byte stream. Read more
sourcefn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
sourcefn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
Reads all bytes from the byte stream. Read more
sourcefn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
Reads all bytes from the byte stream and appends them into a string. Read more
sourcefn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
Reads the exact number of bytes required to fill buf. Read more
sourcefn take(self, limit: u64) -> Take<Self>
fn take(self, limit: u64) -> Take<Self>
Creates an adaptor which will read at most limit bytes from it. Read more
sourcefn by_ref(&mut self) -> &mut Self
fn by_ref(&mut self) -> &mut Self
Creates a “by reference” adaptor for this instance of Read. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output; where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output; where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourceimpl<T> WriteExt for T where
T: AsyncWrite + ?Sized,
impl<T> WriteExt for T where
T: AsyncWrite + ?Sized,
sourcefn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self> where
Self: Unpin,
fn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self> where
Self: Unpin,
Writes some bytes into the byte stream. Read more
sourcefn flush(&mut self) -> FlushFuture<'_, Self> where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self> where
Self: Unpin,
Flushes the stream to ensure that all buffered contents reach their destination. Read more