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).
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).
Sourcepub fn group(self, gid: u32) -> LocalOptions
pub fn group(self, gid: u32) -> LocalOptions
The socket file’s group; the mode is unchanged.
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).
Trait Implementations§
Source§impl Clone for LocalOptions
impl Clone for LocalOptions
Source§impl Debug for LocalOptions
impl Debug for LocalOptions
Source§impl Default for LocalOptions
impl Default for LocalOptions
Source§fn default() -> LocalOptions
fn default() -> LocalOptions
Returns the “default value” for a type. Read more
impl Eq for LocalOptions
Source§impl PartialEq for LocalOptions
impl PartialEq for LocalOptions
impl StructuralPartialEq for LocalOptions
Auto Trait Implementations§
impl Freeze for LocalOptions
impl RefUnwindSafe for LocalOptions
impl Send for LocalOptions
impl Sync for LocalOptions
impl Unpin for LocalOptions
impl UnsafeUnpin for LocalOptions
impl UnwindSafe for LocalOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more