Trait TieBreakingPolicy

Source
pub trait TieBreakingPolicy {
    // Required method
    fn select_candidate<'a, I>(&self, candidates: I) -> &'a MediaTrackSettings
       where I: IntoIterator<Item = &'a MediaTrackSettings>;
}
Expand description

A tie-breaking policy used for selecting a single preferred candidate from a set list of equally optimal setting candidates.

Required Methods§

Source

fn select_candidate<'a, I>(&self, candidates: I) -> &'a MediaTrackSettings
where I: IntoIterator<Item = &'a MediaTrackSettings>,

Selects a preferred candidate from a non-empty selection of optimal candidates.

As specified in step 6 of the SelectSettings algorithm: https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings

Select one settings dictionary from candidates, and return it as the result of the SelectSettings algorithm. The User Agent MUST use one with the smallest fitness distance, as calculated in step 3. If more than one settings dictionary have the smallest fitness distance, the User Agent chooses one of them based on system default property values and User Agent default property values.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§