Struct unix_socket::UnixListener [] [src]

pub struct UnixListener {
    // some fields omitted
}

A structure representing a Unix domain socket server.

Methods

impl UnixListener
[src]

fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>

Creates a new UnixListener which will be bound to the specified socket.

Linux provides, as a nonportable extension, a separate "abstract" address namespace as opposed to filesystem-based addressing. If path begins with a null byte, it will be interpreted as an "abstract" address. Otherwise, it will be interpreted as a "pathname" address, corresponding to a path on the filesystem.

fn accept(&self) -> Result<UnixStream>

Accepts a new incoming connection to this listener.

fn try_clone(&self) -> Result<UnixStream>

Create a new independently owned handle to the underlying socket.

The returned UnixListener is a reference to the same socket that this object references. Both handles can be used to accept incoming connections and options set on one listener will affect the other.

fn local_addr(&self) -> Result<SocketAddr>

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

fn incoming<'a>(&'a self) -> Incoming<'a>

Returns an iterator over incoming connections.

The iterator will never return None.

Trait Implementations

impl Debug for UnixListener
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

Formats the value using the given formatter.

impl AsRawFd for UnixListener
[src]

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more

impl<'a> IntoIterator for &'a UnixListener
[src]

type Item = Result<UnixStream>

The type of the elements being iterated over.

type IntoIter = Incoming<'a>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Incoming<'a>

Creates an iterator from a value. Read more