Struct TlsClientSessionCache
pub struct TlsClientSessionCache<K = TlsClientSessionKey, V = TlsClientSession> { /* private fields */ }Available on crate feature
boring only.Expand description
Bounded in-memory sessions: the newest few per key, evicting the least recently stored key once full.
The default TlsClientSessionStore, also usable for other entries.
Implementations§
§impl<K, V> TlsClientSessionCache<K, V>
impl<K, V> TlsClientSessionCache<K, V>
pub fn new(
max_keys: NonZero<usize>,
per_key: NonZero<usize>,
) -> TlsClientSessionCache<K, V>
pub fn new( max_keys: NonZero<usize>, per_key: NonZero<usize>, ) -> TlsClientSessionCache<K, V>
Keep at most per_key values for each of at most max_keys keys.
pub fn insert(&self, key: K, value: V)
pub fn insert(&self, key: K, value: V)
Store value as the newest one for key.
pub fn most_recent<'k>(
&self,
keys: impl IntoIterator<Item = &'k K>,
) -> Option<&'k K>where
K: 'k,
pub fn most_recent<'k>(
&self,
keys: impl IntoIterator<Item = &'k K>,
) -> Option<&'k K>where
K: 'k,
Which of keys holds values and was stored to most recently.
Trait Implementations§
§impl<K, V> Debug for TlsClientSessionCache<K, V>
impl<K, V> Debug for TlsClientSessionCache<K, V>
§impl Default for TlsClientSessionCache
impl Default for TlsClientSessionCache
§fn default() -> TlsClientSessionCache
fn default() -> TlsClientSessionCache
Two sessions for each of 256 server identities and configurations.
§impl TlsClientSessionStore for TlsClientSessionCache
impl TlsClientSessionStore for TlsClientSessionCache
§fn put(&self, session: TlsClientSession)
fn put(&self, session: TlsClientSession)
Keep
session under its TlsClientSession::key.§fn take(&self, key: &TlsClientSessionKey) -> Option<TlsClientSession>
fn take(&self, key: &TlsClientSessionKey) -> Option<TlsClientSession>
Remove and return the next session to offer for
key.Auto Trait Implementations§
impl<K = TlsClientSessionKey, V = TlsClientSession> !Freeze for TlsClientSessionCache<K, V>
impl<K = TlsClientSessionKey, V = TlsClientSession> !RefUnwindSafe for TlsClientSessionCache<K, V>
impl<K, V> Send for TlsClientSessionCache<K, V>where
Mutex<RawMutex, Entries<K, V>>: Send,
impl<K, V> Sync for TlsClientSessionCache<K, V>where
Mutex<RawMutex, Entries<K, V>>: Sync,
impl<K, V> Unpin for TlsClientSessionCache<K, V>where
Mutex<RawMutex, Entries<K, V>>: Unpin,
impl<K, V> UnsafeUnpin for TlsClientSessionCache<K, V>where
Mutex<RawMutex, Entries<K, V>>: UnsafeUnpin,
impl<K, V> UnwindSafe for TlsClientSessionCache<K, V>where
Mutex<RawMutex, Entries<K, V>>: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more