pub enum Op {
OpenAccount(Box<AccountSpec>),
Credit(IssueTransfer),
Debit(Transfer),
Reserve {
transfer: Transfer,
timeout_s: u32,
},
Post {
id: TransferId,
pending: TransferId,
amount: Option<u128>,
},
Void {
id: TransferId,
pending: TransferId,
},
Expire {
pending: TransferId,
},
}Expand description
An op the engine can stage. The idempotency key (where present) is the
carried TransferId; stage never dedups — that is the commit loop’s job
(it checks the outcome index before calling stage).
Variants§
OpenAccount(Box<AccountSpec>)
Create an account (boxed to keep the enum small). Idempotent by derived id; the backend’s fast path returns an existing account without a journal entry, so this variant is only committed on real creation.
Credit(IssueTransfer)
Single-phase issuance (supply growth).
Debit(Transfer)
Single-phase spend.
Reserve
Phase-1 reservation.
Fields
Post
Phase-2 post. amount: None = full; Some(p) = partial (remainder released).
Fields
id: TransferIdThis post’s own idempotency id.
pending: TransferIdThe phase-1 reservation being resolved.
Void
Phase-2 void (release the hold).
Fields
id: TransferIdThis void’s own idempotency id.
pending: TransferIdThe phase-1 reservation being cancelled.
Expire
Sweep-driven expiry of a single reservation (plan §2b.4). Emitted by the
backend’s tick, not by callers; it has no external idempotency id.
Fields
pending: TransferIdThe reservation to expire.
Implementations§
Source§impl Op
impl Op
Sourcepub fn idempotency_id(&self) -> Option<TransferId>
pub fn idempotency_id(&self) -> Option<TransferId>
The idempotency key for this op, if it carries one. Expire is
internally generated and has none.