Struct ClientConfigCache
pub struct ClientConfigCache { /* private fields */ }quic and std only.Expand description
Reuse native TLS configuration and session state when opening QUIC connections.
A cache belongs to one provider and fixed QUIC TLS options. Clones share its state: one protected default entry and up to 64 recently used override entries. Shared custom components retain session state. Request policies explicitly marked non-reusable bypass caching. Failed builds are never retained. Providers must identify changed defaults, or keep them fixed for the cache’s lifetime.
This does not pool connections or apply request overrides. Supply the final
TLS configuration to Self::client_config, then customize transport settings
on the returned ClientConfig as needed; each result is an independent clone
sharing the native TLS configuration and its session state.
Implementations§
§impl ClientConfigCache
impl ClientConfigCache
pub fn new(
provider: Arc<dyn QuicClientConfigProvider>,
options: TlsOptions,
) -> ClientConfigCache
pub fn new( provider: Arc<dyn QuicClientConfigProvider>, options: TlsOptions, ) -> ClientConfigCache
Bind cached configurations to one provider and its QUIC TLS options.
pub fn provider(&self) -> &Arc<dyn QuicClientConfigProvider> ⓘ
pub fn provider(&self) -> &Arc<dyn QuicClientConfigProvider> ⓘ
The provider used both to classify policies and to construct configurations.
pub fn client_config(
&self,
config: &TlsClientConfig,
overrides: &Extensions,
) -> Result<ClientConfig, TlsConfigError>
pub fn client_config( &self, config: &TlsClientConfig, overrides: &Extensions, ) -> Result<ClientConfig, TlsConfigError>
Build or reuse the final TLS configuration, classified by this cache’s provider.
overrides contains request settings before connector defaults are applied.
It selects the protected default slot or bounded override cache and makes
explicitly non-reusable request policies bypass caching even if masked later.
The key combines the request identity with the effective configuration
identity, including final application requirements such as ALPN. Defaults
are checked on each call; any defaults omitted from the identity must remain
fixed. Provider classification must cover every relevant setting.
Provider code runs outside the cache lock. Concurrent equivalent builds may do redundant work, but converge on the same retained configuration.
Trait Implementations§
§impl Clone for ClientConfigCache
impl Clone for ClientConfigCache
§fn clone(&self) -> ClientConfigCache
fn clone(&self) -> ClientConfigCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ClientConfigCache
impl !UnwindSafe for ClientConfigCache
impl Freeze for ClientConfigCache
impl Send for ClientConfigCache
impl Sync for ClientConfigCache
impl Unpin for ClientConfigCache
impl UnsafeUnpin for ClientConfigCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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