15 unstable releases (6 breaking)

0.7.0 May 30, 2024
0.6.0 Mar 22, 2024
0.5.0 Apr 21, 2023
0.4.2 Mar 29, 2023
0.3.0 Jul 14, 2021

#983 in HTTP server

Download history 221/week @ 2024-10-19 383/week @ 2024-10-26 232/week @ 2024-11-02 386/week @ 2024-11-09 538/week @ 2024-11-16 286/week @ 2024-11-23 502/week @ 2024-11-30 918/week @ 2024-12-07 212/week @ 2024-12-14 196/week @ 2024-12-21 63/week @ 2024-12-28 182/week @ 2025-01-04 523/week @ 2025-01-11 306/week @ 2025-01-18 395/week @ 2025-01-25 1009/week @ 2025-02-01

2,239 downloads per month
Used in 5 crates

MIT/Apache

425KB
8K SLoC

Welcome to Trillium!

📖 Guide 📖

The guide provides an architectural overview and lay of the land connecting the trillium crates.

📑 Rustdocs 📑

The rustdocs represent the best way to learn about any of trillium's individual crates and the specific interfaces.




Legal:

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

testing utilities for trillium applications.

this crate is intended to be used as a development dependency.

use trillium_testing::prelude::*;
use trillium::{Conn, conn_try};
async fn handler(mut conn: Conn) -> Conn {
let request_body = conn_try!(conn.request_body_string().await, conn);
conn.with_body(format!("request body was: {}", request_body))
.with_status(418)
.with_response_header("request-id", "special-request")
}

assert_response!(
post("/").with_request_body("hello trillium!").on(&handler),
Status::ImATeapot,
"request body was: hello trillium!",
"request-id" => "special-request",
"content-length" => "33"
);

Features

You must enable a runtime feature for trillium testing

Tokio:

[dev-dependencies]
# ...
trillium-testing = { version = "0.2", features = ["tokio"] }

Async-std:

[dev-dependencies]
# ...
trillium-testing = { version = "0.2", features = ["async-std"] }

Smol:

[dev-dependencies]
# ...
trillium-testing = { version = "0.2", features = ["smol"] }

useful stuff for testing trillium apps

Dependencies

~9–25MB
~370K SLoC