Struct rbatis_core::runtime::os::unix::net::UnixStream [−][src]
pub struct UnixStream { /* fields omitted */ }
Expand description
A Unix stream socket.
This type is an async version of std::os::unix::net::UnixStream
.
Examples
use async_std::os::unix::net::UnixStream;
use async_std::prelude::*;
let mut stream = UnixStream::connect("/tmp/socket").await?;
stream.write_all(b"hello world").await?;
let mut response = Vec::new();
stream.read_to_end(&mut response).await?;
Implementations
Connects to the socket to the specified address.
Examples
use async_std::os::unix::net::UnixStream;
let stream = UnixStream::connect("/tmp/socket").await?;
Creates an unnamed pair of connected sockets.
Returns two streams which are connected to each other.
Examples
use async_std::os::unix::net::UnixStream;
let stream = UnixStream::pair()?;
Returns the socket address of the local half of this connection.
Examples
use async_std::os::unix::net::UnixStream;
let stream = UnixStream::connect("/tmp/socket").await?;
let addr = stream.local_addr()?;
Returns the socket address of the remote half of this connection.
Examples
use async_std::os::unix::net::UnixStream;
let stream = UnixStream::connect("/tmp/socket").await?;
let peer = stream.peer_addr()?;
Shuts down the read, write, or both halves of this connection.
This function will cause all pending and future I/O calls on the specified portions to
immediately return with an appropriate value (see the documentation of Shutdown
).
use async_std::os::unix::net::UnixStream;
use std::net::Shutdown;
let stream = UnixStream::connect("/tmp/socket").await?;
stream.shutdown(Shutdown::Both)?;
Trait Implementations
Attempt to read from the AsyncRead
into buf
. Read more
Attempt to read from the AsyncRead
into buf
. Read more
Attempt to write bytes from buf
into the object. Read more
pub fn poll_flush(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_flush(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
pub fn poll_close(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_close(
self: Pin<&mut UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to close the object. Read more
Attempt to write bytes from buf
into the object. Read more
pub fn poll_flush(
self: Pin<&mut &'_ UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_flush(
self: Pin<&mut &'_ UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
pub fn poll_close(
self: Pin<&mut &'_ UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
pub fn poll_close(
self: Pin<&mut &'_ UnixStream>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
Attempt to close the object. Read more
Converts a std::os::unix::net::UnixStream
into its asynchronous equivalent.
Constructs a new instance of Self
from the given raw file
descriptor. Read more
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations
impl RefUnwindSafe for UnixStream
impl Send for UnixStream
impl Sync for UnixStream
impl Unpin for UnixStream
impl UnwindSafe for UnixStream
Blanket Implementations
Reads some bytes from the byte stream. Read more
Like [read()
][AsyncReadExt::read()
], except it reads into a slice of buffers. Read more
Reads the exact number of bytes required to fill buf
. Read more
Creates an adapter which will read at most limit
bytes from it. Read more
Creates an adapter which will chain this stream with another. Read more
Boxes the reader and changes its type to dyn AsyncRead + Send + 'a
. Read more
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for W where
W: AsyncWrite + ?Sized,
Writes some bytes into the byte stream. Read more
Like [write()
][AsyncWriteExt::write()
], except that it writes a slice of buffers. Read more
Writes an entire buffer into the byte stream. Read more
Flushes the stream to ensure that all buffered contents reach their destination. Read more
Closes the writer. Read more
Boxes the writer and changes its type to dyn AsyncWrite + Send + 'a
. Read more
Mutably borrows from an owned value. Read more
Reads some bytes from the byte stream. Read more
fn 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,
Reads all bytes from the byte stream. Read more
fn 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
Reads the exact number of bytes required to fill buf
. Read more
Creates an adaptor which will read at most limit
bytes from it. Read more
Creates a “by reference” adaptor for this instance of Read
. Read more
Transforms this Read
instance to a Stream
over its bytes. Read more