1# aldebaran-datastar
2
3Datastar's wire, once. Every property that serves a Datastar page built the
4same three things by hand: the text of a patch event, the reading of a
5request's signals, and a copy of `datastar.js`. This crate is those.
6
7| Item | What it is |
8|---|---|
9| `PatchElements` | Markup to put into the page: `new`, `remove`, `selector`, `mode`, `sse()`. |
10| `PatchSignals` | Signals to merge: `of(&value)`, `only_if_missing`, `sse()`. |
11| `signals::<T>(json)` | A request's signals, from the `datastar` query parameter (GET) or the body. |
12| `SCRIPT` | `datastar.js`, version 1.0.4, the one copy. |
13| `QUERY_PARAMETER`, `REQUEST_HEADER`, `EVENT_STREAM` | The names on the wire. |
14
15No I/O and no runtime: the adapters (`aldebaran-worker`, `aldebaran-axum`,
16to come) put the text on a response.
17
18```rust
19let body = PatchElements::new(html).sse() + &PatchSignals::of(&json!({ "busy": false }))?.sse();
20```