pub struct UnixListener(/* private fields */);
Implementations§
Source§impl UnixListener
impl UnixListener
Sourcepub fn bind(path: &UnixStr) -> Result<Self>
pub fn bind(path: &UnixStr) -> Result<Self>
Creates and binds a non-blocking UnixListener
at the specified path
Use the blocking
variable to set as blocking or non-blocking
§Errors
Various OS errors relating to permissions, and missing paths
Sourcepub fn accept(&mut self) -> Result<UnixStream>
pub fn accept(&mut self) -> Result<UnixStream>
Accepts a new connection, UnixListener
, blocking until it arrives
§Errors
Various OS errors relating to socket communication
Sourcepub fn accept_with_timeout(&mut self, timeout: Duration) -> Result<UnixStream>
pub fn accept_with_timeout(&mut self, timeout: Duration) -> Result<UnixStream>
Accepts a new connection, blocking until the specified timeout
§Errors
Various OS errors relating to socket communication
Sourcepub fn try_accept(&mut self) -> Result<Option<UnixStream>>
pub fn try_accept(&mut self) -> Result<Option<UnixStream>>
Attempts to accept a new connection, returns Some
if one is immediately available, None
otherwise.
§Errors
Various OS errors relating to socket communication
Auto Trait Implementations§
impl Freeze for UnixListener
impl RefUnwindSafe for UnixListener
impl Send for UnixListener
impl Sync for UnixListener
impl Unpin for UnixListener
impl UnwindSafe for UnixListener
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