[−][src]Struct rbatis_core::runtime::TcpStream
A TCP stream between a local and a remote socket.
A TcpStream
can either be created by connecting to an endpoint, via the connect
method,
or by accepting a connection from a listener. It can be read or written to using the
AsyncRead
, AsyncWrite
, and related extension traits in futures::io
.
The connection will be closed when the value is dropped. The reading and writing portions of
the connection can also be shut down individually with the shutdown
method.
This type is an async version of std::net::TcpStream
.
Examples
use async_std::net::TcpStream; use async_std::prelude::*; let mut stream = TcpStream::connect("127.0.0.1:8080").await?; stream.write_all(b"hello world").await?; let mut buf = vec![0u8; 1024]; let n = stream.read(&mut buf).await?;
Implementations
impl TcpStream
[src]
pub async fn connect<A>(addrs: A) -> Result<TcpStream, Error> where
A: ToSocketAddrs,
[src]
A: ToSocketAddrs,
Creates a new TCP stream connected to the specified address.
This method will create a new TCP socket and attempt to connect it to the addr
provided. The returned future will be resolved once the stream has successfully
connected, or it will return an error if one occurs.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:0").await?;
pub fn local_addr(&self) -> Result<SocketAddr, Error>
[src]
Returns the local address that this stream is connected to.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; let addr = stream.local_addr()?;
pub fn peer_addr(&self) -> Result<SocketAddr, Error>
[src]
Returns the remote address that this stream is connected to.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; let peer = stream.peer_addr()?;
pub fn ttl(&self) -> Result<u32, Error>
[src]
Gets the value of the IP_TTL
option for this socket.
For more information about this option, see set_ttl
.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; stream.set_ttl(100)?; assert_eq!(stream.ttl()?, 100);
pub fn set_ttl(&self, ttl: u32) -> Result<(), Error>
[src]
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.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; stream.set_ttl(100)?; assert_eq!(stream.ttl()?, 100);
pub async fn peek(&'_ self, buf: &'_ mut [u8]) -> Result<usize, Error>
[src]
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.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8000").await?; let mut buf = vec![0; 1024]; let n = stream.peek(&mut buf).await?;
pub fn nodelay(&self) -> Result<bool, Error>
[src]
Gets the value of the TCP_NODELAY
option on this socket.
For more information about this option, see set_nodelay
.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; stream.set_nodelay(true)?; assert_eq!(stream.nodelay()?, true);
pub fn set_nodelay(&self, nodelay: bool) -> Result<(), Error>
[src]
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.
Examples
use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; stream.set_nodelay(true)?; assert_eq!(stream.nodelay()?, true);
pub fn shutdown(&self, how: Shutdown) -> Result<(), Error>
[src]
Shuts down the read, write, or both halves of this connection.
This method will cause all pending and future I/O on the specified portions to return
immediately with an appropriate value (see the documentation of Shutdown
).
Examples
use std::net::Shutdown; use async_std::net::TcpStream; let stream = TcpStream::connect("127.0.0.1:8080").await?; stream.shutdown(Shutdown::Both)?;
Trait Implementations
impl AsRawFd for TcpStream
[src]
impl<'_> AsyncRead for &'_ TcpStream
[src]
pub fn poll_read(
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
pub fn poll_read_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
impl AsyncRead for TcpStream
[src]
pub fn poll_read(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize, Error>>
pub fn poll_read_vectored(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>]
) -> Poll<Result<usize, Error>>
impl AsyncWrite for TcpStream
[src]
pub fn poll_write(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
pub fn poll_write_vectored(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
pub fn poll_flush(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
[src]
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_close(
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
[src]
self: Pin<&mut TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
impl<'_> AsyncWrite for &'_ TcpStream
[src]
pub fn poll_write(
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
pub fn poll_flush(
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
[src]
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_close(
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
[src]
self: Pin<&mut &'_ TcpStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
impl Clone for TcpStream
[src]
impl Debug for TcpStream
[src]
impl From<TcpStream> for TcpStream
[src]
pub fn from(stream: TcpStream) -> TcpStream
[src]
Converts a std::net::TcpStream
into its asynchronous equivalent.
impl FromRawFd for TcpStream
[src]
pub unsafe fn from_raw_fd(fd: i32) -> TcpStream
[src]
impl IntoRawFd for TcpStream
[src]
pub fn into_raw_fd(self) -> i32
[src]
Auto Trait Implementations
impl RefUnwindSafe for TcpStream
impl Send for TcpStream
impl Sync for TcpStream
impl Unpin for TcpStream
impl UnwindSafe for TcpStream
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<R> AsyncReadExt for R where
R: AsyncRead + ?Sized,
R: AsyncRead + ?Sized,
pub fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
pub fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
pub fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
pub fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn take(self, limit: u64) -> Take<Self>
pub fn bytes(self) -> Bytes<Self>
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
R: AsyncRead,
pub fn boxed_reader<'a>(self) -> Pin<Box<dyn AsyncRead + 'a + Send, Global>> where
Self: Send + 'a,
Self: Send + 'a,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
W: AsyncWrite + ?Sized,
pub fn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
pub fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self> where
Self: Unpin,
Self: Unpin,
pub fn flush(&mut self) -> FlushFuture<'_, Self> where
Self: Unpin,
Self: Unpin,
pub fn close(&mut self) -> CloseFuture<'_, Self> where
Self: Unpin,
Self: Unpin,
pub fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + 'a + Send, Global>> where
Self: Send + 'a,
Self: Send + 'a,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Conv for T
impl<T> Conv for T
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
T: ?Sized,
pub fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_ref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
pub fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
B: 'a + ?Sized,
R: 'a,
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Self: Borrow<B>,
pub fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
B: 'a + ?Sized,
R: 'a,
Self: BorrowMut<B>,
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
B: 'a + ?Sized,
R: 'a,
Self: BorrowMut<B>,
pub fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
R: 'a,
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Self: AsRef<U>,
U: 'a + ?Sized,
pub fn pipe_as_mut<'a, U, R>(
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
R: 'a,
Self: AsMut<U>,
U: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
R: 'a,
Self: AsMut<U>,
U: 'a + ?Sized,
pub fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Self: Deref<Target = T>,
T: 'a + ?Sized,
pub fn pipe_deref_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: AsMut<T>,
T: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: AsMut<T>,
T: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: BorrowMut<T>,
T: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
R: 'a,
Self: BorrowMut<T>,
T: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
R: 'a,
Self: Deref,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
R: 'a,
Self: Deref,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
R: 'a,
Self: DerefMut,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
R: 'a,
Self: DerefMut,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> ReadExt for T where
T: AsyncRead + ?Sized,
[src]
T: AsyncRead + ?Sized,
pub fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self> where
Self: Unpin,
pub fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self> where
Self: Unpin,
pub fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self> where
Self: Unpin,
pub fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn take(self, limit: u64) -> Take<Self>
[src]
pub fn by_ref(&mut self) -> &mut Self
[src]
pub fn bytes(self) -> Bytes<Self>
[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: AsyncRead,
[src]
R: AsyncRead,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Tap for T
pub fn tap(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
pub fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
pub fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
pub fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
pub fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
pub fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
pub fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
pub fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
pub fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
pub fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> TryConv for T
impl<T> TryConv for T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WriteExt for T where
T: AsyncWrite + ?Sized,
[src]
T: AsyncWrite + ?Sized,
pub fn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn flush(&mut self) -> FlushFuture<'_, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
[src]
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self> where
Self: Unpin,
pub fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,
pub fn write_fmt(&'a mut self, fmt: Arguments<'_>) -> WriteFmtFuture<'a, Self> where
Self: Unpin,
[src]
Self: Unpin,