pub struct SessionCache { /* private fields */ }Expand description
TLS session ticket cache.
Stores session tickets per host to enable session resumption. Session tickets are provided by the server during TLS handshake and can be reused for subsequent connections.
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 max age.
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>, )
Store a session ticket for a host.
Sourcepub fn get_ticket(&self, host: &str) -> Option<Vec<u8>>
pub fn get_ticket(&self, host: &str) -> Option<Vec<u8>>
Get a session ticket for a host (if valid and not expired).
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
Remove expired tickets.
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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