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)]
22pub enum H3Error {
23    #[error(transparent)]
24    /// An HTTP/3 protocol error; the error code should be signaled to the peer.
25    Protocol(#[from] H3ErrorCode),
26
27    #[error(transparent)]
28    /// An unrecoverable I/O error encountered at the network layer.
29    Io(#[from] std::io::Error),
30}
31
32#[cfg(feature = "unstable")]
33pub use body_wrapper::H3Body;
34#[cfg(not(feature = "unstable"))]
35pub(crate) use body_wrapper::H3Body;
36pub use connection::{H3Connection, H3StreamResult, UniStreamResult};
37pub use error::H3ErrorCode;
38#[cfg(feature = "unstable")]
39pub use frame::{ActiveFrame, Frame, FrameDecodeError, FrameStream};
40#[cfg(not(feature = "unstable"))]
41pub(crate) use frame::{Frame, FrameDecodeError, FrameStream};