pub struct NewEffect {
pub id: EffectId,
pub key: EffectKey,
pub kind: EffectKind,
pub execution_contract: Option<ExecutionContract>,
pub input_schema_version: u32,
pub input: Option<Value>,
pub input_fingerprint: Option<String>,
pub created_by: Option<String>,
pub now: SystemTime,
}Expand description
A new effect to record.
Fields§
§id: EffectIdThe id the record gets if it is inserted.
key: EffectKeyThe logical identity; unique per store.
kind: EffectKindThe effect’s kind.
execution_contract: Option<ExecutionContract>Immutable safety assumptions. None is a legacy, unattested record.
input_schema_version: u32Schema of the stored input. Legacy payloads use version 1.
input: Option<Value>The input, already redacted for storage.
input_fingerprint: Option<String>A stable hash of the unredacted input, used to reject a reused key with a different input.
created_by: Option<String>Who asked for the effect, e.g. agent:refund-agent.
now: SystemTimeThe creation time.
Implementations§
Source§impl NewEffect
impl NewEffect
Sourcepub fn with_contract(self, contract: ExecutionContract) -> Self
pub fn with_contract(self, contract: ExecutionContract) -> Self
Records explicit execution assumptions on a new effect. This cannot
change an existing record returned by insert_or_get.
Sourcepub fn new(key: EffectKey, kind: EffectKind, now: SystemTime) -> Self
pub fn new(key: EffectKey, kind: EffectKind, now: SystemTime) -> Self
A new effect with a fresh id and no input or actor.
Trait Implementations§
impl StructuralPartialEq for NewEffect
Auto Trait Implementations§
impl Freeze for NewEffect
impl RefUnwindSafe for NewEffect
impl Send for NewEffect
impl Sync for NewEffect
impl Unpin for NewEffect
impl UnsafeUnpin for NewEffect
impl UnwindSafe for NewEffect
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