pub struct ProofCache { /* private fields */ }Implementations§
Source§impl ProofCache
impl ProofCache
Sourcepub fn open(path: PathBuf, signer: &ProofSigner) -> Result<Self>
pub fn open(path: PathBuf, signer: &ProofSigner) -> Result<Self>
Open (and signature-verify) the cache at path. Missing files
are treated as empty caches.
Sourcepub fn insert(&self, proof: Proof) -> Result<()>
pub fn insert(&self, proof: Proof) -> Result<()>
Insert a (presumably just-minted, already-signed) proof and persist the cache. Replaces any existing proof for the same (provider, subject, scope) tuple – one slot per identity per scope, so re-verifying simply refreshes the timestamp.
Sourcepub fn find_satisfying(&self, req: &Requirement, now: u64) -> Option<Proof>
pub fn find_satisfying(&self, req: &Requirement, now: u64) -> Option<Proof>
Find any proof that satisfies req at now. Returns the proof
with the latest verified_at if multiple match (most-recently-
verified wins).
Sourcepub fn count_valid(&self, now: u64) -> usize
pub fn count_valid(&self, now: u64) -> usize
How many proofs are currently cached AND not expired at now.
Auto Trait Implementations§
impl !Freeze for ProofCache
impl RefUnwindSafe for ProofCache
impl Send for ProofCache
impl Sync for ProofCache
impl Unpin for ProofCache
impl UnsafeUnpin for ProofCache
impl UnwindSafe for ProofCache
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