Struct UnixListener
pub struct UnixListener { /* private fields */ }
A non-blocking Unix domain socket server.
Implementations
impl UnixListener
fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>Creates a new
UnixListenerbound to the specified socketpath.fn bind_addr(address: &SocketAddr) -> Result<UnixListener>Creates a new
UnixListenerbound to the specified socketaddress.fn from_std(listener: UnixListener) -> UnixListenerCreates a new
UnixListenerfrom a standardnet::UnixListener.This function is intended to be used to wrap a Unix listener from the standard library in the Mio equivalent. The conversion assumes nothing about the underlying listener; it is left up to the user to set it in non-blocking mode.
fn accept(&self) -> Result<(UnixStream, SocketAddr)>Accepts a new incoming connection to this listener.
The call is responsible for ensuring that the listening socket is in non-blocking mode.
fn local_addr(&self) -> Result<SocketAddr>Returns the local socket address of this listener.
fn take_error(&self) -> Result<Option<Error>>Returns the value of the
SO_ERRORoption.
Trait Implementations
impl AsFd for UnixListener
fn as_fd(&self) -> BorrowedFd<'_>
impl AsRawFd for UnixListener
fn as_raw_fd(&self) -> RawFd
impl Debug for UnixListener
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl From<OwnedFd> for UnixListener
fn from(fd: OwnedFd) -> Self
impl FromRawFd for UnixListener
unsafe fn from_raw_fd(fd: RawFd) -> UnixListenerConverts a
RawFdto aUnixListener.Notes
The caller is responsible for ensuring that the socket is in non-blocking mode.
impl IntoRawFd for UnixListener
fn into_raw_fd(self) -> RawFd
impl Source for UnixListener
fn register(&mut self, registry: &Registry, token: Token, interests: Interest) -> Result<()>fn reregister(&mut self, registry: &Registry, token: Token, interests: Interest) -> Result<()>fn deregister(&mut self, registry: &Registry) -> Result<()>
Auto Trait Implementations
impl !Freeze for UnixListener
impl RefUnwindSafe for UnixListener
impl Send for UnixListener
impl Sync for UnixListener
impl Unpin for UnixListener
impl UnsafeUnpin for UnixListener
impl UnwindSafe for UnixListener
Blanket Implementations
impl<T> Any for UnixListener
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for UnixListener
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for UnixListener
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for UnixListener
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for UnixListener
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for UnixListener
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for UnixListener
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>