Skip to main content

FramerOut

Enum FramerOut 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Header

The stream’s header, with its exact wire bytes (stream-type field included).

Fields

§header: DataStreamHeaderKind

The decoded header.

§raw: Bytes

The header’s wire bytes, including the stream-type field.

§

Object

A complete object, with its exact wire bytes.

Fields

§meta: ObjectMeta

The object’s framing, without its payload.

§raw: Bytes

The 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: BypassReason

Why parsing stopped.

§fixup_owed: bool

Whether an elide fix-up was still owed when parsing stopped.

true means the remainder of this stream cannot be renumbered and the destination must be reset rather than forwarded — the bytes still in flight decode to Object IDs one ahead of what was actually delivered.

§

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.

Trait Implementations§

Source§

impl Debug for FramerOut

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more