llam 0.1.3

Safe, Go-style Rust bindings for the LLAM runtime
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[llam::test]
fn attribute_test_accepts_unit_return() {
    llam::task::yield_now();
}

#[llam::test(profile = "debug_safe")]
fn attribute_test_accepts_result_return() -> llam::Result<()> {
    let (tx, rx) = llam::channel::bounded::<usize>(1)?;

    llam::spawn!(move {
        tx.send(7).expect("send failed");
    });

    assert_eq!(rx.recv()?, 7);
    Ok(())
}