Skip to main content

toddstack_frontend_engine/
lib.rs

1//! App-agnostic frontend core: the Elm-style loop `update(model, msg) -> effects`.
2//!
3//! The core is pure: it reads no clock, network, disk or randomness. Effects are data; the shell
4//! (browser, iOS, Android, a test harness) runs them and answers with `resolve`. Shells only draw
5//! view models and run effects. See the README for the pattern and a minimal app.
6
7mod app;
8mod effect;
9mod policy;
10mod runtime;
11mod wire;
12
13#[cfg(feature = "example")]
14pub mod example;
15#[cfg(feature = "ffi")]
16pub mod ffi;
17#[cfg(feature = "testing")]
18pub mod testing;
19#[cfg(feature = "wasm")]
20pub mod wasm;
21
22pub use app::{ActionSpec, App, Ctx, FieldType, Pending, Pointer};
23pub use effect::{
24    BUILT_IN_EFFECT_NAMES, Effect, EffectReq, HttpReply, NavigateOp, NoEffect, builtin_collision,
25};
26pub use policy::{ClockOffset, RetryPolicy};
27pub use runtime::{BRIDGE_PROTOCOL, Bridge, Runtime};
28
29/// Runs the README's Rust examples as doctests, so they cannot rot.
30#[cfg(doctest)]
31#[doc = include_str!("../README.md")]
32struct ReadmeDoctests;