About this document

Here are some conventions in this document.

  • use declarations will only be listed once on the first usage of a given type in order to keep code samples concise
  • In-line code looks like this: |conn: Conn| async move { conn } and will generally not involve fully qualified paths
  • Footnotes are represented like this1
  • Informational asides look like this:

    ℹī¸ Fun fact: Facts are fun

  • Advanced asides look like this

    🧑‍🎓 The handler trait provides several other lifecycle hooks for library authors

  • Comparisons with Tide

    🌊 Tide endpoints look like |_req: Request<_>| async { Response::new(200) } whereas Trillium handlers look like |conn: Conn| async move { conn.with_status(200) }

  • Comparisons with Plug:

    🔌 Halting a plug looks like conn |> halt (elixir), and the equivalent in trillium is returning conn.halt()


Footnotes can always be skipped

Who is this document for?

This document expects some familiarity with async rust. We intend to offer a beginner level document at some point, but for now we recommend looking at the rust book and the async book.

We also assume familiarity with web development in general, including concepts and patterns in http servers and frameworks.

In particular, we offer comparisons to rust's tide and elixir's phoenix / plug, as they serve as the primary inspirations for trillium.