aldebaran-axum

The responses an Aldebaran site makes, over http and axum's Body. The Worker family (workers-rs with its axum feature) and the native family (axum on tokio) both answer with http::Response<axum::body::Body>, so the adapter for both is this one crate. The Cloudflare runtime itself is aldebaran-worker.

ItemWhat it is
respond(content_type, cache, body)A response whose content type and cache policy are always given.
html(page, max_age)A page; its cache policy always says no-transform.
events(text)The text of Datastar events as the answer to a Datastar request.
event_stream(stream)A long-lived Datastar response: each item of a Stream<Item = String> is the text of whole events, sent as it arrives. no-cache.
kept_alive(stream, quiet_for), KEEP_ALIVE, KEEP_ALIVE_AFTERFeature keep-alive, for the native family. Sends the comment line : plus a blank line whenever the stream has been quiet for 15 seconds, as axum's Sse::keep_alive does.
datastar_script()datastar.js, from aldebaran-datastar.
asset, bundle_or_not_foundAn embedded file with the cache policy its ?v= earns; the fallback route.
not_found, refused, method_not_allowedThe three plain refusals.
secure(headers, &Policy)The policy's headers on a response; every response leaves through it.
asked(method, headers, uri), gated(gate)A request as aldebaran-gate reads it, and what the gate decided as a response.

A native server streams with event_stream(kept_alive(stream, KEEP_ALIVE_AFTER)) and enables the keep-alive feature of this crate. A Worker uses event_stream alone: the feature needs tokio's clock, which the Workers runtime does not have.