Struct StartHandshake
#[non_exhaustive]pub struct StartHandshake<IO> {
pub accepted: Accepted,
pub io: IO,
}rustls only.Expand description
An incoming connection received through LazyConfigAcceptor.
This contains the generic IO asynchronous transport,
ClientHello data,
and all the state required to continue the TLS handshake (e.g. via
StartHandshake::into_stream).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.accepted: Accepted§io: IOImplementations§
§impl<IO> StartHandshake<IO>where
IO: AsyncRead + AsyncWrite + Unpin,
impl<IO> StartHandshake<IO>where
IO: AsyncRead + AsyncWrite + Unpin,
pub fn from_parts(accepted: Accepted, transport: IO) -> StartHandshake<IO>
pub fn from_parts(accepted: Accepted, transport: IO) -> StartHandshake<IO>
Create a new object from an IO transport and prior TLS metadata.
pub fn client_hello(&self) -> ClientHello<'_>
pub fn into_stream(self, config: Arc<ServerConfig>) -> Accept<IO> ⓘ
pub fn into_stream(self, config: Arc<ServerConfig>) -> Accept<IO> ⓘ
Returns a future that performs the rest of the TLS handshake using config.
You likely want to wrap this in a timeout to bound the handshake time. Ideally
with tokio::time::timeout_at, reusing the deadline that also bounded
awaiting the LazyConfigAcceptor so both halves of the handshake share
one budget. See LazyConfigAcceptor::new().
pub fn into_stream_with<F>(self, config: Arc<ServerConfig>, f: F) -> Accept<IO> ⓘwhere
F: FnOnce(&mut ServerConnection),
pub fn into_stream_with<F>(self, config: Arc<ServerConfig>, f: F) -> Accept<IO> ⓘwhere
F: FnOnce(&mut ServerConnection),
Similar to Self::into_stream(), but calls f before performing the handshake.
As with Self::into_stream() you likely want to wrap this in a timeout to
bound the handshake time.
The f handler is given a mutable reference to a ServerConnection that can be
used to configure the connection before the handshake.
Trait Implementations§
Auto Trait Implementations§
impl<IO> !RefUnwindSafe for StartHandshake<IO>
impl<IO> !UnwindSafe for StartHandshake<IO>
impl<IO> Freeze for StartHandshake<IO>where
IO: Freeze,
impl<IO> Send for StartHandshake<IO>where
IO: Send,
impl<IO> Sync for StartHandshake<IO>where
IO: Sync,
impl<IO> Unpin for StartHandshake<IO>where
IO: Unpin,
impl<IO> UnsafeUnpin for StartHandshake<IO>where
IO: UnsafeUnpin,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more