chorus_lib 0.5.0

Choreographic Programming in Rust
Documentation
extern crate chorus_lib;
use chorus_lib::core::{ChoreoOp, Choreography, ChoreographyLocation, Located, LocationSet};
#[derive(ChoreographyLocation)]
struct Alice;
#[derive(ChoreographyLocation)]
struct Bob;
#[derive(ChoreographyLocation)]
struct Carol;

struct DemoChoreography {
    input: Located<String, Alice>,
}

impl Choreography for DemoChoreography {
    type L = LocationSet!(Alice);
    fn run(self, op: &impl ChoreoOp<Self::L>) {
        op.locally(Alice, |un| {
            let s = un.unwrap(&self.input);
            println!("Alice received: {}", s);
        });
    }
}

fn main() {
    let runner = chorus_lib::core::Runner::new();
    let s = "hello, world".to_string();
    let s = runner.local(s);
    let choreo = DemoChoreography { input: s };
    runner.run(choreo);
}