doc.rust-lang.org
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()>
Moves the socket into or out of nonblocking mode.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn send_to_addr(&self, buf: &[u8], socket_addr: &SocketAddr) -> io::Result<usize>
Sends data on the socket to the specified SocketAddr.
method
std
Stable since 1.70.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn send_to<P>(&self, buf: &[u8], path: P) -> io::Result<usize>
Sends data on the socket to the specified address.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn send(&self, buf: &[u8]) -> io::Result<usize>
Sends data on the socket to the socket's peer.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)>
Receives data from the socket.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn recv(&self, buf: &mut [u8]) -> io::Result<usize>
Receives data from the socket.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn read_timeout(&self) -> io::Result<Option<Duration>>
Returns the read timeout of this socket.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn peer_addr(&self) -> io::Result<SocketAddr>
Returns the address of this socket's peer.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn pair() -> io::Result<(UnixDatagram, UnixDatagram)>
Creates an unnamed pair of connected sockets.
associated_function
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn local_addr(&self) -> io::Result<SocketAddr>
Returns the address of this socket.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn connect_addr(&self, socket_addr: &SocketAddr) -> io::Result<()>
Connects the socket to an address.
method
std
Stable since 1.70.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn connect<P>(&self, path: P) -> io::Result<()>
Connects the socket to the specified path address.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn bind_addr(socket_addr: &SocketAddr) -> io::Result<UnixDatagram>
Creates a Unix datagram socket bound to an address.
associated_function
std
Stable since 1.70.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn bind<P>(path: P) -> io::Result<UnixDatagram>
Creates a Unix datagram socket bound to the given path.
associated_function
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct UnixDatagram
A Unix datagram socket.
struct
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_unnamed(&self) -> bool
Returns true if the address is unnamed.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn from_pathname<P>(path: P) -> io::Result<SocketAddr>
Constructs a SockAddr with the family AF_UNIX and the provided path.
associated_function
std
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_pathname(&self) -> Option<&Path>
Returns the contents of this address if it is a pathname address.
method
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct SocketAddr
An address associated with a Unix socket.
struct
std
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod net
Unix-specific networking functionality.
module
std
Stable since 1.10.0
Version 1.100.0-nightly