pub struct LocalOptions { /* private fields */ }Expand description
Options for a Unix socket listener. The defaults: mode 0600 (only the
owner may connect, decision D-024), stale socket files removed, backlog 1,024.
let options = net_io::LocalOptions::new().group_access(33).require_uid(1000);Implementations§
Source§impl LocalOptions
impl LocalOptions
Sourcepub fn new() -> LocalOptions
pub fn new() -> LocalOptions
Mode 0600, stale socket files removed, backlog 1,024.
Sourcepub fn mode(self, mode: u32) -> LocalOptions
pub fn mode(self, mode: u32) -> LocalOptions
The socket file’s permission bits (only the low 9 bits are used). They
are set before the socket listens, by the file’s name relative to its open
directory, or inside a private directory when other users can change the
socket’s directory (see UnixListener::bind_with); a directory writable by
every user without the sticky bit is refused.
Sourcepub fn owner(self, uid: u32) -> LocalOptions
pub fn owner(self, uid: u32) -> LocalOptions
The socket file’s owner (needs the privilege to change owners). Set as the mode is, after it, and never through a symbolic link.
Sourcepub fn group(self, gid: u32) -> LocalOptions
pub fn group(self, gid: u32) -> LocalOptions
The socket file’s group; the mode is unchanged. Set as the owner is.
Sourcepub fn group_access(self, gid: u32) -> LocalOptions
pub fn group_access(self, gid: u32) -> LocalOptions
The socket file’s group and mode 0660: members of gid may connect.
Sourcepub fn remove_stale(self, on: bool) -> LocalOptions
pub fn remove_stale(self, on: bool) -> LocalOptions
Whether a socket file nobody listens on is removed before binding (default on). A live listener’s file, or anything that is not a socket, is never removed.
Sourcepub fn require_uid(self, uid: u32) -> LocalOptions
pub fn require_uid(self, uid: u32) -> LocalOptions
Refuses peers whose user id is not uid, at accept, before any read.
Sourcepub fn backlog(self, backlog: u32) -> LocalOptions
pub fn backlog(self, backlog: u32) -> LocalOptions
The listen backlog (capped by the OS).