pub struct SessionCache { /* private fields */ }Expand description
Host-keyed TLS session ticket cache shared across connector clones.
Implementations§
Source§impl SessionCache
impl SessionCache
Sourcepub fn with_max_age(max_age: Duration) -> Self
pub fn with_max_age(max_age: Duration) -> Self
Create a session cache with custom default max age.
Sourcepub fn store_session(
&self,
key: SessionCacheKey,
der: Vec<u8>,
early_data_capable: bool,
max_age: Option<Duration>,
)
pub fn store_session( &self, key: SessionCacheKey, der: Vec<u8>, early_data_capable: bool, max_age: Option<Duration>, )
Store a serialized TLS session for later resumption.
Sourcepub fn store_ticket(
&self,
host: &str,
ticket_data: Vec<u8>,
max_age: Option<Duration>,
)
pub fn store_ticket( &self, host: &str, ticket_data: Vec<u8>, max_age: Option<Duration>, )
Legacy host-only store API retained for compatibility.
Sourcepub fn get_session(&self, key: &SessionCacheKey) -> Option<SslSession>
pub fn get_session(&self, key: &SessionCacheKey) -> Option<SslSession>
Load a cached session if still valid.
Sourcepub async fn wait_for_session(
&self,
key: &SessionCacheKey,
timeout: Duration,
) -> bool
pub async fn wait_for_session( &self, key: &SessionCacheKey, timeout: Duration, ) -> bool
Wait until a session for key is stored or timeout elapses.
Sourcepub fn supports_zero_rtt(&self, key: &SessionCacheKey) -> bool
pub fn supports_zero_rtt(&self, key: &SessionCacheKey) -> bool
Whether a cached session advertises TLS 1.3 early-data support.
Sourcepub fn get_ticket(&self, host: &str) -> Option<Vec<u8>>
pub fn get_ticket(&self, host: &str) -> Option<Vec<u8>>
Legacy host-only lookup API retained for compatibility.
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
Remove expired sessions.
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 (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 SessionCache
impl Debug for SessionCache
Auto Trait Implementations§
impl Freeze for SessionCache
impl RefUnwindSafe for SessionCache
impl Send for SessionCache
impl Sync for SessionCache
impl Unpin for SessionCache
impl UnsafeUnpin 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