#![warn(missing_docs)]
#![cfg_attr(feature = "once_cell_try", feature(once_cell_try))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
mod body;
pub use body::*;
mod client;
pub use client::*;
mod request;
pub use request::*;
mod response;
pub use response::*;
mod into_url;
pub use into_url::*;
mod util;
#[cfg(feature = "http3")]
mod http3;
#[cfg(feature = "http3-altsvc")]
mod altsvc;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("request timeout")]
Timeout,
#[error("bad scheme: {0}")]
BadScheme(url::Url),
#[error("system error: {0}")]
System(#[from] std::io::Error),
#[error("`http` error: {0}")]
Http(#[from] http::Error),
#[error("`hyper` error: {0}")]
Hyper(#[from] hyper::Error),
#[error("`hyper` client error: {0}")]
HyperClient(#[from] hyper_util::client::legacy::Error),
#[error("url parse error: {0}")]
UrlParse(#[from] url::ParseError),
#[error("url encode error: {0}")]
UrlEncoded(#[from] serde_urlencoded::ser::Error),
#[cfg(feature = "json")]
#[error("json error: {0}")]
Json(#[from] serde_json::Error),
#[cfg(feature = "http3")]
#[error("`h3` error: {0}")]
H3(#[from] h3::Error),
#[cfg(feature = "http3")]
#[error("HTTP3 client error: {0}")]
H3Client(String),
#[cfg(feature = "http3")]
#[error("QUIC connect error: {0}")]
QuicConnect(#[from] compio::quic::ConnectError),
#[cfg(feature = "http3")]
#[error("QUIC connection error: {0}")]
QuicConnection(#[from] compio::quic::ConnectionError),
}
pub type Result<T> = std::result::Result<T, Error>;