pub struct Consumer<T> { /* private fields */ }Expand description
Consumes a JSON value from a track, reconstructing it from snapshots and deltas.
Implementations§
Source§impl<T: DeserializeOwned> Consumer<T>
impl<T: DeserializeOwned> Consumer<T>
Sourcepub fn new(track: TrackConsumer) -> Self
pub fn new(track: TrackConsumer) -> Self
Create a consumer reading from the given track subscriber.
Sourcepub async fn next(&mut self) -> Result<Option<T>>where
T: Unpin,
pub async fn next(&mut self) -> Result<Option<T>>where
T: Unpin,
Get the next reconstructed value, or None once the track ends.
Sourcepub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Result<Option<T>>>
pub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Result<Option<T>>>
Poll for the next reconstructed value, without blocking.
Jumps to the newest group, reads its snapshot, and applies deltas in order, yielding the reconstructed value after each frame. Switching to a newer group discards the older one.
Auto Trait Implementations§
impl<T> Freeze for Consumer<T>
impl<T> RefUnwindSafe for Consumer<T>
impl<T> Send for Consumer<T>
impl<T> Sync for Consumer<T>
impl<T> Unpin for Consumer<T>
impl<T> UnsafeUnpin for Consumer<T>
impl<T> UnwindSafe for Consumer<T>
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