pub struct ProtocolProgram {Show 20 fields
pub name: String,
pub version: u32,
pub roles: Vec<String>,
pub states: Vec<StateDecl>,
pub handlers: Vec<Handler>,
pub end_when: Option<EndWhen>,
pub capabilities: Vec<CapabilityDecl>,
pub transport: Option<String>,
pub capacity: Option<usize>,
pub abort_when: Vec<Guard>,
pub scenarios: Vec<Scenario>,
pub templates: Vec<(String, String)>,
pub functions: Vec<Function>,
pub types: BTreeMap<String, Vec<(String, String)>>,
pub handler_sets: BTreeMap<String, Vec<Handler>>,
pub exported_sets: Vec<String>,
pub phases: Vec<String>,
pub extends: Option<String>,
pub exported_types: Vec<String>,
pub exported_fns: Vec<String>,
}Fields§
§name: String§version: u32§roles: Vec<String>§states: Vec<StateDecl>§handlers: Vec<Handler>§end_when: Option<EndWhen>§capabilities: Vec<CapabilityDecl>§35.6: capabilities this program requires (host-gated)
transport: Option<String>§35.11: declared transport hint (stdio|http|ws|relay)
capacity: Option<usize>§35.8: max concurrent sessions (capacity model)
abort_when: Vec<Guard>§35.4: abort conditions — when one becomes true, compensation runs
scenarios: Vec<Scenario>§35.12: executable scenarios (protocol tests)
templates: Vec<(String, String)>§35.3: user-defined message templates message name = "text";
functions: Vec<Function>§38.1: user-defined functions fn f(x: int) -> int { ... }
types: BTreeMap<String, Vec<(String, String)>>§38.2: user-defined record types type Quote = { price: int };
handler_sets: BTreeMap<String, Vec<Handler>>§38.5: reusable handler fragments handler_set name { ... } —
spliced into a protocol by include handler_set name;
exported_sets: Vec<String>§38.10: sets made importable by export handler_set name; —
everything else stays private to the module file
phases: Vec<String>§50: declared conversation phases — handlers may be gated on the
current phase (on inform ... in <phase>) and actions transition
with enter <phase>;. The FIRST declared phase is the initial one.
extends: Option<String>§42: protocol v2 extends v1; — the base protocol declared
earlier in the same file (states/types/fns/handlers inherited,
handlers overridable by matching trigger+guard signature)
exported_types: Vec<String>§42: export type X; / export fn name; — importable vocabulary
exported_fns: Vec<String>Implementations§
Source§impl ProtocolProgram
impl ProtocolProgram
pub fn state_names(&self) -> Vec<&str>
Trait Implementations§
Source§impl Clone for ProtocolProgram
impl Clone for ProtocolProgram
Source§fn clone(&self) -> ProtocolProgram
fn clone(&self) -> ProtocolProgram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more