pub struct ReplayPolicy {
pub on_pure: ReplayMode,
pub on_idempotent: ReplayMode,
pub on_irreversible: ReplayMode,
pub on_network_only: ReplayMode,
}Expand description
User-supplied policy mapping side-effect classes → replay modes.
Defaults match agent_docs/effects-layer.md:
| class | default mode |
|---|---|
Pure | InjectCachedResult |
Idempotent | InjectCachedResult |
Irreversible | SurfaceAsFact |
NetworkOnly | InjectCachedResult |
Fields§
§on_pure: ReplayMode§on_idempotent: ReplayMode§on_irreversible: ReplayMode§on_network_only: ReplayModeImplementations§
Source§impl ReplayPolicy
impl ReplayPolicy
Sourcepub const fn strict() -> Self
pub const fn strict() -> Self
Strict: SurfaceAsFact for everything except Pure. Use when restoring
snapshots from untrusted sources.
Sourcepub const fn aggressive() -> Self
pub const fn aggressive() -> Self
Aggressive: re-issue idempotent tools with same key, re-issue
irreversible tools with NEW keys (charges card again, etc.). Only
for explicit operator opt-in via pf merge --replay-effects=all.
Sourcepub const fn decide(&self, entry: &LedgerEntry) -> ReplayDecision
pub const fn decide(&self, entry: &LedgerEntry) -> ReplayDecision
Decide what to do with a single entry.
Trait Implementations§
Source§impl Clone for ReplayPolicy
impl Clone for ReplayPolicy
Source§fn clone(&self) -> ReplayPolicy
fn clone(&self) -> ReplayPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReplayPolicy
impl Debug for ReplayPolicy
Source§impl Default for ReplayPolicy
impl Default for ReplayPolicy
impl Copy for ReplayPolicy
Auto Trait Implementations§
impl Freeze for ReplayPolicy
impl RefUnwindSafe for ReplayPolicy
impl Send for ReplayPolicy
impl Sync for ReplayPolicy
impl Unpin for ReplayPolicy
impl UnsafeUnpin for ReplayPolicy
impl UnwindSafe for ReplayPolicy
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