pub enum DecodeError {
MissingQuarterStreamId,
QuarterStreamIdTooLarge(u64),
MissingContextId,
}Expand description
Why a datagram could not be decoded.
The three cases are kept apart because RFC 9297 §2.1 treats them differently: the two that are about the Quarter Stream ID field are connection errors, while a Context ID that does not parse is not covered by any such rule.
Variants§
MissingQuarterStreamId
The payload was too short to hold a Quarter Stream ID.
QuarterStreamIdTooLarge(u64)
The Quarter Stream ID is larger than MAX_QUARTER_STREAM_ID.
MissingContextId
The Quarter Stream ID parsed, but the Context ID varint did not.
Implementations§
Source§impl DecodeError
impl DecodeError
Sourcepub fn is_connection_error(self) -> bool
pub fn is_connection_error(self) -> bool
Whether RFC 9297 §2.1 requires the whole connection to be closed.
Two MUSTs, both about the Quarter Stream ID field: a datagram carrying a
value above 2^60-1, and one “whose payload is too short to allow parsing
the Quarter Stream ID field”, must each “be treated as an HTTP/3
connection error of type H3_DATAGRAM_ERROR (0x33)”. Both are quoted
verbatim, with their machine-readable anchors, where they are acted on –
h3::connection::route_datagram – and this is the pointer to them
rather than a second copy (D79).
A truncated Context ID is deliberately not one of them. Nothing in RFC 9298 §5 says what to do with it, so dropping the datagram is legitimate, and escalating a droppable condition into a connection error would hand the peer a way to kill every session at once.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§fn clone(&self) -> DecodeError
fn clone(&self) -> DecodeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
impl Eq for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for DecodeError
impl PartialEq for DecodeError
Source§fn eq(&self, other: &DecodeError) -> bool
fn eq(&self, other: &DecodeError) -> bool
self and other values to be equal, and is used by ==.