tilo-resource
The resource layer of the Tilo app SDK. A Tilo app's state is a resource: a typed value the system stores, versions and shares. This crate turns a Rust struct into one, and its methods into typed actions.
A type derives Model, and an #[resource] impl declares its actions. From those declarations
the app gets, without writing it: CRDT storage and sync between devices and people, replayable
actions with a recorded author and time, history and per-change undo, permissions, search over
its text fields, and the action vocabulary that the command palette, agents and scripts call.
The crate has no rendering or window dependency; tilo-app binds resources to views.
Apps built on tilo-app normally use this crate through the SDK, which re-exports the resource
layer in its prelude. Depend on tilo-resource directly when declaring resources in a library,
or when testing one without a window.
Use it
[]
= "0.4"
use ;
Replica is the harness a test uses: it applies actions the way a control, the palette, an
agent or a script does, through the published action API, and reads back the resulting state.
An action method takes &mut self and the typed arguments it declares; ActionCx supplies the
ids and the time the action records. The same action, replayed from its recorded form on another
replica, produces the same state.
Learn more
- Rust app documentation: https://tilolang.dev/docs/rust-apps
- Repository: https://code.tilo.so/tilo/tilo
License
MIT