pub struct ProofIntentStore { /* private fields */ }Expand description
Append-only, dedup-by-intent_id, corruption-tolerant proof-intent store.
Implementations§
Source§impl ProofIntentStore
impl ProofIntentStore
pub fn with_path(path: impl Into<PathBuf>) -> Self
pub fn path(&self) -> &Path
Sourcepub fn put(&self, intent: &ProofIntent) -> Result<()>
pub fn put(&self, intent: &ProofIntent) -> Result<()>
Append an intent. Duplicate intent_ids are tolerated on write
(latest-wins is resolved on read), so put stays O(1) on the hot path.
Sourcepub fn all(&self) -> Vec<ProofIntent>
pub fn all(&self) -> Vec<ProofIntent>
All current intents, deduplicated by intent_id (latest write wins),
in first-seen order. Corrupt lines are skipped.
Sourcepub fn get(&self, intent_id: &str) -> Option<ProofIntent>
pub fn get(&self, intent_id: &str) -> Option<ProofIntent>
Fetch a single intent by id (latest wins).
Sourcepub fn by_reason(&self, reason: IncidentReasonCode) -> Vec<ProofIntent>
pub fn by_reason(&self, reason: IncidentReasonCode) -> Vec<ProofIntent>
Intents matching a denial reason.
Trait Implementations§
Source§impl Clone for ProofIntentStore
impl Clone for ProofIntentStore
Auto Trait Implementations§
impl Freeze for ProofIntentStore
impl RefUnwindSafe for ProofIntentStore
impl Send for ProofIntentStore
impl Sync for ProofIntentStore
impl Unpin for ProofIntentStore
impl UnsafeUnpin for ProofIntentStore
impl UnwindSafe for ProofIntentStore
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