pub struct InMemoryUcanRevocationStore { /* private fields */ }Expand description
Reference revocation store: an Arc<RwLock<HashSet<String>>> of
revoked CIDs. Suitable for tests and small in-process deployments.
Concurrency: every read takes a shared lock; revocations take an
exclusive lock and run in O(1) average. The whole structure clones
cheaply (Arc) so multiple subsystems (broker, dispatch, Tauri
command) can share one revocation surface.
Not persistent — restarting the host process empties the set. Adopters that need durable revocation (celia) back the trait with their own SQLite-or-similar store.
Implementations§
Source§impl InMemoryUcanRevocationStore
impl InMemoryUcanRevocationStore
pub fn new() -> Self
Sourcepub fn revoke(&self, ucan_cid: impl Into<String>)
pub fn revoke(&self, ucan_cid: impl Into<String>)
Mark a CID as revoked. Idempotent — revoking the same CID twice
is a no-op. Once revoked, Self::is_revoked returns true
for the lifetime of the store (no un-revoke API by design;
administrators issue a fresh UCAN instead).
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of revoked CIDs currently in the store. Mostly useful for test assertions + diagnostics; production code should not rely on this for policy.
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for InMemoryUcanRevocationStore
impl Clone for InMemoryUcanRevocationStore
Source§fn clone(&self) -> InMemoryUcanRevocationStore
fn clone(&self) -> InMemoryUcanRevocationStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InMemoryUcanRevocationStore
impl Debug for InMemoryUcanRevocationStore
Source§impl Default for InMemoryUcanRevocationStore
impl Default for InMemoryUcanRevocationStore
Source§fn default() -> InMemoryUcanRevocationStore
fn default() -> InMemoryUcanRevocationStore
Source§impl UcanRevocationStore for InMemoryUcanRevocationStore
impl UcanRevocationStore for InMemoryUcanRevocationStore
Source§fn is_revoked(&self, ucan_cid: &str) -> bool
fn is_revoked(&self, ucan_cid: &str) -> bool
true if the CID is in the revocation set.