Skip to content

trillium-http-v1.0.1

Choose a tag to compare

@jbr jbr released this 03 May 00:36
· 191 commits to main since this release
ec36ebd

Changed

  • Compatible with trillium 1.0
  • StateSet renamed to TypeSet and extracted to the type-set crate; re-exported as trillium_http::TypeSet
  • Trillium 1.0 uses Swansong instead of Stopper; Conn::stopper()Conn::swansong()
  • Error variants renamed for consistency: MalformedHeaderInvalidHeaderValue, PartialHeadInvalidHead, MissingVersionInvalidVersion, UnrecognizedStatusCode/MissingStatusCodeInvalidStatus/MissingStatus; HeaderMissing and UnexpectedHeader now carry HeaderName<'static> instead of &'static str; UnsupportedVersion now carries Version instead of u8
  • Version::Http2_0 renamed to Version::Http2; Version::Http3_0 renamed to Version::Http3
  • Upgrade is now #[non_exhaustive]; Upgrade::buffer changed from Option<Vec<u8>> to Buffer; Upgrade::stopper renamed to Upgrade::swansong; Upgrade::peer_ip: Option<IpAddr> added
  • ReceivedBody no longer implements Stream; use AsyncRead instead
  • Headers::contains_ignore_ascii_case removed (was deprecated)
  • Headers::append and Headers::try_insert_with now return &mut HeaderValues instead of ()
  • set_* setters on Conn (e.g. set_status, set_host) now return &mut Self, enabling chaining
  • Handler futures in Conn::map and friends no longer require Send
  • pub mod transport removed — the Transport trait is now at trillium::Transport
  • Body::new_streaming no longer requires a Sync reader.
  • Conn::request_body is synchronous now. 100-continue is sent, if necessary, on first read from the body.
  • ReceivedBody no longer implements IntoFuture to make the transition to request_body being synchronous easier.

Added

  • Headers::entry() — Entry API for inserting/modifying headers, mirroring HashMap::entry
  • parse feature — opt-in alternative header parser (bypasses httparse; groundwork for H3)
  • HttpContext is now public — Arc-shared per-server state (Swansong + TypeSet + HttpConfig) passed to every connection
  • pub mod h3 — HTTP/3 protocol primitives: QPACK encode/decode, H3 framing, H3Connection, H3Body, H3Error; used by trillium-quinn and other QUIC adapter crates