Expand description
§Welcome to the trillium crate!
This crate is the primary dependency for building a trillium app or library. It contains a handful of core types and reexports a few others that you will necessarily need, but otherwise tries to stay small and focused.
To get started with this crate, first take a look at the
guide, then browse the docs for
trillium::Conn.
At a minimum to build a trillium app, you’ll also need a trillium runtime adapter.
Re-exports§
pub use log;
Modules§
Macros§
- conn_
try - Unwraps an
Result::Okor returns theConnwith a 500 status. - conn_
unwrap - Unwraps an
Option::Someor returns theConn. - delegate_
handler - Macro for implementing Handler for simple newtypes that contain another handler.
- log_
error - A convenience macro for logging the contents of error variants.
Structs§
- Body
- The trillium representation of a http body. This can contain
either
&'static [u8]content,Vec<u8>content, or a boxedAsyncRead/BodySourcetype. - Boxed
Handler - A type-erased handler
- Conn
- A Trillium HTTP connection.
- Header
Name - The name of a http header. This can be either a
KnownHeaderNameor a string representation of an unknown header. - Header
Value - A
HeaderValuerepresents the right hand side of a singlename: valuepair. - Header
Values - A header value is a collection of one or more
HeaderValue. It has been optimized for the “oneHeaderValue” case, but can accomodate more than one value. - Headers
- Trillium’s header map type
- Http
Config - Performance and security parameters for trillium-http.
- Http
Context - This struct represents the shared configuration and context for a http server.
- Info
- This struct represents information about the currently connected server.
- Init
- Provides support for asynchronous initialization of a handler after the server is started.
- Request
Body - A received request body
- State
- A handler for sharing state across an application.
- Swansong
- 🦢 Shutdown manager
- TypeSet
- A collection for heterogenous types
- Upgrade
- A HTTP protocol upgrade
Enums§
- Error
- Concrete errors that occur within trillium’s HTTP implementation
- Known
Header Name - A short nonehaustive enum of headers that trillium can
represent as a u8. Use a
KnownHeaderNamevariant instead of a &’static str anywhere possible, as it allows trillium to skip parsing the header entirely. - Method
- HTTP request methods.
- Status
- HTTP response status codes.
- Version
- The version of the HTTP protocol in use.
Constants§
- CRATE_
VERSION - The version of this crate
Traits§
- Body
Source - Trait for streaming body sources that can optionally produce trailers.
- Handler
- The building block for Trillium applications.
- Transport
- The interface that the http protocol is communicated over.
Functions§
- init
- alias for
Init::new - state
- Constructs a new
Statehandler from any Clone + Send + Sync + ’static. Alias forState::new