pub struct ResolvedValueRangeConstraint<T> {
pub min: Option<T>,
pub max: Option<T>,
pub exact: Option<T>,
pub ideal: Option<T>,
}
Expand description
A constraint specifying a range of accepted values.
Corresponding W3C spec types as per “Media Capture and Streams”:
ConstrainDouble
=>ResolvedValueRangeConstraint<f64>
ConstrainULong
=>ResolvedValueRangeConstraint<u64>
Fields§
§min: Option<T>
The minimum legal value of this property.
This is a required value.
max: Option<T>
The maximum legal value of this property.
This is a required value.
exact: Option<T>
The exact required value for this property.
This is a required value.
ideal: Option<T>
The ideal (target) value for this property.
This is an optional value.
Implementations§
Source§impl<T> ResolvedValueRangeConstraint<T>
impl<T> ResolvedValueRangeConstraint<T>
Sourcepub fn exact<U>(self, exact: U) -> Self
pub fn exact<U>(self, exact: U) -> Self
Consumes self
, returning a corresponding constraint
with the exact required value set to exact
.
Sourcepub fn ideal<U>(self, ideal: U) -> Self
pub fn ideal<U>(self, ideal: U) -> Self
Consumes self
, returning a corresponding constraint
with the ideal required value set to ideal
.
Sourcepub fn min<U>(self, min: U) -> Self
pub fn min<U>(self, min: U) -> Self
Consumes self
, returning a corresponding constraint
with the minimum required value set to min
.
Sourcepub fn max<U>(self, max: U) -> Self
pub fn max<U>(self, max: U) -> Self
Consumes self
, returning a corresponding constraint
with the maximum required value set to max
.
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Returns true
if value.is_some()
is true
for any of its required values,
otherwise false
.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if value.is_none()
is true
for all of its values,
otherwise false
.
Sourcepub fn to_required_only(&self) -> Selfwhere
T: Clone,
pub fn to_required_only(&self) -> Selfwhere
T: Clone,
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.
Trait Implementations§
Source§impl<T: Clone> Clone for ResolvedValueRangeConstraint<T>
impl<T: Clone> Clone for ResolvedValueRangeConstraint<T>
Source§fn clone(&self) -> ResolvedValueRangeConstraint<T>
fn clone(&self) -> ResolvedValueRangeConstraint<T>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug> Debug for ResolvedValueRangeConstraint<T>
impl<T: Debug> Debug for ResolvedValueRangeConstraint<T>
Source§impl<T> Default for ResolvedValueRangeConstraint<T>
impl<T> Default for ResolvedValueRangeConstraint<T>
Source§impl<'de, T> Deserialize<'de> for ResolvedValueRangeConstraint<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ResolvedValueRangeConstraint<T>where
T: Deserialize<'de>,
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<T> Display for ResolvedValueRangeConstraint<T>where
T: Debug,
impl<T> Display for ResolvedValueRangeConstraint<T>where
T: Debug,
Source§impl<'a> FitnessDistance<Option<&'a String>> for ResolvedValueRangeConstraint<f64>
impl<'a> FitnessDistance<Option<&'a String>> for ResolvedValueRangeConstraint<f64>
Source§impl<'a> FitnessDistance<Option<&'a String>> for ResolvedValueRangeConstraint<u64>
impl<'a> FitnessDistance<Option<&'a String>> for ResolvedValueRangeConstraint<u64>
Source§impl<'a> FitnessDistance<Option<&'a bool>> for ResolvedValueRangeConstraint<f64>
impl<'a> FitnessDistance<Option<&'a bool>> for ResolvedValueRangeConstraint<f64>
Source§impl<'a> FitnessDistance<Option<&'a bool>> for ResolvedValueRangeConstraint<u64>
impl<'a> FitnessDistance<Option<&'a bool>> for ResolvedValueRangeConstraint<u64>
Source§impl<'a> FitnessDistance<Option<&'a f64>> for ResolvedValueRangeConstraint<f64>
impl<'a> FitnessDistance<Option<&'a f64>> for ResolvedValueRangeConstraint<f64>
Source§impl<'a> FitnessDistance<Option<&'a f64>> for ResolvedValueRangeConstraint<u64>
impl<'a> FitnessDistance<Option<&'a f64>> for ResolvedValueRangeConstraint<u64>
Source§impl<'a> FitnessDistance<Option<&'a i64>> for ResolvedValueRangeConstraint<f64>
impl<'a> FitnessDistance<Option<&'a i64>> for ResolvedValueRangeConstraint<f64>
Source§impl<'a> FitnessDistance<Option<&'a i64>> for ResolvedValueRangeConstraint<u64>
impl<'a> FitnessDistance<Option<&'a i64>> for ResolvedValueRangeConstraint<u64>
Source§impl<T> From<ResolvedValueRangeConstraint<T>> for ValueRangeConstraint<T>
impl<T> From<ResolvedValueRangeConstraint<T>> for ValueRangeConstraint<T>
Source§fn from(constraint: ResolvedValueRangeConstraint<T>) -> Self
fn from(constraint: ResolvedValueRangeConstraint<T>) -> Self
Source§impl From<ResolvedValueRangeConstraint<f64>> for MediaTrackConstraint
impl From<ResolvedValueRangeConstraint<f64>> for MediaTrackConstraint
Source§fn from(constraint: ResolvedValueRangeConstraint<f64>) -> Self
fn from(constraint: ResolvedValueRangeConstraint<f64>) -> 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 MediaTrackConstraint
impl From<ResolvedValueRangeConstraint<u64>> for MediaTrackConstraint
Source§fn from(constraint: ResolvedValueRangeConstraint<u64>) -> Self
fn from(constraint: ResolvedValueRangeConstraint<u64>) -> 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<T: PartialEq> PartialEq for ResolvedValueRangeConstraint<T>
impl<T: PartialEq> PartialEq for ResolvedValueRangeConstraint<T>
Source§fn eq(&self, other: &ResolvedValueRangeConstraint<T>) -> bool
fn eq(&self, other: &ResolvedValueRangeConstraint<T>) -> bool
self
and other
values to be equal, and is used by ==
.Source§impl<T> Serialize for ResolvedValueRangeConstraint<T>where
T: Serialize,
impl<T> Serialize for ResolvedValueRangeConstraint<T>where
T: Serialize,
impl<T: Eq> Eq for ResolvedValueRangeConstraint<T>
impl<T> StructuralPartialEq for ResolvedValueRangeConstraint<T>
Auto Trait Implementations§
impl<T> Freeze for ResolvedValueRangeConstraint<T>where
T: Freeze,
impl<T> RefUnwindSafe for ResolvedValueRangeConstraint<T>where
T: RefUnwindSafe,
impl<T> Send for ResolvedValueRangeConstraint<T>where
T: Send,
impl<T> Sync for ResolvedValueRangeConstraint<T>where
T: Sync,
impl<T> Unpin for ResolvedValueRangeConstraint<T>where
T: Unpin,
impl<T> UnwindSafe for ResolvedValueRangeConstraint<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.