pub struct TlsAcceptor(/* private fields */);Available on crate feature
tls only.Expand description
A wrapper around a native_tls::TlsAcceptor or rustls::ServerConfig,
providing an async accept method.
Implementations§
Source§impl TlsAcceptor
impl TlsAcceptor
Sourcepub async fn accept<S>(&self, stream: S) -> Result<TlsStream<S>, Error>where
S: AsyncRead + AsyncWrite,
pub async fn accept<S>(&self, stream: S) -> Result<TlsStream<S>, Error>where
S: AsyncRead + AsyncWrite,
Accepts a new client connection with the provided stream.
This function will internally call TlsAcceptor::accept to connect
the stream and returns a future representing the resolution of the
connection operation. The returned future will resolve to either
TlsStream<S> or Error depending if it’s successful or not.
This is typically used after a new socket has been accepted from a
TcpListener. That socket is then passed to this function to perform
the server half of accepting a client connection.
Trait Implementations§
Source§impl Clone for TlsAcceptor
impl Clone for TlsAcceptor
Source§fn clone(&self) -> TlsAcceptor
fn clone(&self) -> TlsAcceptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<Arc<ServerConfig>> for TlsAcceptor
impl From<Arc<ServerConfig>> for TlsAcceptor
Source§fn from(value: Arc<ServerConfig>) -> TlsAcceptor
fn from(value: Arc<ServerConfig>) -> TlsAcceptor
Converts to this type from the input type.
Source§impl From<TlsAcceptor> for TlsAcceptor
impl From<TlsAcceptor> for TlsAcceptor
Source§fn from(value: TlsAcceptor) -> TlsAcceptor
fn from(value: TlsAcceptor) -> TlsAcceptor
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TlsAcceptor
impl !RefUnwindSafe for TlsAcceptor
impl Send for TlsAcceptor
impl Sync for TlsAcceptor
impl Unpin for TlsAcceptor
impl !UnwindSafe for TlsAcceptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more