Crate trillium_client
source ·Expand description
trillium client is a http client that uses the same conn approach as
trillium.
this was primarily built for the
trillium_proxy crate,
but might end up fitting well into trillium apps for other purposes.
In order to use http keep-alive connection pooling, make requests from
a trillium_client::Client. To make a one-off request,
build a trillium_client::Conn directly. Please note that a
trillium_client Conn, while conceptually similar, is different from
trillium::Conn and trillium_http::Conn.
Connector
Client and Conn are generic over an implementation of
Connector. Each runtime crate (trillium_smol,
trillium_tokio,
trillium_async_std) offers
a Connector implementation, which can optionally be combined with a
tls crate (trillium_rustls and
trillium_native_tls
each offer Connector wrappers.
See the documentation for Client and Conn for further usage
examples.
Structs
- A client contains a Config and an optional connection pool and builds conns.
- a client connection, representing both an outbound http request and a http response
- An unexpected http status code was received. Transform this back into the conn with
From::from/Into::into.
Enums
- Concrete errors that occur within trillium’s http implementation
Traits
- Trait for things that operate like a client. The only interface that’s required is build_conn.
- Interface for runtime and tls adapters for the trillium client
Functions
- constructs a new
Client– alias forClient::new
Type Definitions
- this crate’s result type