pub struct TcpStream { /* private fields */ }net only.Expand description
A TCP stream between a local and a remote socket.
A TCP stream can either be created by connecting to an endpoint, via the
connect method, or by accepting a connection from a listener.
§Examples
use std::net::SocketAddr;
use compio_io::AsyncWrite;
use compio_net::TcpStream;
// Connect to a peer
let mut stream = TcpStream::connect("127.0.0.1:8080").await.unwrap();
// Write some data.
stream.write("hello world!").await.unwrap();Implementations§
Source§impl TcpStream
impl TcpStream
Sourcepub async fn connect(addr: impl ToSocketAddrsAsync) -> Result<TcpStream, Error>
pub async fn connect(addr: impl ToSocketAddrsAsync) -> Result<TcpStream, Error>
Opens a TCP connection to a remote host.
To configure the socket before connecting, you can use the TcpSocket
type.
Sourcepub fn from_std(stream: TcpStream) -> Result<TcpStream, Error>
pub fn from_std(stream: TcpStream) -> Result<TcpStream, Error>
Creates new TcpStream from a std::net::TcpStream.
Sourcepub fn close(self) -> impl Future<Output = Result<(), Error>>
pub fn close(self) -> impl Future<Output = Result<(), Error>>
Close the socket. If the returned future is dropped before polling, the socket won’t be closed.
As the socket is clonable, users can call close on a clone, but the
future will never complete until all clones are dropped. Some
operations may keep a strong reference to the socket, so the future
may never complete if there are pending operations.
It’s OK to drop the socket directly without calling close, but the
socket may not be closed immediately.
Sourcepub fn peer_addr(&self) -> Result<SocketAddr, Error>
pub fn peer_addr(&self) -> Result<SocketAddr, Error>
Returns the socket address of the remote peer of this TCP connection.
Sourcepub fn local_addr(&self) -> Result<SocketAddr, Error>
pub fn local_addr(&self) -> Result<SocketAddr, Error>
Returns the socket address of the local half of this TCP connection.
Sourcepub fn take_error(&self) -> Result<Option<Error>, Error>
pub fn take_error(&self) -> Result<Option<Error>, Error>
Returns the value of the SO_ERROR option.
Sourcepub fn split(&self) -> (ReadHalf<'_, TcpStream>, WriteHalf<'_, TcpStream>)
pub fn split(&self) -> (ReadHalf<'_, TcpStream>, WriteHalf<'_, TcpStream>)
Splits a TcpStream into a read half and a write half, which can be
used to read and write the stream concurrently.
This method is more efficient than
into_split, but the halves cannot
be moved into independently spawned tasks.
Sourcepub fn into_split(self) -> (TcpStream, TcpStream)
pub fn into_split(self) -> (TcpStream, TcpStream)
Sourcepub async fn disconnect(self) -> Result<TcpSocket, Error>
Available on Windows only.
pub async fn disconnect(self) -> Result<TcpSocket, Error>
Close the connection of the socket, and reuse it to create a new
connection. This method is useful when the socket is created by
TcpListener::accept, and will be reused in
TcpListener::accept_with to accept a new connection.
Sourcepub fn nodelay(&self) -> Result<bool, Error>
pub fn nodelay(&self) -> Result<bool, Error>
Gets the value of the TCP_NODELAY option on this socket.
For more information about this option, see
TcpStream::set_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 on this socket.
If set, this option disables the Nagle algorithm. This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets.
Sourcepub fn linger(&self) -> Result<Option<Duration>, Error>
pub fn linger(&self) -> Result<Option<Duration>, Error>
Reads the linger duration for this socket by getting the SO_LINGER
option.
Sourcepub fn set_zero_linger(&self) -> Result<(), Error>
pub fn set_zero_linger(&self) -> Result<(), Error>
Sets a linger duration of zero on this socket by setting the SO_LINGER
option.
Sourcepub fn ttl_v4(&self) -> Result<u32, Error>
pub fn ttl_v4(&self) -> Result<u32, Error>
Gets the value of the IP_TTL option for this socket.
For more information about this option, see set_ttl_v4.
Sourcepub fn set_ttl_v4(&self, ttl: u32) -> Result<(), Error>
pub fn set_ttl_v4(&self, ttl: u32) -> Result<(), Error>
Sets the value for the IP_TTL option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
Sourcepub async fn send_out_of_band<T>(&self, buf: T) -> BufResult<usize, T>where
T: IoBuf,
pub async fn send_out_of_band<T>(&self, buf: T) -> BufResult<usize, T>where
T: IoBuf,
Sends out-of-band data on this socket.
Out-of-band data is sent with the MSG_OOB flag.
Trait Implementations§
Source§impl AsRawSocket for TcpStream
Available on Windows only.
impl AsRawSocket for TcpStream
Source§fn as_raw_socket(&self) -> u64
fn as_raw_socket(&self) -> u64
Source§impl AsSocket for TcpStream
Available on Windows only.
impl AsSocket for TcpStream
Source§fn as_socket(&self) -> BorrowedSocket<'_>
fn as_socket(&self) -> BorrowedSocket<'_>
Source§impl AsyncRead for &TcpStream
impl AsyncRead for &TcpStream
Source§impl AsyncRead for TcpStream
impl AsyncRead for TcpStream
Source§impl AsyncReadAncillary for &TcpStream
impl AsyncReadAncillary for &TcpStream
Source§async fn read_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<(usize, usize), (T, C)>
async fn read_with_ancillary<T, C>( &mut self, buffer: T, control: C, ) -> BufResult<(usize, usize), (T, C)>
Source§async fn read_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<(usize, usize), (T, C)>where
T: IoVectoredBufMut,
C: IoBufMut,
async fn read_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<(usize, usize), (T, C)>where
T: IoVectoredBufMut,
C: IoBufMut,
Source§impl AsyncReadAncillary for TcpStream
impl AsyncReadAncillary for TcpStream
Source§async fn read_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<(usize, usize), (T, C)>
async fn read_with_ancillary<T, C>( &mut self, buffer: T, control: C, ) -> BufResult<(usize, usize), (T, C)>
Source§async fn read_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<(usize, usize), (T, C)>where
T: IoVectoredBufMut,
C: IoBufMut,
async fn read_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<(usize, usize), (T, C)>where
T: IoVectoredBufMut,
C: IoBufMut,
Source§impl AsyncReadAncillaryManaged for &TcpStream
impl AsyncReadAncillaryManaged for &TcpStream
Source§impl AsyncReadAncillaryMulti for &TcpStream
impl AsyncReadAncillaryMulti for &TcpStream
Source§type Return = RecvMsgMultiResult
type Return = RecvMsgMultiResult
Source§fn read_multi_with_ancillary(
&mut self,
control_len: usize,
) -> impl Stream<Item = Result<<&TcpStream as AsyncReadAncillaryMulti>::Return, Error>>
fn read_multi_with_ancillary( &mut self, control_len: usize, ) -> impl Stream<Item = Result<<&TcpStream as AsyncReadAncillaryMulti>::Return, Error>>
Source§impl AsyncReadAncillaryMulti for TcpStream
impl AsyncReadAncillaryMulti for TcpStream
Source§type Return = RecvMsgMultiResult
type Return = RecvMsgMultiResult
Source§fn read_multi_with_ancillary(
&mut self,
control_len: usize,
) -> impl Stream<Item = Result<<TcpStream as AsyncReadAncillaryMulti>::Return, Error>>
fn read_multi_with_ancillary( &mut self, control_len: usize, ) -> impl Stream<Item = Result<<TcpStream as AsyncReadAncillaryMulti>::Return, Error>>
Source§impl AsyncReadManaged for &TcpStream
impl AsyncReadManaged for &TcpStream
Source§impl AsyncReadManaged for TcpStream
impl AsyncReadManaged for TcpStream
Source§impl AsyncReadMulti for &TcpStream
impl AsyncReadMulti for &TcpStream
Source§fn read_multi(
&mut self,
len: usize,
) -> impl Stream<Item = Result<<&TcpStream as AsyncReadManaged>::Buffer, Error>>
fn read_multi( &mut self, len: usize, ) -> impl Stream<Item = Result<<&TcpStream as AsyncReadManaged>::Buffer, Error>>
AsyncReadManaged::Buffer. Read moreSource§impl AsyncReadMulti for TcpStream
impl AsyncReadMulti for TcpStream
Source§fn read_multi(
&mut self,
len: usize,
) -> impl Stream<Item = Result<<TcpStream as AsyncReadManaged>::Buffer, Error>>
fn read_multi( &mut self, len: usize, ) -> impl Stream<Item = Result<<TcpStream as AsyncReadManaged>::Buffer, Error>>
AsyncReadManaged::Buffer. Read moreSource§impl AsyncWrite for &TcpStream
impl AsyncWrite for &TcpStream
Source§async fn write_vectored<T>(&mut self, buf: T) -> BufResult<usize, T>where
T: IoVectoredBuf,
async fn write_vectored<T>(&mut self, buf: T) -> BufResult<usize, T>where
T: IoVectoredBuf,
write, except that it write bytes from a buffer implements
IoVectoredBuf into the source. Read moreSource§impl AsyncWrite for TcpStream
impl AsyncWrite for TcpStream
Source§async fn write_vectored<T>(&mut self, buf: T) -> BufResult<usize, T>where
T: IoVectoredBuf,
async fn write_vectored<T>(&mut self, buf: T) -> BufResult<usize, T>where
T: IoVectoredBuf,
write, except that it write bytes from a buffer implements
IoVectoredBuf into the source. Read moreSource§impl AsyncWriteAncillary for &TcpStream
impl AsyncWriteAncillary for &TcpStream
Source§async fn write_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<usize, (T, C)>
async fn write_with_ancillary<T, C>( &mut self, buffer: T, control: C, ) -> BufResult<usize, (T, C)>
Source§async fn write_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<usize, (T, C)>where
T: IoVectoredBuf,
C: IoBuf,
async fn write_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<usize, (T, C)>where
T: IoVectoredBuf,
C: IoBuf,
Source§impl AsyncWriteAncillary for TcpStream
impl AsyncWriteAncillary for TcpStream
Source§async fn write_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<usize, (T, C)>
async fn write_with_ancillary<T, C>( &mut self, buffer: T, control: C, ) -> BufResult<usize, (T, C)>
Source§async fn write_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<usize, (T, C)>where
T: IoVectoredBuf,
C: IoBuf,
async fn write_vectored_with_ancillary<T, C>(
&mut self,
buffer: T,
control: C,
) -> BufResult<usize, (T, C)>where
T: IoVectoredBuf,
C: IoBuf,
Source§impl AsyncWriteAncillaryZerocopy for &TcpStream
impl AsyncWriteAncillaryZerocopy for &TcpStream
Source§type BufferReadyFuture<T: IoBuf, C: IoBuf> = Extract<Zerocopy<SendMsg<[T; 1], C, SharedFd<Socket>>>, T, C>
type BufferReadyFuture<T: IoBuf, C: IoBuf> = Extract<Zerocopy<SendMsg<[T; 1], C, SharedFd<Socket>>>, T, C>
Source§type VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf> = Zerocopy<SendMsg<T, C, SharedFd<Socket>>>
type VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf> = Zerocopy<SendMsg<T, C, SharedFd<Socket>>>
Source§async fn write_zerocopy_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> BufResult<usize, <&TcpStream as AsyncWriteAncillaryZerocopy>::BufferReadyFuture<T, C>>
async fn write_zerocopy_with_ancillary<T, C>( &mut self, buf: T, control: C, ) -> BufResult<usize, <&TcpStream as AsyncWriteAncillaryZerocopy>::BufferReadyFuture<T, C>>
Source§async fn write_zerocopy_vectored_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> BufResult<usize, <&TcpStream as AsyncWriteAncillaryZerocopy>::VectoredBufferReadyFuture<T, C>>where
T: IoVectoredBuf,
C: IoBuf,
async fn write_zerocopy_vectored_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> BufResult<usize, <&TcpStream as AsyncWriteAncillaryZerocopy>::VectoredBufferReadyFuture<T, C>>where
T: IoVectoredBuf,
C: IoBuf,
write_zerocopy_with_ancillary, except that it writes from a
buffer implements IoVectoredBuf into the source.Source§impl AsyncWriteAncillaryZerocopy for TcpStream
impl AsyncWriteAncillaryZerocopy for TcpStream
Source§type BufferReadyFuture<T: IoBuf, C: IoBuf> = Extract<Zerocopy<SendMsg<[T; 1], C, SharedFd<Socket>>>, T, C>
type BufferReadyFuture<T: IoBuf, C: IoBuf> = Extract<Zerocopy<SendMsg<[T; 1], C, SharedFd<Socket>>>, T, C>
Source§type VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf> = Zerocopy<SendMsg<T, C, SharedFd<Socket>>>
type VectoredBufferReadyFuture<T: IoVectoredBuf, C: IoBuf> = Zerocopy<SendMsg<T, C, SharedFd<Socket>>>
Source§async fn write_zerocopy_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> BufResult<usize, <TcpStream as AsyncWriteAncillaryZerocopy>::BufferReadyFuture<T, C>>
async fn write_zerocopy_with_ancillary<T, C>( &mut self, buf: T, control: C, ) -> BufResult<usize, <TcpStream as AsyncWriteAncillaryZerocopy>::BufferReadyFuture<T, C>>
Source§async fn write_zerocopy_vectored_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> BufResult<usize, <TcpStream as AsyncWriteAncillaryZerocopy>::VectoredBufferReadyFuture<T, C>>where
T: IoVectoredBuf,
C: IoBuf,
async fn write_zerocopy_vectored_with_ancillary<T, C>(
&mut self,
buf: T,
control: C,
) -> BufResult<usize, <TcpStream as AsyncWriteAncillaryZerocopy>::VectoredBufferReadyFuture<T, C>>where
T: IoVectoredBuf,
C: IoBuf,
write_zerocopy_with_ancillary, except that it writes from a
buffer implements IoVectoredBuf into the source.Source§impl AsyncWriteZerocopy for &TcpStream
impl AsyncWriteZerocopy for &TcpStream
Source§type BufferReadyFuture<T: IoBuf> = Zerocopy<Send<T, SharedFd<Socket>>>
type BufferReadyFuture<T: IoBuf> = Zerocopy<Send<T, SharedFd<Socket>>>
Source§type VectoredBufferReadyFuture<T: IoVectoredBuf> = Zerocopy<SendVectored<T, SharedFd<Socket>>>
type VectoredBufferReadyFuture<T: IoVectoredBuf> = Zerocopy<SendVectored<T, SharedFd<Socket>>>
Source§async fn write_zerocopy<T>(
&mut self,
buf: T,
) -> BufResult<usize, <&TcpStream as AsyncWriteZerocopy>::BufferReadyFuture<T>>where
T: IoBuf,
async fn write_zerocopy<T>(
&mut self,
buf: T,
) -> BufResult<usize, <&TcpStream as AsyncWriteZerocopy>::BufferReadyFuture<T>>where
T: IoBuf,
Source§async fn write_zerocopy_vectored<T>(
&mut self,
buf: T,
) -> BufResult<usize, <&TcpStream as AsyncWriteZerocopy>::VectoredBufferReadyFuture<T>>where
T: IoVectoredBuf,
async fn write_zerocopy_vectored<T>(
&mut self,
buf: T,
) -> BufResult<usize, <&TcpStream as AsyncWriteZerocopy>::VectoredBufferReadyFuture<T>>where
T: IoVectoredBuf,
write_zerocopy, except that it writes from a buffer implements
IoVectoredBuf into the source.Source§impl AsyncWriteZerocopy for TcpStream
impl AsyncWriteZerocopy for TcpStream
Source§type BufferReadyFuture<T: IoBuf> = Zerocopy<Send<T, SharedFd<Socket>>>
type BufferReadyFuture<T: IoBuf> = Zerocopy<Send<T, SharedFd<Socket>>>
Source§type VectoredBufferReadyFuture<T: IoVectoredBuf> = Zerocopy<SendVectored<T, SharedFd<Socket>>>
type VectoredBufferReadyFuture<T: IoVectoredBuf> = Zerocopy<SendVectored<T, SharedFd<Socket>>>
Source§async fn write_zerocopy<T>(
&mut self,
buf: T,
) -> BufResult<usize, <TcpStream as AsyncWriteZerocopy>::BufferReadyFuture<T>>where
T: IoBuf,
async fn write_zerocopy<T>(
&mut self,
buf: T,
) -> BufResult<usize, <TcpStream as AsyncWriteZerocopy>::BufferReadyFuture<T>>where
T: IoBuf,
Source§async fn write_zerocopy_vectored<T>(
&mut self,
buf: T,
) -> BufResult<usize, <TcpStream as AsyncWriteZerocopy>::VectoredBufferReadyFuture<T>>where
T: IoVectoredBuf,
async fn write_zerocopy_vectored<T>(
&mut self,
buf: T,
) -> BufResult<usize, <TcpStream as AsyncWriteZerocopy>::VectoredBufferReadyFuture<T>>where
T: IoVectoredBuf,
write_zerocopy, except that it writes from a buffer implements
IoVectoredBuf into the source.Source§impl FromRawSocket for TcpStream
Available on Windows only.
impl FromRawSocket for TcpStream
Source§impl<'a> Splittable for &'a TcpStream
impl<'a> Splittable for &'a TcpStream
Source§type ReadHalf = ReadHalf<'a, TcpStream>
type ReadHalf = ReadHalf<'a, TcpStream>
AsyncRead or
AsyncReadAt.Source§type WriteHalf = WriteHalf<'a, TcpStream>
type WriteHalf = WriteHalf<'a, TcpStream>
AsyncWrite or
AsyncWriteAt.Source§fn split(
self,
) -> (<&'a TcpStream as Splittable>::ReadHalf, <&'a TcpStream as Splittable>::WriteHalf)
fn split( self, ) -> (<&'a TcpStream as Splittable>::ReadHalf, <&'a TcpStream as Splittable>::WriteHalf)
self and returns a tuple containing separate read and write
halves. Read moreSource§impl<'a> Splittable for &'a mut TcpStream
impl<'a> Splittable for &'a mut TcpStream
Source§type ReadHalf = ReadHalf<'a, TcpStream>
type ReadHalf = ReadHalf<'a, TcpStream>
AsyncRead or
AsyncReadAt.Source§type WriteHalf = WriteHalf<'a, TcpStream>
type WriteHalf = WriteHalf<'a, TcpStream>
AsyncWrite or
AsyncWriteAt.Source§fn split(
self,
) -> (<&'a mut TcpStream as Splittable>::ReadHalf, <&'a mut TcpStream as Splittable>::WriteHalf)
fn split( self, ) -> (<&'a mut TcpStream as Splittable>::ReadHalf, <&'a mut TcpStream as Splittable>::WriteHalf)
self and returns a tuple containing separate read and write
halves. Read moreSource§impl Splittable for TcpStream
impl Splittable for TcpStream
Source§type ReadHalf = TcpStream
type ReadHalf = TcpStream
AsyncRead or
AsyncReadAt.Source§type WriteHalf = TcpStream
type WriteHalf = TcpStream
AsyncWrite or
AsyncWriteAt.Source§fn split(
self,
) -> (<TcpStream as Splittable>::ReadHalf, <TcpStream as Splittable>::WriteHalf)
fn split( self, ) -> (<TcpStream as Splittable>::ReadHalf, <TcpStream as Splittable>::WriteHalf)
self and returns a tuple containing separate read and write
halves. Read moreSharedFd.Auto Trait Implementations§
impl Freeze for TcpStream
impl RefUnwindSafe for TcpStream
impl Send for TcpStream
impl Sync for TcpStream
impl Unpin for TcpStream
impl UnsafeUnpin for TcpStream
impl UnwindSafe for TcpStream
Blanket Implementations§
§impl<T> AsFd for Twhere
T: AsSocket,
impl<T> AsFd for Twhere
T: AsSocket,
§fn as_fd(&self) -> BorrowedSocket<'_>
fn as_fd(&self) -> BorrowedSocket<'_>
as_fd function for Winsock, where an Fd is a Socket.§impl<T> AsRawFd for Twhere
T: AsRawSocket,
impl<T> AsRawFd for Twhere
T: AsRawSocket,
§impl<T> AsRawSocketlike for Twhere
T: AsRawSocket,
impl<T> AsRawSocketlike for Twhere
T: AsRawSocket,
§fn as_raw_socketlike(&self) -> u64
fn as_raw_socketlike(&self) -> u64
§impl<T> AsRawSocketlike for Twhere
T: AsRawSocket,
impl<T> AsRawSocketlike for Twhere
T: AsRawSocket,
§fn as_raw_socketlike(&self) -> u64
fn as_raw_socketlike(&self) -> u64
§impl<T> AsSocketlike for Twhere
T: AsSocket,
impl<T> AsSocketlike for Twhere
T: AsSocket,
§fn as_socketlike(&self) -> BorrowedSocket<'_>
fn as_socketlike(&self) -> BorrowedSocket<'_>
§fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
&Target. Read more§impl<T> AsSocketlike for Twhere
T: AsSocket,
impl<T> AsSocketlike for Twhere
T: AsSocket,
§fn as_socketlike(&self) -> BorrowedSocket<'_>
fn as_socketlike(&self) -> BorrowedSocket<'_>
§fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>where
Target: SocketlikeViewType,
&Target. Read more§impl<A> AsyncReadExt for A
impl<A> AsyncReadExt for A
§async fn append<T>(&mut self, buf: T) -> BufResult<usize, T>where
T: IoBufMut,
async fn append<T>(&mut self, buf: T) -> BufResult<usize, T>where
T: IoBufMut,
AsyncRead::read, but it appends data to the end of the
buffer; in other words, it read to the beginning of the uninitialized
area.§async fn read_exact<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoBufMut,
async fn read_exact<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoBufMut,
§async fn read_to_string(&mut self, buf: String) -> BufResult<usize, String>
async fn read_to_string(&mut self, buf: String) -> BufResult<usize, String>
String until underlying reader reaches EOF.§async fn read_to_end<A>(
&mut self,
buf: Vec<u8, A>,
) -> BufResult<usize, Vec<u8, A>>where
A: Allocator + 'static,
async fn read_to_end<A>(
&mut self,
buf: Vec<u8, A>,
) -> BufResult<usize, Vec<u8, A>>where
A: Allocator + 'static,
EOF.§async fn read_vectored_exact<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoVectoredBufMut,
async fn read_vectored_exact<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoVectoredBufMut,
§fn framed<T, C, F>(
self,
codec: C,
framer: F,
) -> Framed<Self::ReadHalf, Self::WriteHalf, C, F, T, T>where
Self: Sized + Splittable,
fn framed<T, C, F>(
self,
codec: C,
framer: F,
) -> Framed<Self::ReadHalf, Self::WriteHalf, C, F, T, T>where
Self: Sized + Splittable,
framed::Framed reader/writer with the given codec and
framer.§fn bytes(
self,
) -> Framed<Self::ReadHalf, Self::WriteHalf, BytesCodec, NoopFramer, Bytes, Bytes>where
Self: Sized + Splittable,
fn bytes(
self,
) -> Framed<Self::ReadHalf, Self::WriteHalf, BytesCodec, NoopFramer, Bytes, Bytes>where
Self: Sized + Splittable,
bytes only.framed::BytesFramed reader/writter
out of a splittable.§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit bytes from it. Read more§async fn read_u8_le(&mut self) -> Result<u8, Error>
async fn read_u8_le(&mut self) -> Result<u8, Error>
u8 from the underlying reader.§async fn read_u16(&mut self) -> Result<u16, Error>
async fn read_u16(&mut self) -> Result<u16, Error>
u16 from the underlying reader.§async fn read_u16_le(&mut self) -> Result<u16, Error>
async fn read_u16_le(&mut self) -> Result<u16, Error>
u16 from the underlying reader.§async fn read_u32(&mut self) -> Result<u32, Error>
async fn read_u32(&mut self) -> Result<u32, Error>
u32 from the underlying reader.§async fn read_u32_le(&mut self) -> Result<u32, Error>
async fn read_u32_le(&mut self) -> Result<u32, Error>
u32 from the underlying reader.§async fn read_u64(&mut self) -> Result<u64, Error>
async fn read_u64(&mut self) -> Result<u64, Error>
u64 from the underlying reader.§async fn read_u64_le(&mut self) -> Result<u64, Error>
async fn read_u64_le(&mut self) -> Result<u64, Error>
u64 from the underlying reader.§async fn read_u128(&mut self) -> Result<u128, Error>
async fn read_u128(&mut self) -> Result<u128, Error>
u128 from the underlying reader.§async fn read_u128_le(&mut self) -> Result<u128, Error>
async fn read_u128_le(&mut self) -> Result<u128, Error>
u128 from the underlying reader.§async fn read_i8_le(&mut self) -> Result<i8, Error>
async fn read_i8_le(&mut self) -> Result<i8, Error>
i8 from the underlying reader.§async fn read_i16(&mut self) -> Result<i16, Error>
async fn read_i16(&mut self) -> Result<i16, Error>
i16 from the underlying reader.§async fn read_i16_le(&mut self) -> Result<i16, Error>
async fn read_i16_le(&mut self) -> Result<i16, Error>
i16 from the underlying reader.§async fn read_i32(&mut self) -> Result<i32, Error>
async fn read_i32(&mut self) -> Result<i32, Error>
i32 from the underlying reader.§async fn read_i32_le(&mut self) -> Result<i32, Error>
async fn read_i32_le(&mut self) -> Result<i32, Error>
i32 from the underlying reader.§async fn read_i64(&mut self) -> Result<i64, Error>
async fn read_i64(&mut self) -> Result<i64, Error>
i64 from the underlying reader.§async fn read_i64_le(&mut self) -> Result<i64, Error>
async fn read_i64_le(&mut self) -> Result<i64, Error>
i64 from the underlying reader.§async fn read_i128(&mut self) -> Result<i128, Error>
async fn read_i128(&mut self) -> Result<i128, Error>
i128 from the underlying reader.§async fn read_i128_le(&mut self) -> Result<i128, Error>
async fn read_i128_le(&mut self) -> Result<i128, Error>
i128 from the underlying reader.§async fn read_f32(&mut self) -> Result<f32, Error>
async fn read_f32(&mut self) -> Result<f32, Error>
f32 from the underlying reader.§async fn read_f32_le(&mut self) -> Result<f32, Error>
async fn read_f32_le(&mut self) -> Result<f32, Error>
f32 from the underlying reader.§async fn read_f64(&mut self) -> Result<f64, Error>
async fn read_f64(&mut self) -> Result<f64, Error>
f64 from the underlying reader.§async fn read_f64_le(&mut self) -> Result<f64, Error>
async fn read_f64_le(&mut self) -> Result<f64, Error>
f64 from the underlying reader.§impl<A> AsyncWriteExt for Awhere
A: AsyncWrite + ?Sized,
impl<A> AsyncWriteExt for Awhere
A: AsyncWrite + ?Sized,
§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
AsyncWrite. Read more§async fn write_all<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoBuf,
async fn write_all<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoBuf,
§async fn write_vectored_all<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoVectoredBuf,
async fn write_vectored_all<T>(&mut self, buf: T) -> BufResult<(), T>where
T: IoVectoredBuf,
AsyncWrite::write_vectored, except that it tries to write the entire
contents of the buffer into this writer.§fn framed<T, C, F>(
self,
codec: C,
framer: F,
) -> Framed<Self::ReadHalf, Self::WriteHalf, C, F, T, T>where
Self: Sized + Splittable,
fn framed<T, C, F>(
self,
codec: C,
framer: F,
) -> Framed<Self::ReadHalf, Self::WriteHalf, C, F, T, T>where
Self: Sized + Splittable,
framed::Framed reader/writer with the given codec and
framer.§fn bytes(
self,
) -> Framed<Self::ReadHalf, Self::WriteHalf, BytesCodec, NoopFramer, Bytes, Bytes>where
Self: Sized + Splittable,
fn bytes(
self,
) -> Framed<Self::ReadHalf, Self::WriteHalf, BytesCodec, NoopFramer, Bytes, Bytes>where
Self: Sized + Splittable,
bytes only.framed::BytesFramed reader/writer
out of a splittable.§fn write_only(self) -> WriteOnly<Self>where
Self: Sized,
fn write_only(self) -> WriteOnly<Self>where
Self: Sized,
§async fn write_u8(&mut self, num: u8) -> Result<(), Error>
async fn write_u8(&mut self, num: u8) -> Result<(), Error>
u8 into the underlying writer.§async fn write_u8_le(&mut self, num: u8) -> Result<(), Error>
async fn write_u8_le(&mut self, num: u8) -> Result<(), Error>
u8 into the underlying writer.§async fn write_u16(&mut self, num: u16) -> Result<(), Error>
async fn write_u16(&mut self, num: u16) -> Result<(), Error>
u16 into the underlying writer.§async fn write_u16_le(&mut self, num: u16) -> Result<(), Error>
async fn write_u16_le(&mut self, num: u16) -> Result<(), Error>
u16 into the underlying writer.§async fn write_u32(&mut self, num: u32) -> Result<(), Error>
async fn write_u32(&mut self, num: u32) -> Result<(), Error>
u32 into the underlying writer.§async fn write_u32_le(&mut self, num: u32) -> Result<(), Error>
async fn write_u32_le(&mut self, num: u32) -> Result<(), Error>
u32 into the underlying writer.§async fn write_u64(&mut self, num: u64) -> Result<(), Error>
async fn write_u64(&mut self, num: u64) -> Result<(), Error>
u64 into the underlying writer.§async fn write_u64_le(&mut self, num: u64) -> Result<(), Error>
async fn write_u64_le(&mut self, num: u64) -> Result<(), Error>
u64 into the underlying writer.§async fn write_u128(&mut self, num: u128) -> Result<(), Error>
async fn write_u128(&mut self, num: u128) -> Result<(), Error>
u128 into the underlying writer.§async fn write_u128_le(&mut self, num: u128) -> Result<(), Error>
async fn write_u128_le(&mut self, num: u128) -> Result<(), Error>
u128 into the underlying writer.§async fn write_i8(&mut self, num: i8) -> Result<(), Error>
async fn write_i8(&mut self, num: i8) -> Result<(), Error>
i8 into the underlying writer.§async fn write_i8_le(&mut self, num: i8) -> Result<(), Error>
async fn write_i8_le(&mut self, num: i8) -> Result<(), Error>
i8 into the underlying writer.§async fn write_i16(&mut self, num: i16) -> Result<(), Error>
async fn write_i16(&mut self, num: i16) -> Result<(), Error>
i16 into the underlying writer.§async fn write_i16_le(&mut self, num: i16) -> Result<(), Error>
async fn write_i16_le(&mut self, num: i16) -> Result<(), Error>
i16 into the underlying writer.§async fn write_i32(&mut self, num: i32) -> Result<(), Error>
async fn write_i32(&mut self, num: i32) -> Result<(), Error>
i32 into the underlying writer.§async fn write_i32_le(&mut self, num: i32) -> Result<(), Error>
async fn write_i32_le(&mut self, num: i32) -> Result<(), Error>
i32 into the underlying writer.§async fn write_i64(&mut self, num: i64) -> Result<(), Error>
async fn write_i64(&mut self, num: i64) -> Result<(), Error>
i64 into the underlying writer.§async fn write_i64_le(&mut self, num: i64) -> Result<(), Error>
async fn write_i64_le(&mut self, num: i64) -> Result<(), Error>
i64 into the underlying writer.§async fn write_i128(&mut self, num: i128) -> Result<(), Error>
async fn write_i128(&mut self, num: i128) -> Result<(), Error>
i128 into the underlying writer.§async fn write_i128_le(&mut self, num: i128) -> Result<(), Error>
async fn write_i128_le(&mut self, num: i128) -> Result<(), Error>
i128 into the underlying writer.§async fn write_f32(&mut self, num: f32) -> Result<(), Error>
async fn write_f32(&mut self, num: f32) -> Result<(), Error>
f32 into the underlying writer.§async fn write_f32_le(&mut self, num: f32) -> Result<(), Error>
async fn write_f32_le(&mut self, num: f32) -> Result<(), Error>
f32 into the underlying writer.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromRawFd for Twhere
T: FromRawSocket,
impl<T> FromRawFd for Twhere
T: FromRawSocket,
§unsafe fn from_raw_fd(raw_fd: u64) -> T
unsafe fn from_raw_fd(raw_fd: u64) -> T
from_raw_fd for use with Winsock API. Read more§impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
§unsafe fn from_raw_socketlike(raw: u64) -> T
unsafe fn from_raw_socketlike(raw: u64) -> T
Self from the raw value.§impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
impl<T> FromRawSocketlike for Twhere
T: FromRawSocket,
§unsafe fn from_raw_socketlike(raw: u64) -> T
unsafe fn from_raw_socketlike(raw: u64) -> T
Self from the raw value.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<S> IntoMaybeTlsStream<S> for Swhere
S: Splittable,
impl<S> IntoMaybeTlsStream<S> for Swhere
S: Splittable,
Source§fn into_maybe_tls_stream(
self,
capacity: usize,
max_buffer_size: usize,
) -> MaybeTlsStream<S>
fn into_maybe_tls_stream( self, capacity: usize, max_buffer_size: usize, ) -> MaybeTlsStream<S>
MaybeTlsStream with capacity and buffer size limit.