1mod acceptor;
6mod body_wrapper;
7mod connection;
8mod error;
9mod frame;
10#[cfg(feature = "unstable")]
11mod initiator;
12mod role;
13mod settings;
14mod stream_state;
15mod transport;
16
17use crate::headers::compression_error::CompressionError;
18pub use acceptor::H2Driver;
19pub(crate) use body_wrapper::H2Body;
20pub use connection::H2Connection;
21#[cfg(feature = "unstable")]
22#[doc(hidden)]
23pub use connection::{ResponseHeaders, SubmitSend};
24pub use error::H2ErrorCode;
25#[cfg(feature = "unstable")]
26pub use initiator::H2Initiator;
27#[cfg(feature = "unstable")]
28pub use settings::H2Settings;
29#[cfg(not(feature = "unstable"))]
30pub(crate) use settings::H2Settings;
31pub use transport::H2Transport;
32
33#[derive(thiserror::Error, Debug)]
39pub enum H2Error {
40 #[error(transparent)]
42 Protocol(#[from] H2ErrorCode),
43
44 #[error(transparent)]
46 Io(#[from] std::io::Error),
47}
48
49impl From<CompressionError> for H2Error {
51 fn from(_: CompressionError) -> Self {
52 Self::Protocol(H2ErrorCode::CompressionError)
53 }
54}