pub struct SessionCache { /* private fields */ }Expand description
Thread-safe in-memory TLS session cache
Stores session tickets for TLS 1.3 resumption. This enables clients to reconnect without performing full handshakes, reducing latency by 50-70%.
Implementations§
Source§impl SessionCache
impl SessionCache
Sourcepub async fn store<S: Into<String>>(&self, session_id: S, ticket: Vec<u8>)
pub async fn store<S: Into<String>>(&self, session_id: S, ticket: Vec<u8>)
Store a session ticket in the cache
This is typically called by the TLS layer after establishing a connection. Automatically manages eviction when cache is full.
§Arguments
session_id- Unique session identifierticket- Serialized TLS session ticket
Sourcepub async fn stats(&self) -> SessionCacheStats
pub async fn stats(&self) -> SessionCacheStats
Get current cache statistics
Trait Implementations§
Source§impl Clone for SessionCache
impl Clone for SessionCache
Source§fn clone(&self) -> SessionCache
fn clone(&self) -> SessionCache
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionCache
impl !RefUnwindSafe for SessionCache
impl Send for SessionCache
impl Sync for SessionCache
impl Unpin for SessionCache
impl !UnwindSafe for SessionCache
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