#[non_exhaustive]pub enum BypassReason {
UnsupportedSubgroupStreamType,
NoFetchObjectCodec,
FetchGroupOrderUnknown,
ObjectBeyondMeasuringReach,
DecodeError,
}Expand description
Why ObjectFramer stopped parsing a stream.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedSubgroupStreamType
The header decoded but the object reader rejected this subgroup stream type.
NoFetchObjectCodec
This build compiled no object reader for the fetch stream’s draft, so the stream is forwarded intact from its header on.
Defensive rather than routine. The stream header decodes first and
fails first on a draft that was not compiled, reporting
Self::DecodeError, so a session reaches this only if the header
dispatch and the object-reader dispatch ever disagree about which
drafts this binary speaks.
It used to mean something else and much more common: a fetch stream
on any of drafts 15-19, none of which this crate would address. Three
of those five are now framed, and the two that are not report
Self::FetchGroupOrderUnknown, which says why.
FetchGroupOrderUnknown
A fetch stream on draft-18 or draft-19 naming a request this session never saw asked for.
Those two drafts write an Object’s Group ID as a difference from the previous Object’s, and the fetch’s Group Order decides which way the difference points — draft-19 Section 11.4.4.1: “If the Group Order is Ascending, the Group ID is the prior Object’s Group ID plus the Group ID Delta + 1. If the Group Order is Descending, the Group ID is the prior Object’s Group ID minus the (Group ID Delta + 1).”
Nothing on the data stream states the order. It is on the FETCH the
stream answers — draft-19 Section 10.2.8: “If omitted from FETCH, the
receiver uses Ascending (0x1)” — so a session that carried the FETCH
knows it, files it under that Request ID, and hands it to the framer
when the response stream opens. See
FetchGroupOrders.
What is left for this variant is the stream whose FETCH never came past: a publisher answering a request nobody made, a session whose control plane is a byte pump because nothing frames its data either, or a hook that rewrote a FETCH into bytes that no longer decode.
Guessing would not fail loudly, which is why an unanswered stream is bypassed rather than read against the draft’s default. A descending stream read as ascending decodes every Object and every field of it; only the Group IDs are wrong, walking up where the publisher sent them walking down. Every event reported off this stream and every shaping rule keyed on a group would then be wrong with nothing to say so. The bytes are forwarded untouched instead.
ObjectBeyondMeasuringReach
An object could not be measured within the buffer cap’s reach.
DecodeError
A header or object failed to decode. Also reported as
FramerOut::Error.
Trait Implementations§
Source§impl Clone for BypassReason
impl Clone for BypassReason
Source§fn clone(&self) -> BypassReason
fn clone(&self) -> BypassReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more