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§
source§impl 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§
source§impl Acceptor for TcpAcceptor
impl Acceptor for TcpAcceptor
Auto Trait Implementations§
impl !Freeze for TcpAcceptor
impl RefUnwindSafe for TcpAcceptor
impl Send for TcpAcceptor
impl Sync for TcpAcceptor
impl Unpin for TcpAcceptor
impl UnwindSafe for TcpAcceptor
Blanket Implementations§
source§impl<T> AcceptorExt for Twhere
T: Acceptor,
impl<T> AcceptorExt for Twhere
T: Acceptor,
source§fn 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.
source§fn 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
.source§fn rustls<S>(self, config_stream: S) -> RustlsAcceptor<Self, S>
fn rustls<S>(self, config_stream: S) -> RustlsAcceptor<Self, S>
Available on crate features
server
and rustls
only.Consume this acceptor and return a new TLS acceptor with
rustls
.source§fn native_tls<S>(self, config_stream: S) -> NativeTlsAcceptor<Self, S>
fn native_tls<S>(self, config_stream: S) -> NativeTlsAcceptor<Self, S>
Available on crate features
server
and native-tls
only.Consume this acceptor and return a new TLS acceptor with
native-tls
.source§fn openssl_tls<S>(self, config_stream: S) -> OpensslTlsAcceptor<Self, S>
fn openssl_tls<S>(self, config_stream: S) -> OpensslTlsAcceptor<Self, S>
Available on crate features
server
and openssl-tls
only.Consume this acceptor and return a new TLS acceptor with
openssl-tls
.source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> TowerCompatExt for T
impl<T> TowerCompatExt for T
source§fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
Available on crate feature
tower-compat
only.Converts a tower service to a poem endpoint.