#![warn(missing_docs)]
#![cfg_attr(feature = "once_cell_try", feature(once_cell_try))]
#![cfg_attr(docsrs, feature(doc_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 backend;
pub(crate) use backend::*;
mod connector;
pub(crate) use connector::*;
mod stream;
pub(crate) use stream::*;
pub mod resolve;
mod util;
#[cfg(feature = "http3")]
mod http3;
#[cfg(feature = "http3-altsvc")]
mod altsvc;
#[cfg(feature = "multipart")]
pub mod multipart;
#[cfg(feature = "nyquest")]
pub mod nyquest;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("request timeout")]
Timeout,
#[error("no TLS backend available")]
NoTlsBackend,
#[error("invalid URL: {0}")]
InvalidUrl(url::Url),
#[error("bad scheme: {0}")]
BadScheme(String),
#[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 = "native-tls")]
#[error("`native-tls` error: {0}")]
NativeTls(#[from] compio::native_tls::Error),
#[cfg(any(feature = "http3", feature = "rustls"))]
#[error("`rustls` error: {0}")]
Rustls(#[from] compio::rustls::Error),
#[cfg(feature = "http3")]
#[error("`h3` connection error: {0}")]
H3Connection(#[from] h3::error::ConnectionError),
#[cfg(feature = "http3")]
#[error("`h3` stream error: {0}")]
H3Stream(#[from] h3::error::StreamError),
#[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, E = Error> = std::result::Result<T, E>;