pub struct Bound { /* private fields */ }Expand description
The selection state carried from one tick to the next.
Implementations§
Source§impl Bound
impl Bound
Sourcepub fn new(adaptation: Adaptation) -> Self
pub fn new(adaptation: Adaptation) -> Self
Creates a bound with nothing learned yet.
Sourcepub fn decide(
&mut self,
rungs: &[Rung],
current: Option<&str>,
on_screen: Option<&str>,
constraints: &Constraints,
sample: &NetworkSample,
now: Instant,
) -> Option<String>
pub fn decide( &mut self, rungs: &[Rung], current: Option<&str>, on_screen: Option<&str>, constraints: &Constraints, sample: &NetworkSample, now: Instant, ) -> Option<String>
Picks the rendition to play.
rungs is the catalog’s video renditions, most expensive first: a
higher index must never cost more. current is the one last asked
for, on screen or on its way, and the hold timers weigh the target
against it. on_screen is the one playing. While the two
differ, a switch is in flight and loss is not followed: the loss then is
the old rendition’s, and a step on it would stack onto the first.
Returns None only when rungs is empty.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bound
impl RefUnwindSafe for Bound
impl Send for Bound
impl Sync for Bound
impl Unpin for Bound
impl UnsafeUnpin for Bound
impl UnwindSafe for Bound
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