pub struct Decoder<'d, T: Decode<C>, C: Copy = ()> { /* private fields */ }Expand description
Resumable decoder. Input, replay, field lookup, and owner release work are charged to the caller-provided budget. Its driver brand cannot be widened even when the scanner owns every input segment.
Error retirement charges input owners, field slots, and array elements. Fixed-schema scalar destruction and allocation metadata are constant work; an arbitrary user-provided materializer or destructor must uphold its own cooperative work contract. Dropping a decoder cancels it immediately.
Implementations§
Source§impl<'d, T: Decode> Decoder<'d, T>
impl<'d, T: Decode> Decoder<'d, T>
Source§impl<'d, T: Decode<C>, C: Copy> Decoder<'d, T, C>
impl<'d, T: Decode<C>, C: Copy> Decoder<'d, T, C>
Sourcepub fn try_feed(context: C) -> Result<Self, Create>
pub fn try_feed(context: C) -> Result<Self, Create>
Starts streaming directly into the final output representation.
Sourcepub fn push(self, segment: Shared<'d>) -> Transfer<Self, Push<'d>>
pub fn push(self, segment: Shared<'d>) -> Transfer<Self, Push<'d>>
Transfers one retained transport owner into the decoder.
Sourcepub fn take_bytes(&mut self) -> usize
pub fn take_bytes(&mut self) -> usize
Returns original input bytes retired by scanning or scanner-error cleanup since the previous call. Materialization and cancellation retain the caller’s remaining transport credit until its terminal settlement.
Sourcepub fn take_chunks(&mut self) -> Count
pub fn take_chunks(&mut self) -> Count
Returns original transport owners retired by scanning or scanner-error cleanup. Projected copies are never counted as new transport owners.