Struct salvo::prelude::TcpListener
source · pub struct TcpListener { /* private fields */ }
Expand description
TcpListener
Implementations§
source§impl TcpListener
impl TcpListener
sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Get the local address bound to this listener.
sourcepub fn bind(incoming: impl IntoAddrIncoming) -> TcpListener
pub fn bind(incoming: impl IntoAddrIncoming) -> TcpListener
Bind to socket address.
sourcepub fn try_bind(incoming: impl IntoAddrIncoming) -> Result<TcpListener, Error>
pub fn try_bind(incoming: impl IntoAddrIncoming) -> Result<TcpListener, Error>
Try to bind to socket address.
Trait Implementations§
source§impl Accept for TcpListener
impl Accept for TcpListener
source§fn poll_accept(
self: Pin<&mut TcpListener>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<TcpListener as Accept>::Conn, <TcpListener as Accept>::Error>>>
fn poll_accept(
self: Pin<&mut TcpListener>,
cx: &mut Context<'_>
) -> Poll<Option<Result<<TcpListener as Accept>::Conn, <TcpListener as Accept>::Error>>>
Poll to accept the next connection.
source§impl Listener for TcpListener
impl Listener for TcpListener
source§fn join<T>(self, other: T) -> JoinedListener<Self, T>where
Self: Sized,
fn join<T>(self, other: T) -> JoinedListener<Self, T>where
Self: Sized,
Join current Listener with the other.