pub struct TriggerContext {
pub now_unix: u32,
pub occurred_events: Vec<String>,
pub attestations: Vec<Attestation>,
pub last_liveness_unix: Option<u32>,
}Expand description
The evaluation context — the observable world state a Trigger is tested against. All fields are
data the delegation infrastructure already collects (event log, liveness pings, the attestation
queue); evaluate reads them without mutation.
Fields§
§now_unix: u32Current wall-clock time (unix seconds).
occurred_events: Vec<String>Ids of verifiable events known to have occurred.
attestations: Vec<Attestation>Collected human attestations (signed and unsigned).
last_liveness_unix: Option<u32>The principal’s last liveness ping (unix seconds), if any — feeds DeadmanSwitch.
Implementations§
Source§impl TriggerContext
impl TriggerContext
Sourcepub fn at(now_unix: u32) -> Self
pub fn at(now_unix: u32) -> Self
A context anchored at now_unix with no events, attestations, or liveness signal.
Sourcepub fn with_event(self, event_id: impl Into<String>) -> Self
pub fn with_event(self, event_id: impl Into<String>) -> Self
Builder — sets event.
Sourcepub fn with_attestation(self, att: Attestation) -> Self
pub fn with_attestation(self, att: Attestation) -> Self
Builder — sets attestation.
Sourcepub fn with_liveness(self, last_liveness_unix: u32) -> Self
pub fn with_liveness(self, last_liveness_unix: u32) -> Self
Builder — sets liveness.
Trait Implementations§
Source§impl Clone for TriggerContext
impl Clone for TriggerContext
Source§impl Debug for TriggerContext
impl Debug for TriggerContext
Source§impl Default for TriggerContext
impl Default for TriggerContext
Source§impl<'de> Deserialize<'de> for TriggerContext
impl<'de> Deserialize<'de> for TriggerContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TriggerContext
Source§impl PartialEq for TriggerContext
impl PartialEq for TriggerContext
Source§impl Serialize for TriggerContext
impl Serialize for TriggerContext
impl StructuralPartialEq for TriggerContext
Auto Trait Implementations§
impl Freeze for TriggerContext
impl RefUnwindSafe for TriggerContext
impl Send for TriggerContext
impl Sync for TriggerContext
impl Unpin for TriggerContext
impl UnsafeUnpin for TriggerContext
impl UnwindSafe for TriggerContext
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