[][src]Struct fd_queue::tokio::UnixStream

pub struct UnixStream { /* fields omitted */ }

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.

Implementations

impl UnixStream[src]

pub async fn connect(path: impl AsRef<Path>) -> Result<UnixStream>[src]

Connects to the socket named by path.

This function will create a new socket and connect the the path specifed, associating the returned stream with the default event loop's handle.

For now, this is a synchronous function.

pub fn pair() -> Result<(UnixStream, UnixStream)>[src]

Creates an unnamed pair of conntected sockets.

This function will create an unnamed pair of interconnected Unix sockets for communicating back and forth between one another. Each socket will be associted with the default event loop's handle.

pub fn local_addr(&self) -> Result<SocketAddr>[src]

Returns the socket address of the local half of this connection.

pub fn peer_addr(&self) -> Result<SocketAddr>[src]

Returns the socket address of the remote half of this conneciton.

pub fn take_error(&self) -> Result<Option<Error>>[src]

Returns the value of the SO_ERROR option.

pub fn shutdown(&self, how: Shutdown) -> Result<()>[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 AsyncWrite for UnixStream[src]

impl Debug for UnixStream[src]

impl DequeueFd for UnixStream[src]

impl EnqueueFd for UnixStream[src]

impl PinnedDrop for UnixStream[src]

impl TryFrom<UnixStream> for UnixStream[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<UnixStream> for UnixStream[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'pin> Unpin for UnixStream where
    __UnixStream<'pin>: Unpin
[src]

impl UnsafeUnpin for UnixStream[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.