Skip to content

trillium-http-v0.2.0

Choose a tag to compare

@jbr jbr released this 26 Aug 22:08
· 1065 commits to main since this release

This release primarily serves to move trillium away from http-types, in order to make development more flexible and specialized. There is no intention to support the use of trillium-http's types outside of trillium, unlike http-types, which intends to be a general purpose library.

Previously, trillium-http had been using a fork of http-types, but that meant that trillium was still exposing (and thus supporting) a bunch of unnecessary code that I had not personally written, read, or vetted, in the form of typed headers. Trillium's approach will be to implement header parsers as needed, in subcrates that use the specific parsers, and only when driven by use cases trillium supports.

Additionally, trillium-http@0.2.0 introduces a new header map implementation and response body type and renames several types from http-types.

Full enumeration:

  • renamed trillium_http::Conn::response_headers → trillium_http::Conn::response_headers_mut, added trillium_http::Conn::response_headers which does not require &mut, added trillium_http::Conn::request_headers_mut for parity
  • all Headers interfaces have been rewritten and are likely to have changed. In particular:
    Headers no longer are Index
  • Headers::get returns None if there are more than one header value for that header. To retrieve all of the potential values, use Headers::get_values
  • KnownHeaderNames are the preferred way to describe a HeaderName
  • Extensions renamed to StateSet to match the docs
  • StatusCode renamed to Status
  • New Body type

Migration guide

See the migration guide for trillium@0.2.0