Rust Docs
Rust APIs, examples, recipes, integrations, and generated rustdoc for building
graph-driven reactive systems with the graphrefly crate.
Start here
Section titled “Start here”- Quick Start — build and observe a tiny graph in Rust.
- API Reference — generated rustdoc for the public crate surface.
- Examples — package-local Rust entry points.
- Recipes — composition and runtime-boundary notes.
- Integrations — native host, IO, and wire bridge surfaces.
- Release — crates.io, docs.rs, and Pages publishing notes.
Install
Section titled “Install”[dependencies]graphrefly-rs = "0.0.1"use std::cell::RefCell;use std::rc::Rc;
use graphrefly::{graph, Message, Values};
fn last_or_prev(values: &Values<'_>, i: usize) -> Option<Rc<i32>> { values .batches::<i32>(i) .last() .and_then(|wave| wave.last().cloned()) .or_else(|| values.prev::<i32>(i))}
let graph = graph();let count = graph.state(1);let doubled = graph.derived(vec![count.erased()], |values| { Some(*last_or_prev(values, 0)? * 2)});
let seen = Rc::new(RefCell::new(Vec::new()));let observed = seen.clone();let unsubscribe = doubled.subscribe(move |msg| { if let Message::Data(value) = msg { observed.borrow_mut().push(*value); }});
count.set(2);unsubscribe();Ownership
Section titled “Ownership”This site is generated in graphrefly-rs and deployed to
https://rs.graphrefly.dev/. The shared graphrefly.dev site links here for
Rust-specific API details and keeps cross-language concepts in the shared docs.