Struct poem::listener::TcpAcceptor
source · pub struct TcpAcceptor { /* private fields */ }
Available on crate feature
server
only.Expand description
A acceptor that accepts TCP connections.
Implementations
sourceimpl TcpAcceptor
impl TcpAcceptor
sourcepub fn from_std(listener: TcpListener) -> Result<Self>
pub fn from_std(listener: TcpListener) -> Result<Self>
Creates new TcpAcceptor
from a std::net::TcpListener
.
sourcepub fn from_tokio(listener: TcpListener) -> Result<Self>
pub fn from_tokio(listener: TcpListener) -> Result<Self>
Creates new TcpAcceptor
from a tokio::net::TcpListener
.
Trait Implementations
sourceimpl Acceptor for TcpAcceptor
impl Acceptor for TcpAcceptor
sourcefn local_addr(&self) -> Vec<LocalAddr> ⓘ
fn local_addr(&self) -> Vec<LocalAddr> ⓘ
Returns the local address that this listener is bound to.
Auto Trait Implementations
impl RefUnwindSafe for TcpAcceptor
impl Send for TcpAcceptor
impl Sync for TcpAcceptor
impl Unpin for TcpAcceptor
impl UnwindSafe for TcpAcceptor
Blanket Implementations
sourceimpl<T> AcceptorExt for Twhere
T: Acceptor,
impl<T> AcceptorExt for Twhere
T: Acceptor,
sourcefn combine<T>(self, other: T) -> Combined<Self, T>where
Self: Sized,
fn combine<T>(self, other: T) -> Combined<Self, T>where
Self: Sized,
Available on crate feature
server
only.Combine two acceptors.
sourcefn boxed(self) -> BoxAcceptorwhere
Self: Sized + 'static,
fn boxed(self) -> BoxAcceptorwhere
Self: Sized + 'static,
Available on crate feature
server
only.Wrap the acceptor in a
Box
.sourcefn rustls<S>(self, config_stream: S) -> RustlsAcceptor<Self, S>where
Self: Sized,
S: Stream<Item = RustlsConfig> + Send + Unpin + 'static,
fn rustls<S>(self, config_stream: S) -> RustlsAcceptor<Self, S>where
Self: Sized,
S: Stream<Item = RustlsConfig> + Send + Unpin + 'static,
Available on crate features
server
and rustls
only.Consume this acceptor and return a new TLS acceptor with
rustls
.sourcefn native_tls<S>(self, config_stream: S) -> NativeTlsAcceptor<Self, S>where
Self: Sized,
S: Stream<Item = NativeTlsConfig> + Send + Unpin + 'static,
fn native_tls<S>(self, config_stream: S) -> NativeTlsAcceptor<Self, S>where
Self: Sized,
S: Stream<Item = NativeTlsConfig> + Send + Unpin + 'static,
Available on crate features
server
and native-tls
only.Consume this acceptor and return a new TLS acceptor with
native-tls
.sourcefn openssl_tls<S>(self, config_stream: S) -> OpensslTlsAcceptor<Self, S>where
Self: Sized,
S: Stream<Item = OpensslTlsConfig> + Send + Unpin + 'static,
fn openssl_tls<S>(self, config_stream: S) -> OpensslTlsAcceptor<Self, S>where
Self: Sized,
S: Stream<Item = OpensslTlsConfig> + Send + Unpin + 'static,
Available on crate features
server
and openssl-tls
only.Consume this acceptor and return a new TLS acceptor with
openssl-tls
.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