![]() * remove infinite scroll example * add rocket and axum example * rework how framework integration works * rocket integration * add .gitignore * dont elide `retry` * add "read signals" to rocket hello-world example * don't elide `retry` in display * remove mime dependency * update cargo.toml * add underscore to unused consts * formatting * use `async_stream` instead of "hand writing" streams * add axum test * fix errors * implement custom sse stream for axum and rocket * generate hello-world.html * update readme * don't track cargo.lock |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
Cargo.toml | ||
README.md |
README.md
Datastar Rust SDK
An implementation of the Datastar SDK in Rust with framework integration for Axum and Rocket.
Usage
use datastar::prelude::*;
use async_stream::stream;
Sse(stream! {
// Merges HTML fragments into the DOM.
yield MergeFragments::new("<div id='question'>What do you put in a toaster?</div>").into();
// Merges signals into the signals.
yield MergeSignals::new("{response: '', answer: 'bread'}").into();
})