pub struct TicketCache { /* private fields */ }Expand description
In-memory ticket cache. Backed by an on-disk JSON blob; load and save are explicit so the rustls wiring layer can drive them at install start / install end.
Implementations§
Source§impl TicketCache
impl TicketCache
Sourcepub fn open(path: impl Into<PathBuf>) -> Self
pub fn open(path: impl Into<PathBuf>) -> Self
Open the cache at the canonical path under
XDG_CACHE_HOME/aube/tls-tickets.json. Caller responsible for
XDG_CACHE_HOME resolution; pass an explicit path here.
Sourcepub fn get(&self, host: &str, port: u16) -> Vec<TicketEntry>
pub fn get(&self, host: &str, port: u16) -> Vec<TicketEntry>
Look up cached tickets for (host, port). Stale entries beyond
MAX_AGE are filtered transparently; callers receive only
fresh tickets.
Sourcepub fn put(&self, host: &str, port: u16, entry: TicketEntry)
pub fn put(&self, host: &str, port: u16, entry: TicketEntry)
Store a fresh ticket for (host, port). Multiple tickets per
origin are kept (rustls servers typically issue 2 per
handshake); prune_max_per_host caps the queue.
Sourcepub fn invalidate(&self, host: &str, port: u16)
pub fn invalidate(&self, host: &str, port: u16)
Evict every ticket for (host, port). Called when a TLS
handshake observes a cert whose SPKI fingerprint does not
match the cached entry — the cert rotated, so the ticket is
stale.
Sourcepub fn save(&self) -> Result<()>
pub fn save(&self) -> Result<()>
Persist the in-memory cache to disk. Atomic via
aube_util::fs_atomic::atomic_write.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TicketCache
impl RefUnwindSafe for TicketCache
impl Send for TicketCache
impl Sync for TicketCache
impl Unpin for TicketCache
impl UnsafeUnpin for TicketCache
impl UnwindSafe for TicketCache
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
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>
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>
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