#[non_exhaustive]pub enum FramerOut {
Header {
header: DataStreamHeaderKind,
raw: Bytes,
},
Object {
meta: ObjectMeta,
raw: Bytes,
},
Passthrough(Bytes),
Bypassed {
reason: BypassReason,
fixup_owed: bool,
},
NeedMore,
Error(String),
}Expand description
One item produced by ObjectFramer::poll.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Header
The stream’s header, with its exact wire bytes (stream-type field included).
Fields
header: DataStreamHeaderKindThe decoded header.
raw: BytesThe header’s wire bytes, including the stream-type field.
Object
A complete object, with its exact wire bytes.
Fields
meta: ObjectMetaThe object’s framing, without its payload.
raw: BytesThe object’s complete wire bytes, framing and payload.
Passthrough(Bytes)
Bytes the framer is forwarding without interpreting them: an object larger than the buffer cap, a fetch stream on a draft whose fetch objects are not addressed, or any stream the framer has stopped parsing. These bytes are not individually addressable.
Bypassed
The framer has stopped parsing this stream.
Carries no bytes, so ObjectFramer::poll’s concatenation
invariant is untouched: this item contributes nothing to the
reconstruction. Emitted exactly once per stream.
Ordering: immediately after the item the bypass was decided
during, not in place of it. Every one of latch_bypass’s call
sites returns a different FramerOut from the same poll() —
the two header sites fall through to Self::Header, the
measuring-reach sites return Self::Passthrough, the decode and
fix-up sites return Self::Error — and poll() returns one
item. The variant is therefore deferred: latch_bypass stores
a pending_bypass: Option<BypassReason>, and poll() drains it at
the top of its next call, before anything else.
Fields
reason: BypassReasonWhy parsing stopped.
NeedMore
Not enough buffered bytes to produce another item.
Error(String)
The stream could not be parsed. The framer switches to
Passthrough for the remainder of the stream
and never reports a second error.