pub struct Reservation { /* private fields */ }Expand description
One track’s standing claim on an Allocator, held for as long as the sender
that took it is publishing.
Separate from the Consumer that reads the slice, because the two have opposite
lifetimes: read handles are cloned around and dropped freely, while the claim itself
has to outlive every one of them or the sender silently stops claiming anything.
Implementations§
Source§impl Reservation
impl Reservation
Sourcepub fn peek(&self) -> Option<Rate>
pub fn peek(&self) -> Option<Rate>
This reservation’s slice right now.
Stateless, unlike Consumer::changed, which carries a cursor over what it last
reported and so needs a handle of its own.
Sourcepub fn consumer(&self) -> Consumer
pub fn consumer(&self) -> Consumer
A handle reading this reservation’s current slice of the estimate.
Cloneable and independent of the reservation: once the reservation is dropped
these report None, the same “hold your rate” a track nobody is watching reports.
Sourcepub fn update(&self, max: Rate)
pub fn update(&self, max: Rate)
Change the ceiling, keeping the same claim.
For a sender whose ceiling genuinely moved: an encoder reopening at a resolution it negotiated with the device, not an encoder observing its own output. A reservation that followed the rate a VBR source happens to be sending would hand the room away every time the picture went still, and not have it back when the picture moved again.
Does nothing once every Allocator is gone, since there is then nothing left
dividing anything; a reader learns that from its consumer.