pub struct Intent {
pub agent_id: String,
pub run_id: String,
pub epoch: u64,
pub status: IntentStatus,
}Expand description
A leased execution intent — the proposal’s write-ahead ledger entry, folded
under crate::oplog::FoldTier::Leased. run_id is the B7 deterministic run id (the
idempotency key), epoch the lease’s fencing token.
Fields§
§agent_id: String§run_id: StringThe B7 content-addressed run id — the fold’s per-run stable key.
epoch: u64The lease epoch this intent was written under — the fencing token.
status: IntentStatusImplementations§
Source§impl Intent
impl Intent
pub fn new( agent_id: impl Into<String>, run_id: impl Into<String>, epoch: u64, status: IntentStatus, ) -> Self
Sourcepub fn payload(&self) -> Value
pub fn payload(&self) -> Value
The op payload — run_id under "id" so the fold’s stable key is
id:<run_id> (reusing the standard crate::oplog::OpRecord::stable_key
machinery), plus the fencing fields.
Sourcepub fn from_payload(payload: &Value) -> Option<Self>
pub fn from_payload(payload: &Value) -> Option<Self>
Parse an crate::oplog::Surface::Intent payload back into an Intent; None
when a required field is missing or malformed.
Trait Implementations§
impl Eq for Intent
impl StructuralPartialEq for Intent
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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