1#![deny(unsafe_op_in_unsafe_fn)]
9pub mod client;
10pub mod compression;
11pub mod hpack;
12pub mod http1;
13pub mod http2;
14
15#[derive(Debug, Clone, Copy, PartialEq, Eq)]
16pub struct Error {
17 pub code: &'static str,
18 pub message: &'static str,
19}
20impl Error {
21 pub const fn new(code: &'static str, message: &'static str) -> Self {
22 Self { code, message }
23 }
24}
25impl std::fmt::Display for Error {
26 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 write!(f, "{}: {}", self.code, self.message)
28 }
29}
30impl std::error::Error for Error {}
31pub type Result<T> = std::result::Result<T, Error>;
32
33mod recycling;
34
35#[cfg(feature = "turnloop")]
36pub mod asynchronous;