Struct mio::net::UnixStream[][src]

pub struct UnixStream { /* fields omitted */ }
This is supported on crate feature net only.

A non-blocking Unix stream socket.

Implementations

impl UnixStream[src]

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

Connects to the socket named by path.

pub fn from_std(stream: UnixStream) -> UnixStream

Notable traits for UnixStream

impl Read for UnixStreamimpl<'a> Read for &'a UnixStreamimpl Write for UnixStreamimpl<'a> Write for &'a UnixStream
[src]

Creates a new UnixStream from a standard net::UnixStream.

This function is intended to be used to wrap a Unix stream from the standard library in the Mio equivalent. The conversion assumes nothing about the underlying stream; it is left up to the user to set it in non-blocking mode.

Note

The Unix stream here will not have connect called on it, so it should already be connected via some other means (be it manually, or the standard library).

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

Creates an unnamed pair of connected sockets.

Returns two UnixStreams which are connected to each other.

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 connection.

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 Debug for UnixStream[src]

impl FromRawFd for UnixStream[src]

unsafe fn from_raw_fd(fd: RawFd) -> UnixStream

Notable traits for UnixStream

impl Read for UnixStreamimpl<'a> Read for &'a UnixStreamimpl Write for UnixStreamimpl<'a> Write for &'a UnixStream
[src]

Converts a RawFd to a UnixStream.

Notes

The caller is responsible for ensuring that the socket is in non-blocking mode.

impl IntoRawFd for UnixStream[src]

impl Read for UnixStream[src]

impl<'a> Read for &'a UnixStream[src]

impl Source for UnixStream[src]

impl Write for UnixStream[src]

impl<'a> Write for &'a UnixStream[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?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.