pub struct SupportedCache { /* private fields */ }Available on crate feature
server only.Expand description
An encapsulated TTL cache for the /supported endpoint response.
Clones share the same cache state via Arc, so cached responses are
visible across all clones (e.g. when the middleware clones the
facilitator per-request).
Implementations§
Source§impl SupportedCache
impl SupportedCache
Sourcepub async fn get(&self) -> Option<SupportedResponse>
pub async fn get(&self) -> Option<SupportedResponse>
Returns the cached response if valid, None otherwise.
Sourcepub async fn set(&self, response: SupportedResponse)
pub async fn set(&self, response: SupportedResponse)
Stores a response in the cache with the configured TTL.
Trait Implementations§
Source§impl Clone for SupportedCache
impl Clone for SupportedCache
Source§fn clone(&self) -> SupportedCache
fn clone(&self) -> SupportedCache
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 SupportedCache
impl !RefUnwindSafe for SupportedCache
impl Send for SupportedCache
impl Sync for SupportedCache
impl Unpin for SupportedCache
impl !UnwindSafe for SupportedCache
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