trillium handler that rewrites html using lol-html and the
[lol_async
] library.
this crate currently requires configuring the runtime,
unfortunately. use one of the "async-std"
, "smol"
, or "tokio"
features. do not use the default feature, it may change at any time.
``` use trilliumhtmlrewriter::{ html::{element, html_content::ContentType, Settings}, HtmlRewriter, };
let handler = (
|conn: trillium::Conn| async move {
conn.withheader(("content-type", "text/html"))
.withstatus(200)
.withbody(" body
use trillium_testing::prelude::*;
let conn = asyncglobalexecutor::spawn(async move { get("/").run_async(&handler).await }).await;
assert_ok!(conn, "
body
");