pub struct ReceiptStore { /* private fields */ }Expand description
In-memory + optional disk bag of receipts, keyed by group → instance → history.
Implementations§
Source§impl ReceiptStore
impl ReceiptStore
Sourcepub fn upsert(&self, receipt: WidgetRenderReceipt)
pub fn upsert(&self, receipt: WidgetRenderReceipt)
Append a receipt to the per-instance history ring.
Sourcepub fn list(&self, group: &str) -> Vec<WidgetRenderReceipt>
pub fn list(&self, group: &str) -> Vec<WidgetRenderReceipt>
Latest receipt per instance (newest first).
Sourcepub fn history(&self, group: &str) -> Vec<WidgetRenderReceipt>
pub fn history(&self, group: &str) -> Vec<WidgetRenderReceipt>
Full history for a group (oldest → newest), capped by ring.
Sourcepub fn live_instances(
&self,
group: &str,
widget_id: &str,
max_age_ms: u64,
) -> Vec<String>
pub fn live_instances( &self, group: &str, widget_id: &str, max_age_ms: u64, ) -> Vec<String>
Instance ids with a recent receipt for widget_id (age ≤ max_age_ms).
Sourcepub fn save_to_path(&self, path: &Path) -> Result<()>
pub fn save_to_path(&self, path: &Path) -> Result<()>
Persist all groups to JSON at path.
Sourcepub fn load_from_path(&self, path: &Path)
pub fn load_from_path(&self, path: &Path)
Load receipts from disk (best-effort; ignores corrupt files).
Trait Implementations§
Source§impl Default for ReceiptStore
impl Default for ReceiptStore
Source§fn default() -> ReceiptStore
fn default() -> ReceiptStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ReceiptStore
impl RefUnwindSafe for ReceiptStore
impl Send for ReceiptStore
impl Sync for ReceiptStore
impl Unpin for ReceiptStore
impl UnsafeUnpin for ReceiptStore
impl UnwindSafe for ReceiptStore
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