Skip to main content

trillium_http/
h3.rs

1//! Trillium HTTP/3 types
2
3mod body_wrapper;
4mod connection;
5mod error;
6mod frame;
7#[cfg(feature = "unstable")]
8pub mod quic_varint;
9#[cfg(not(feature = "unstable"))]
10mod quic_varint;
11mod settings;
12
13#[cfg(test)]
14mod tests;
15
16/// An error that may occur during HTTP/3 stream or connection processing.
17///
18/// When the error is `Protocol`, the contained [`H3ErrorCode`] should be communicated to the
19/// peer via the QUIC connection's error signaling. `Io` errors indicate an unrecoverable
20/// transport failure.
21#[derive(thiserror::Error, Debug)]
22#[non_exhaustive]
23pub enum H3Error {
24    #[error(transparent)]
25    /// An HTTP/3 protocol error; the error code should be signaled to the peer.
26    Protocol(#[from] H3ErrorCode),
27
28    #[error(transparent)]
29    /// An unrecoverable I/O error encountered at the network layer.
30    Io(#[from] std::io::Error),
31}
32
33#[cfg(feature = "unstable")]
34pub use body_wrapper::H3Body;
35#[cfg(not(feature = "unstable"))]
36pub(crate) use body_wrapper::H3Body;
37pub use connection::{H3Connection, H3StreamResult, UniStreamResult};
38pub use error::H3ErrorCode;
39#[cfg(feature = "unstable")]
40pub use frame::{ActiveFrame, Frame, FrameDecodeError, FrameStream};
41#[cfg(not(feature = "unstable"))]
42pub(crate) use frame::{Frame, FrameDecodeError, FrameStream};