lmjtfy.git / third-party / rustcrates / aldebaran-datastar

aldebaran-datastar

Datastar's wire, once. Every property that serves a Datastar page built the same three things by hand: the text of a patch event, the reading of a request's signals, and a copy of datastar.js. This crate is those.

ItemWhat it is
PatchElementsMarkup to put into the page: new, remove, selector, mode, sse().
PatchSignalsSignals to merge: of(&value), only_if_missing, sse().
signals::<T>(json)A request's signals, from the datastar query parameter (GET) or the body.
SCRIPTdatastar.js, version 1.0.4, the one copy.
QUERY_PARAMETER, REQUEST_HEADER, EVENT_STREAMThe names on the wire.

No I/O and no runtime: the adapters (aldebaran-worker, aldebaran-axum, to come) put the text on a response.

let body = PatchElements::new(html).sse() + &PatchSignals::of(&json!({ "busy": false }))?.sse();