1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![forbid(unsafe_code)]
3#![deny(
4 clippy::dbg_macro,
5 missing_copy_implementations,
6 rustdoc::missing_crate_level_docs,
7 missing_debug_implementations,
8 missing_docs,
9 nonstandard_style,
10 unused_qualifications
11)]
12
13#[cfg(test)]
32#[doc = include_str!("../README.md")]
33mod readme {}
34mod client;
35mod conn;
36mod h3;
37mod into_url;
38mod pool;
39mod response_body;
40mod util;
41#[cfg(feature = "websockets")]
42pub mod websocket;
43
44pub use client::Client;
45#[cfg(any(feature = "serde_json", feature = "sonic-rs"))]
46pub use conn::ClientSerdeError;
47pub use conn::{Conn, USER_AGENT, UnexpectedStatusError};
48pub use into_url::IntoUrl;
49pub(crate) use pool::Pool;
51pub use response_body::ResponseBody;
52pub use trillium_http::{
53 Body, Error, HeaderName, HeaderValue, HeaderValues, Headers, KnownHeaderName, Method, Result,
54 Status, Version,
55};
56pub use trillium_server_common::{
57 ArcedConnector, ArcedQuicClientConfig, Connector, QuicClientConfig, Url,
58};
59#[cfg(feature = "websockets")]
60pub use trillium_websockets::{WebSocketConfig, WebSocketConn, async_tungstenite, tungstenite};
61#[cfg(feature = "websockets")]
62pub use websocket::WebSocketUpgradeError;
63
64#[cfg(all(feature = "serde_json", feature = "sonic-rs"))]
65compile_error!("cargo features \"serde_json\" and \"sonic-rs\" are mutually exclusive");
66
67#[cfg(feature = "serde_json")]
68#[cfg_attr(docsrs, doc(cfg(feature = "serde_json")))]
69pub use serde_json::{Value, json};
70#[cfg(feature = "sonic-rs")]
71#[cfg_attr(docsrs, doc(cfg(feature = "sonic-rs")))]
72pub use sonic_rs::{Value, json};
73
74pub fn client(connector: impl Connector) -> Client {
76 Client::new(connector)
77}