Struct fd_queue::mio::UnixListener
source · [−]pub struct UnixListener { /* private fields */ }
Expand description
A non-blocking Unix domain socket server with support for passing RawFd
.
Implementations
sourceimpl UnixListener
impl UnixListener
sourcepub fn bind(path: impl AsRef<Path>) -> Result<UnixListener>
pub fn bind(path: impl AsRef<Path>) -> Result<UnixListener>
Creates a new UnixListener
bound to the specific path.
The listener will be set to non-blocking mode.
sourcepub fn accept(&self) -> Result<(UnixStream, SocketAddr)>
pub fn accept(&self) -> Result<(UnixStream, SocketAddr)>
Accepts a new incoming connection to this listener.
The returned stream will be set to non-blocking mode.
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address for this listener.
sourcepub fn take_error(&self) -> Result<Option<Error>>
pub fn take_error(&self) -> Result<Option<Error>>
Returns the value of the SO_ERROR
option.
Trait Implementations
sourceimpl AsRawFd for UnixListener
impl AsRawFd for UnixListener
sourceimpl Debug for UnixListener
impl Debug for UnixListener
sourceimpl Evented for UnixListener
impl Evented for UnixListener
sourcefn register(
&self,
registry: &Poll,
token: Token,
interests: Ready,
opts: PollOpt
) -> Result<()>
fn register(
&self,
registry: &Poll,
token: Token,
interests: Ready,
opts: PollOpt
) -> Result<()>
Register self
with the given Poll
instance. Read more
sourceimpl FromRawFd for UnixListener
impl FromRawFd for UnixListener
Create a UnixListener
from a RawFd
.
This does not change the RawFd
into non-blocking mode. It assumes that any such
required change has already been done.
sourceunsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of Self
from the given raw file
descriptor. Read more
sourceimpl IntoRawFd for UnixListener
impl IntoRawFd for UnixListener
sourcefn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
sourceimpl TryFrom<UnixListener> for UnixListener
impl TryFrom<UnixListener> for UnixListener
Auto Trait Implementations
impl RefUnwindSafe for UnixListener
impl Send for UnixListener
impl Sync for UnixListener
impl Unpin for UnixListener
impl UnwindSafe for UnixListener
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more