Skip to main content

ProtocolProgram

Struct ProtocolProgram 

Source
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§

Trait Implementations§

Source§

impl Clone for ProtocolProgram

Source§

fn clone(&self) -> ProtocolProgram

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProtocolProgram

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProtocolProgram

Source§

fn default() -> ProtocolProgram

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ProtocolProgram

Source§

fn eq(&self, other: &ProtocolProgram) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProtocolProgram

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.