pub struct Consumer<T> { /* private fields */ }Expand description
Consumes a sliding window of JSON records from a track, yielding one event per change.
A Decoder that owns its track: it reads groups, starts a cold DEFLATE window at each
boundary, and turns each group’s header into just the changes this reader has not been told
about. When something else already owns the track, use the Decoder directly.
Group rolls never surface. A publisher rolls for compression’s sake, and a header restating the
window yields nothing for records already delivered, so this reads as one continuous stream of
Events regardless of how the publisher framed them.
Implementations§
Source§impl<T: DeserializeOwned> Consumer<T>
impl<T: DeserializeOwned> Consumer<T>
Sourcepub fn new(track: Subscriber, config: ConsumerConfig) -> Self
pub fn new(track: Subscriber, config: ConsumerConfig) -> Self
Create a consumer reading from the given track subscriber.
Sourcepub fn range(&self) -> Range<u64> ⓘ
pub fn range(&self) -> Range<u64> ⓘ
Absolute index of the oldest record in the window, and of the next to arrive.
Auto Trait Implementations§
impl<T> Freeze for Consumer<T>
impl<T> RefUnwindSafe for Consumer<T>where
Decoder<T>: RefUnwindSafe,
impl<T> Send for Consumer<T>
impl<T> Sync for Consumer<T>
impl<T> Unpin for Consumer<T>
impl<T> UnsafeUnpin for Consumer<T>where
Decoder<T>: UnsafeUnpin,
impl<T> UnwindSafe for Consumer<T>where
Decoder<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more