[][src]Struct cap_std::os::unix::net::UnixStream

pub struct UnixStream { /* fields omitted */ }

A Unix stream socket.

This corresponds to std::os::unix::net::UnixStream.

Note that this UnixStream has no connect method. To create a UnixStream, you must first obtain a Dir containing the path, and then call Dir::connect_unix_stream.

Implementations

impl UnixStream[src]

pub unsafe fn from_std(std: UnixStream) -> Self[src]

Constructs a new instance of Self from the given std::os::unix::net::UnixStream.

Safety

std::os::unix::net::UnixStream is not sandboxed and may access any address that the host process has access to.

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

Creates an unnamed pair of connected sockets.

This corresponds to std::os::unix::net::UnixStream::pair.

TODO: should this require a capability?

pub fn try_clone(&self) -> Result<Self>[src]

Creates a new independently owned handle to the underlying socket.

This corresponds to std::os::unix::net::UnixStream::try_clone.

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

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

This corresponds to std::os::unix::net::UnixStream::local_addr.

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

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

This corresponds to std::os::unix::net::UnixStream::peer_addr.

pub fn set_read_timeout(&self, timeout: Option<Duration>) -> Result<()>[src]

Sets the read timeout for the socket.

This corresponds to std::os::unix::net::UnixStream::set_read_timeout.

pub fn set_write_timeout(&self, timeout: Option<Duration>) -> Result<()>[src]

Sets the write timeout for the socket.

This corresponds to std::os::unix::net::UnixStream::set_write_timeout.

pub fn read_timeout(&self) -> Result<Option<Duration>>[src]

Returns the read timeout of this socket.

This corresponds to std::os::unix::net::UnixStream::read_timeout.

pub fn write_timeout(&self) -> Result<Option<Duration>>[src]

Returns the write timeout of this socket.

This corresponds to std::os::unix::net::UnixStream::write_timeout.

pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>[src]

Moves the socket into or out of nonblocking mode.

This corresponds to std::os::unix::net::UnixStream::set_nonblocking.

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

Returns the value of the SO_ERROR option.

This corresponds to std::os::unix::net::UnixStream::take_error.

pub fn shutdown(&self, how: Shutdown) -> Result<()>[src]

Shuts down the read, write, or both halves of this connection.

This corresponds to std::os::unix::net::UnixStream::shutdown.

Trait Implementations

impl AsRawFd for UnixStream[src]

impl FromRawFd for UnixStream[src]

impl IntoRawFd for UnixStream[src]

impl Read for UnixStream[src]

impl Read for &UnixStream[src]

impl Write for UnixStream[src]

impl Write for &UnixStream[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsUnsafeFile for T where
    T: AsRawFd
[src]

impl<T> AsUnsafeHandle for T where
    T: AsRawFd
[src]

impl<T> AsUnsafeSocket for T where
    T: AsRawFd
[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> FromUnsafeFile for T where
    T: FromRawFd
[src]

impl<T> FromUnsafeSocket for T where
    T: FromRawFd
[src]

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

impl<T> IntoUnsafeFile for T where
    T: IntoRawFd
[src]

impl<T> IntoUnsafeHandle for T where
    T: IntoRawFd
[src]

impl<T> IntoUnsafeSocket for T where
    T: IntoRawFd
[src]

impl<T> SetTimes for T where
    T: AsRawFd

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.