pub enum ValueRangeConstraint<T> {
Bare(T),
Constraint(ResolvedValueRangeConstraint<T>),
}
Expand description
A bare value or constraint specifying a range of accepted values.
§W3C Spec Compliance
There exists no direct corresponding type in the
W3C “Media Capture and Streams” spec,
since the ValueConstraint<T>
type aims to be a generalization over
multiple types in the spec.
Rust | W3C |
---|---|
ValueRangeConstraint<u64> | ConstrainULong |
ValueRangeConstraint<f64> | ConstrainDouble |
Variants§
Bare(T)
A bare-valued media track constraint.
Constraint(ResolvedValueRangeConstraint<T>)
A fully-qualified media track constraint.
Implementations§
Source§impl<T> ValueRangeConstraint<T>where
T: Clone,
impl<T> ValueRangeConstraint<T>where
T: Clone,
Sourcepub fn to_resolved(
&self,
strategy: MediaTrackConstraintResolutionStrategy,
) -> ResolvedValueRangeConstraint<T>
pub fn to_resolved( &self, strategy: MediaTrackConstraintResolutionStrategy, ) -> ResolvedValueRangeConstraint<T>
Returns a resolved representation of the constraint with bare values resolved to fully-qualified constraints.
Sourcepub fn into_resolved(
self,
strategy: MediaTrackConstraintResolutionStrategy,
) -> ResolvedValueRangeConstraint<T>
pub fn into_resolved( self, strategy: MediaTrackConstraintResolutionStrategy, ) -> ResolvedValueRangeConstraint<T>
Consumes the constraint, returning a resolved representation of the constraint with bare values resolved to fully-qualified constraints.
Trait Implementations§
Source§impl<T: Clone> Clone for ValueRangeConstraint<T>
impl<T: Clone> Clone for ValueRangeConstraint<T>
Source§fn clone(&self) -> ValueRangeConstraint<T>
fn clone(&self) -> ValueRangeConstraint<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for ValueRangeConstraint<T>
impl<T: Debug> Debug for ValueRangeConstraint<T>
Source§impl<T> Default for ValueRangeConstraint<T>
impl<T> Default for ValueRangeConstraint<T>
Source§impl<'de, T> Deserialize<'de> for ValueRangeConstraint<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ValueRangeConstraint<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>,
Deserialize this value from the given Serde deserializer. Read more
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
Converts to this type from the input type.
Source§impl<T> From<T> for ValueRangeConstraint<T>
impl<T> From<T> for ValueRangeConstraint<T>
Source§impl From<ValueRangeConstraint<f64>> for MediaTrackConstraint
impl From<ValueRangeConstraint<f64>> for MediaTrackConstraint
Source§fn from(constraint: ValueRangeConstraint<f64>) -> Self
fn from(constraint: ValueRangeConstraint<f64>) -> Self
Converts to this type from the input type.
Source§impl From<ValueRangeConstraint<u64>> for MediaTrackConstraint
impl From<ValueRangeConstraint<u64>> for MediaTrackConstraint
Source§fn from(constraint: ValueRangeConstraint<u64>) -> Self
fn from(constraint: ValueRangeConstraint<u64>) -> Self
Converts to this type from the input type.
Source§impl<T: PartialEq> PartialEq for ValueRangeConstraint<T>
impl<T: PartialEq> PartialEq for ValueRangeConstraint<T>
Source§impl<T> Serialize for ValueRangeConstraint<T>where
T: Serialize,
impl<T> Serialize for ValueRangeConstraint<T>where
T: Serialize,
impl<T: Eq> Eq for ValueRangeConstraint<T>
impl<T> StructuralPartialEq for ValueRangeConstraint<T>
Auto Trait Implementations§
impl<T> Freeze for ValueRangeConstraint<T>where
T: Freeze,
impl<T> RefUnwindSafe for ValueRangeConstraint<T>where
T: RefUnwindSafe,
impl<T> Send for ValueRangeConstraint<T>where
T: Send,
impl<T> Sync for ValueRangeConstraint<T>where
T: Sync,
impl<T> Unpin for ValueRangeConstraint<T>where
T: Unpin,
impl<T> UnwindSafe for ValueRangeConstraint<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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.