pub struct Snapshot<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T: Serialize> Snapshot<T>
impl<T: Serialize> Snapshot<T>
Sourcepub fn poll_refresh(&self, waiter: &Waiter) -> Poll<Result<()>>
pub fn poll_refresh(&self, waiter: &Waiter) -> Poll<Result<()>>
Wait for a joiner to want a fresh group, then restate the value in one; see
moq_json::snapshot::Producer::poll_refresh.
A restatement is not a new value, so it measures neither jitter nor delay.
Sourcepub async fn refresh(&self) -> Result<()>
pub async fn refresh(&self) -> Result<()>
Wait for a joiner to want a fresh group, then restate the value in one; see
moq_json::snapshot::Producer::poll_refresh.
A restatement is not a new value, so it measures neither jitter nor delay.
Awaits poll_refresh.
Sourcepub fn update(&mut self, value: &T, timestamp: Timestamp) -> Result<()>
pub fn update(&mut self, value: &T, timestamp: Timestamp) -> Result<()>
Publish a new value at timestamp on the broadcast clock, superseding the previous one.
The value is written at that timestamp and measures the entry’s jitter and delay; one
ahead of now measures as zero delay. An unchanged value writes nothing and measures nothing.
Sourcepub fn finish(self) -> Result<()>
pub fn finish(self) -> Result<()>
Finish the track and retire its catalog entry.
Consumes the handle, so a write after finishing cannot be expressed. Leaving the entry advertising a closed track would only mislead a consumer that subscribed afterwards, so dropping the handle without finishing retires the entry too.