pub struct NoCache;Expand description
A no-op cache that doesn’t store anything
This is useful when caching needs to be disabled, for testing, or for environments where caching is not desired.
§Example
use sigstore_cache::{NoCache, CacheAdapter, CacheKey};
use std::time::Duration;
let cache = NoCache;
// Set does nothing
cache.set(CacheKey::RekorPublicKey, b"data", Duration::from_secs(3600)).await?;
// Get always returns None
assert!(cache.get(CacheKey::RekorPublicKey).await?.is_none());Trait Implementations§
Source§impl CacheAdapter for NoCache
impl CacheAdapter for NoCache
impl Copy for NoCache
Auto Trait Implementations§
impl Freeze for NoCache
impl RefUnwindSafe for NoCache
impl Send for NoCache
impl Sync for NoCache
impl Unpin for NoCache
impl UnsafeUnpin for NoCache
impl UnwindSafe for NoCache
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