Struct photonio_uring::net::TcpListener
source · pub struct TcpListener(_);
Expand description
A TCP socket listening for connections.
This type is an async version of std::net::TcpListener
.
Implementations
sourceimpl TcpListener
impl TcpListener
sourcepub async fn bind<A: ToSocketAddrs>(addrs: A) -> Result<Self>
pub async fn bind<A: ToSocketAddrs>(addrs: A) -> Result<Self>
Creates a listener bound to the specified address.
See also std::net::TcpListener::bind
.
sourcepub async fn accept(&self) -> Result<(TcpStream, SocketAddr)>
pub async fn accept(&self) -> Result<(TcpStream, SocketAddr)>
Accepts a new connection from this listener.
See also std::net::TcpListener::accept
.
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address of this listener.
See also std::net::TcpListener::local_addr
.
sourcepub fn ttl(&self) -> Result<u32>
pub fn ttl(&self) -> Result<u32>
Gets the value of the IP_TTL
option on this socket.
See also std::net::TcpListener::ttl
.
Trait Implementations
sourceimpl AsFd for TcpListener
impl AsFd for TcpListener
sourcefn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
sourceimpl AsRawFd for TcpListener
impl AsRawFd for TcpListener
sourceimpl Debug for TcpListener
impl Debug for TcpListener
sourceimpl FromRawFd for TcpListener
impl FromRawFd for TcpListener
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 moresourceimpl IntoRawFd for TcpListener
impl IntoRawFd for TcpListener
sourcefn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations
impl RefUnwindSafe for TcpListener
impl Send for TcpListener
impl Sync for TcpListener
impl Unpin for TcpListener
impl UnwindSafe for TcpListener
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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