pub enum ResolvedMediaTrackConstraint {
Empty(EmptyConstraint),
IntegerRange(ResolvedValueRangeConstraint<u64>),
FloatRange(ResolvedValueRangeConstraint<f64>),
Bool(ResolvedValueConstraint<bool>),
StringSequence(ResolvedValueSequenceConstraint<String>),
String(ResolvedValueConstraint<String>),
}
Expand description
A single constraint value for a MediaStreamTrack
object
with its potential bare value either resolved to an exact
or ideal
constraint.
§W3C Spec Compliance
There exists no corresponding type in the W3C “Media Capture and Streams” spec.
Variants§
Empty(EmptyConstraint)
An empty constraint.
IntegerRange(ResolvedValueRangeConstraint<u64>)
An integer-valued media track range constraint.
FloatRange(ResolvedValueRangeConstraint<f64>)
An floating-point-valued media track range constraint.
Bool(ResolvedValueConstraint<bool>)
A single boolean-valued media track constraint.
StringSequence(ResolvedValueSequenceConstraint<String>)
A sequence of string-valued media track constraints.
String(ResolvedValueConstraint<String>)
A single string-valued media track constraint.
Implementations§
Source§impl ResolvedMediaTrackConstraint
impl ResolvedMediaTrackConstraint
Sourcepub fn exact_from(setting: MediaTrackSetting) -> Self
pub fn exact_from(setting: MediaTrackSetting) -> Self
Creates a resolved media track constraint by resolving
bare values to exact constraints: { exact: bare }
.
Sourcepub fn ideal_from(setting: MediaTrackSetting) -> Self
pub fn ideal_from(setting: MediaTrackSetting) -> Self
Creates a resolved media track constraint by resolving
bare values to ideal constraints: { ideal: bare }
.
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Returns true
if self
is required, otherwise false
.
Sourcepub fn to_required_only(&self) -> Self
pub fn to_required_only(&self) -> Self
Returns a corresponding constraint containing only required values.
Sourcepub fn into_required_only(self) -> Self
pub fn into_required_only(self) -> Self
Consumes `self, returning a corresponding constraint containing only required values.
Sourcepub fn to_sanitized(&self) -> Option<SanitizedMediaTrackConstraint>
pub fn to_sanitized(&self) -> Option<SanitizedMediaTrackConstraint>
Returns a corresponding sanitized constraint
if self
is non-empty, otherwise None
.
Sourcepub fn into_sanitized(self) -> Option<SanitizedMediaTrackConstraint>
pub fn into_sanitized(self) -> Option<SanitizedMediaTrackConstraint>
Consumes self
, returning a corresponding sanitized constraint
if self
is non-empty, otherwise None
.
Trait Implementations§
Source§impl Clone for ResolvedMediaTrackConstraint
impl Clone for ResolvedMediaTrackConstraint
Source§fn clone(&self) -> ResolvedMediaTrackConstraint
fn clone(&self) -> ResolvedMediaTrackConstraint
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ResolvedMediaTrackConstraint
impl Debug for ResolvedMediaTrackConstraint
Source§impl<'de> Deserialize<'de> for ResolvedMediaTrackConstraint
impl<'de> Deserialize<'de> for ResolvedMediaTrackConstraint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> FitnessDistance<Option<&'a MediaTrackSetting>> for ResolvedMediaTrackConstraint
impl<'a> FitnessDistance<Option<&'a MediaTrackSetting>> for ResolvedMediaTrackConstraint
Source§type Error = SettingFitnessDistanceError
type Error = SettingFitnessDistanceError
Source§fn fitness_distance(
&self,
setting: Option<&'a MediaTrackSetting>,
) -> Result<f64, Self::Error>
fn fitness_distance( &self, setting: Option<&'a MediaTrackSetting>, ) -> Result<f64, Self::Error>
Source§impl From<ResolvedValueConstraint<String>> for ResolvedMediaTrackConstraint
impl From<ResolvedValueConstraint<String>> for ResolvedMediaTrackConstraint
Source§fn from(constraint: ResolvedValueConstraint<String>) -> Self
fn from(constraint: ResolvedValueConstraint<String>) -> Self
Source§impl From<ResolvedValueConstraint<bool>> for ResolvedMediaTrackConstraint
impl From<ResolvedValueConstraint<bool>> for ResolvedMediaTrackConstraint
Source§fn from(constraint: ResolvedValueConstraint<bool>) -> Self
fn from(constraint: ResolvedValueConstraint<bool>) -> Self
Source§impl From<ResolvedValueRangeConstraint<f64>> for ResolvedMediaTrackConstraint
impl From<ResolvedValueRangeConstraint<f64>> for ResolvedMediaTrackConstraint
Source§fn from(constraint: ResolvedValueRangeConstraint<f64>) -> Self
fn from(constraint: ResolvedValueRangeConstraint<f64>) -> Self
Source§impl From<ResolvedValueRangeConstraint<u64>> for ResolvedMediaTrackConstraint
impl From<ResolvedValueRangeConstraint<u64>> for ResolvedMediaTrackConstraint
Source§fn from(constraint: ResolvedValueRangeConstraint<u64>) -> Self
fn from(constraint: ResolvedValueRangeConstraint<u64>) -> Self
Source§impl From<ResolvedValueSequenceConstraint<String>> for ResolvedMediaTrackConstraint
impl From<ResolvedValueSequenceConstraint<String>> for ResolvedMediaTrackConstraint
Source§fn from(constraint: ResolvedValueSequenceConstraint<String>) -> Self
fn from(constraint: ResolvedValueSequenceConstraint<String>) -> Self
Source§impl PartialEq for ResolvedMediaTrackConstraint
impl PartialEq for ResolvedMediaTrackConstraint
Source§fn eq(&self, other: &ResolvedMediaTrackConstraint) -> bool
fn eq(&self, other: &ResolvedMediaTrackConstraint) -> bool
self
and other
values to be equal, and is used by ==
.