pub struct NativeH3SessionCache { /* private fields */ }Expand description
Thread-safe in-memory store of native H3 TLS session tickets.
Implementations§
Source§impl NativeH3SessionCache
impl NativeH3SessionCache
pub fn new() -> Self
pub fn with_capacity(max_entries: usize, default_lifetime: Duration) -> Self
Sourcepub fn insert(
&self,
key: NativeH3SessionCacheKey,
der: impl Into<Bytes>,
max_early_data: u32,
lifetime: Option<Duration>,
)
pub fn insert( &self, key: NativeH3SessionCacheKey, der: impl Into<Bytes>, max_early_data: u32, lifetime: Option<Duration>, )
Insert (or overwrite) a session ticket. lifetime of None falls
back to the cache-level default. The provided max_early_data
must come from the captured SSL_SESSION (e.g. via
SslSessionRef::max_early_data or the legacy
SSL_SESSION_get_max_early_data FFI). Pass 0 to record a
ticket that the server did not authorize for 0-RTT.
Sourcepub fn get(&self, key: &NativeH3SessionCacheKey) -> Option<NativeH3SessionEntry>
pub fn get(&self, key: &NativeH3SessionCacheKey) -> Option<NativeH3SessionEntry>
Look up a session ticket. Expired tickets are removed from the cache as a side effect so subsequent calls do not return them.
Sourcepub fn evict(&self, key: &NativeH3SessionCacheKey)
pub fn evict(&self, key: &NativeH3SessionCacheKey)
Remove a single entry without consulting it.
Sourcepub fn purge_expired(&self)
pub fn purge_expired(&self)
Drop all expired entries.
Sourcepub fn clear(&self)
pub fn clear(&self)
Drop every entry (e.g. when a TLS configuration change invalidates the cache).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for NativeH3SessionCache
impl Clone for NativeH3SessionCache
Source§fn clone(&self) -> NativeH3SessionCache
fn clone(&self) -> NativeH3SessionCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NativeH3SessionCache
impl Debug for NativeH3SessionCache
Auto Trait Implementations§
impl Freeze for NativeH3SessionCache
impl RefUnwindSafe for NativeH3SessionCache
impl Send for NativeH3SessionCache
impl Sync for NativeH3SessionCache
impl Unpin for NativeH3SessionCache
impl UnsafeUnpin for NativeH3SessionCache
impl UnwindSafe for NativeH3SessionCache
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