Rust SDK
Import from the trigora crate. These functions fail outside an Execution.
use trigora::{effect, invoke, join, race, sleep, wait_for_event};The Program entry is one pub async fn main. Parameters are exact arity with no defaults. It returns Result. Rust Program ids use the source file stem. For lib.rs and main.rs, the Cargo package name is used instead. See Rust.
effect
Section titled “effect”effect(name, closure).await?name is a non-empty string literal. A capturing closure is move. Details.
sleep(duration_ms).await?duration_ms is an f64 millisecond count. Details.
invoke
Section titled “invoke”invoke(child, args).await?A tuple is the argument vector. A bare value is one argument. () is empty. Details.
join and race
Section titled “join and race”join(left, right).await?race(left, right).await?join returns Vec<T> in input order. race returns the winning T. Both arguments are direct durable calls, and both branches share T. The Rust frontend accepts exactly two branches, while the engine supports groups of 1–32 branches. Details.
wait_for_event
Section titled “wait_for_event”wait_for_event(name).await?name is a non-empty string literal. Details.