Struct TlsConnectionReuse
pub struct TlsConnectionReuse<P> { /* private fields */ }boring only.Expand description
Reuse rules published by the connector that performed a TLS handshake.
Capture request overrides before applying connector defaults, and publish only after a successful handshake. Pools derive the next request’s key from its extensions; callers need not configure the provider on the pool. Connector defaults, including credentials and hooks, remain fixed for the lifetime of its pool. Custom components supply stable value or instance identities.
Implementations§
§impl<P> TlsConnectionReuse<P>where
P: TlsClientConfigProvider + 'static,
impl<P> TlsConnectionReuse<P>where
P: TlsClientConfigProvider + 'static,
pub fn new(provider: P, request: &Extensions) -> TlsConnectionReuse<P>
pub fn new(provider: P, request: &Extensions) -> TlsConnectionReuse<P>
Capture request overrides relative to this connector’s fixed defaults.
pub fn policy_scope(&self) -> ConnectionPolicyScope
pub fn policy_scope(&self) -> ConnectionPolicyScope
Classify the original caller policy, including validated derived settings. Tunnel policies do not describe the origin and remain unclassified here.
pub fn for_derived_settings(
self,
request: &Extensions,
) -> Option<TlsDerivedPolicy>
pub fn for_derived_settings( self, request: &Extensions, ) -> Option<TlsDerivedPolicy>
Keep the caller’s reuse identity when a layer derives TLS settings on a pool miss. Call this after installing those settings, then insert the returned extension in the same request.
The scope is bound to this provider and the actual derived settings. Later changes invalidate it. It retains only policy keys, not settings, sessions or the provider. Opaque derived settings and tunnel policies cannot be scoped; their existing reuse behavior remains authoritative.
This does not establish compatibility between derived configurations.
The deriving layer must also partition its configurations or publish its
own ConnectionReusePolicy, while retaining inner restrictions.
pub fn tunnel(provider: P, request: &Extensions) -> TlsConnectionReuse<P>
pub fn tunnel(provider: P, request: &Extensions) -> TlsConnectionReuse<P>
Capture fixed proxy TLS policy, independently of origin TLS overrides.
The pool’s route key identifies the proxy. Caller-supplied tunnel settings must match on later requests; route-generated settings remain fixed for that route and are distinct from the caller’s overrides.
pub fn publish(self, connection: &Extensions)
pub fn publish(self, connection: &Extensions)
Publish this handshake’s rules while retaining restrictions from inner layers.
Trait Implementations§
§impl<P> ConnectionReusePolicy for TlsConnectionReuse<P>where
P: TlsClientConfigProvider + 'static,
impl<P> ConnectionReusePolicy for TlsConnectionReuse<P>where
P: TlsClientConfigProvider + 'static,
§fn classifier(&self) -> ReuseKey
fn classifier(&self) -> ReuseKey
Self::request_key: policies with equal classifiers must
derive equal keys for every request.§fn connection_key(&self) -> Option<ReuseKey>
fn connection_key(&self) -> Option<ReuseKey>
None if
the connection must not be retained after its establishing request.§fn request_key(&self, input: &Extensions) -> Option<ReuseKey>
fn request_key(&self, input: &Extensions) -> Option<ReuseKey>
input, or None if no connection
of this classifier may serve it.Auto Trait Implementations§
impl<P> !RefUnwindSafe for TlsConnectionReuse<P>
impl<P> !UnwindSafe for TlsConnectionReuse<P>
impl<P> Freeze for TlsConnectionReuse<P>where
P: Freeze,
impl<P> Send for TlsConnectionReuse<P>where
P: Send,
impl<P> Sync for TlsConnectionReuse<P>where
P: Sync,
impl<P> Unpin for TlsConnectionReuse<P>where
P: Unpin,
impl<P> UnsafeUnpin for TlsConnectionReuse<P>where
P: 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