pub enum ProtocolAction {
Show 16 variants
Send {
performative: Performative,
to: Option<String>,
fields: Option<BTreeMap<String, String>>,
retry: Option<Retry>,
},
Begin,
Fulfil,
Retract {
target: String,
},
Set {
name: String,
field: Option<String>,
expr: Expr,
},
Push {
state: String,
expr: Expr,
},
Put {
state: String,
key: String,
expr: Expr,
},
For {
var: String,
over: String,
actions: Vec<ProtocolAction>,
},
Abort,
Return {
expr: Expr,
},
Broadcast {
performative: Performative,
fields: Option<BTreeMap<String, String>>,
to: String,
},
Enter {
phase: String,
},
BeginId {
id: String,
},
FulfilId {
id: String,
},
Try {
body: Vec<ProtocolAction>,
catch: Vec<ProtocolAction>,
},
Await {
count: i64,
performative: Performative,
into: String,
within_ms: i64,
flag: String,
},
}Expand description
What a handler does. Phase 1: the speech-act statement set.
Variants§
Send
send propose to seller — MUST be dialogue-legal for the trigger;
to names the receiving role (defaults to the counterpart)
Fields
performative: PerformativeBegin
begin — activate the pending commitment (proposed -> active)
Fulfil
fulfil — mark the commitment fulfilled (active -> fulfilled)
Retract
retract(fact_name) — belief revision as a statement (§32.1)
Set
§35.1: set <state> = <expr>; — field targets a record field
(set q.price = 5;)
Push
§35.2: push <state>, <expr>; — append to a list state
Put
§35.2: put <state>, <key>, <expr>; — set a map entry
For
§35.3: for <var> in <list_state> { ... } — fan-out over a collection
Abort
§35.4: abort; — trigger compensation handlers immediately
Return
§38.1: return <expr>; — only legal inside a function body
Broadcast
§38.8: broadcast <perf> [payload] to <list_state>; — fan-out to
every role named in a list state (contract-net announce)
Enter
§50: enter <phase>; — transition the session’s conversation phase
BeginId
§51: begin <id>; / fulfil <id>; — NAMED commitments (several
obligations per session, each with its own lifecycle)
FulfilId
Try
§45: try { ... } catch { ... }; — a failing action inside the
body (set/push/put eval error, container violation, fmt failure)
cuts the body short and runs the catch actions instead of routing
to the session’s on error handler
Await
§44: await N <perf> into <list> within <dur> as <flag>; —
declarative collection: matching events push their payload into the
list state; when N arrive the flag goes true; on deadline it goes
false. No handler needs to be written for the collected events.
Trait Implementations§
Source§impl Clone for ProtocolAction
impl Clone for ProtocolAction
Source§fn clone(&self) -> ProtocolAction
fn clone(&self) -> ProtocolAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more