pub struct UnixListener { /* private fields */ }
Expand description
UnixListener
Implementations§
Source§impl UnixListener
impl UnixListener
Sourcepub fn bind_with_config<P: AsRef<Path>>(
path: P,
config: &ListenerOpts,
) -> Result<UnixListener>
pub fn bind_with_config<P: AsRef<Path>>( path: P, config: &ListenerOpts, ) -> Result<UnixListener>
Creates a new UnixListener
bound to the specified socket with custom
config.
Sourcepub fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>
pub fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>
Creates a new UnixListener
bound to the specified socket with default
config.
Sourcepub async fn accept(&self) -> Result<(UnixStream, SocketAddr)>
pub async fn accept(&self) -> Result<(UnixStream, SocketAddr)>
Accept
Sourcepub async fn cancelable_accept(
&self,
c: CancelHandle,
) -> Result<(UnixStream, SocketAddr)>
pub async fn cancelable_accept( &self, c: CancelHandle, ) -> Result<(UnixStream, SocketAddr)>
Cancelable accept
Sourcepub async fn readable(&self, relaxed: bool) -> Result<()>
pub async fn readable(&self, relaxed: bool) -> Result<()>
Wait for read readiness. Note: Do not use it before every io. It is different from other runtimes!
Everytime call to this method may pay a syscall cost. In uring impl, it will push a PollAdd op; in epoll impl, it will use use inner readiness state; if !relaxed, it will call syscall poll after that.
If relaxed, on legacy driver it may return false positive result. If you want to do io by your own, you must maintain io readiness and wait for io ready with relaxed=false.
Sourcepub fn from_std(sys_listener: UnixListener) -> Result<Self>
pub fn from_std(sys_listener: UnixListener) -> Result<Self>
Creates new UnixListener
from a std::os::unix::net::UnixListener
.
Trait Implementations§
Source§impl AsRawFd for UnixListener
impl AsRawFd for UnixListener
Source§impl Debug for UnixListener
impl Debug for UnixListener
Source§impl Drop for UnixListener
impl Drop for UnixListener
Source§impl IntoRawFd for UnixListener
impl IntoRawFd for UnixListener
Source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Source§impl Stream for UnixListener
impl Stream for UnixListener
Source§type Item = Result<(UnixStream, SocketAddr), Error>
type Item = Result<(UnixStream, SocketAddr), Error>
Values yielded by the stream.
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