Skip to main content

project

Function project 

Source
pub fn project(
    prog: &ProtocolProgram,
    role: &str,
) -> Result<RoleEndpoint, Vec<IdlError>>
Expand description

Project a global protocol onto role’s endpoint (§33.5).

Rules (phase 3, two-role semantics):

  • a handler executes in the role that RECEIVES its trigger (from R ⇒ every role ≠ R; omitted ⇒ counterpart default)
  • send X to R2 emits only in the executor’s endpoint; to defaults to the counterpart of the executor
  • state actions (begin, fulfil, retract) execute in the executor