[−][src]Struct tokio::net::unix::UnixStream
A structure representing a connected Unix socket.
This socket can be connected directly with UnixStream::connect
or accepted
from a listener with UnixListener::incoming
. Additionally, a pair of
anonymous Unix sockets can be created with UnixStream::pair
.
Methods
impl UnixStream
[src][−]
pub fn connect<P>(path: P) -> ConnectFuture where
P: AsRef<Path>,
[src][−]
P: AsRef<Path>,
Connects to the socket named by path
.
This function will create a new Unix socket and connect to the path specified, associating the returned stream with the default event loop's handle.
pub fn from_std(
stream: UnixStream,
handle: &Handle
) -> Result<UnixStream, Error>
[src][−]
stream: UnixStream,
handle: &Handle
) -> Result<UnixStream, Error>
Consumes a UnixStream
in the standard library and returns a
nonblocking UnixStream
from this crate.
The returned stream will be associated with the given event loop
specified by handle
and is ready to perform I/O.
pub fn pair() -> Result<(UnixStream, UnixStream), Error>
[src][−]
Creates an unnamed pair of connected sockets.
This function will create a pair of interconnected Unix sockets for communicating back and forth between one another. Each socket will be associated with the default event loop's handle.
pub fn poll_read_ready(&self, ready: Ready) -> Result<Async<Ready>, Error>
[src][−]
Test whether this socket is ready to be read or not.
pub fn poll_write_ready(&self) -> Result<Async<Ready>, Error>
[src][−]
Test whether this socket is ready to be written to or not.
pub fn local_addr(&self) -> Result<SocketAddr, Error>
[src][−]
Returns the socket address of the local half of this connection.
pub fn peer_addr(&self) -> Result<SocketAddr, Error>
[src][−]
Returns the socket address of the remote half of this connection.
pub fn peer_cred(&self) -> Result<UCred, Error>
[src][−]
Returns effective credentials of the process which called connect
or pair
.
pub fn take_error(&self) -> Result<Option<Error>, Error>
[src][−]
Returns the value of the SO_ERROR
option.
pub fn shutdown(&self, how: Shutdown) -> Result<(), Error>
[src][−]
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
).
Trait Implementations
impl AsRawFd for UnixStream
[src][+]
impl AsyncRead for UnixStream
[src][+]
impl<'a> AsyncRead for &'a UnixStream
[src][+]
impl AsyncWrite for UnixStream
[src][+]
impl<'a> AsyncWrite for &'a UnixStream
[src][+]
impl Debug for UnixStream
[src][+]
impl Read for UnixStream
[src][+]
impl<'a> Read for &'a UnixStream
[src][+]
impl Write for UnixStream
[src][+]
impl<'a> Write for &'a UnixStream
[src][+]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<R> ReadBytesExt for R where
R: Read + ?Sized,
[src][+]
R: Read + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
[src][+]
W: Write + ?Sized,