pub struct Decoder<T> { /* private fields */ }Expand description
Reconstructs window events from frame payloads.
The track-free core of Consumer. It tracks indices, not contents: it knows
where the window starts and how far it has delivered, which is all it needs to turn a header into
the pushes, pops, and skips the reader has not already been told about.
Group rolls are invisible here on purpose. A header restates the window, and this decoder emits only what is new, so a reader sees one continuous stream of edits no matter how often the publisher rolled for compression’s sake.
Implementations§
Source§impl<T> Decoder<T>
impl<T> Decoder<T>
Sourcepub fn new(config: ConsumerConfig) -> Self
pub fn new(config: ConsumerConfig) -> Self
Create a decoder that has not yet been positioned by a group header.
Sourcepub fn next_event(&mut self) -> Option<Event<T>>
pub fn next_event(&mut self) -> Option<Event<T>>
Take the next event produced by the frames decoded so far.
Returns None once the queue is drained, which is a request for more frames rather than the
end of anything: Group::decode refills it. Deliberately not Iterator, whose
None a caller would reasonably read as exhausted.