Struct wireplumber::registry::Constraint

source ·
pub struct Constraint {
    pub type_: ConstraintType,
    pub subject: String,
    pub verb: ConstraintVerb,
    pub value: Option<Variant>,
}

Fields§

§type_: ConstraintType§subject: String§verb: ConstraintVerb§value: Option<Variant>

Implementations§

source§

impl Constraint

source

pub fn has<S: Into<String>>( type_: ConstraintType, subject: S, present: bool ) -> Self

source

pub fn compare<S: Into<String>, V: ToVariant>( type_: ConstraintType, subject: S, value: V, equal: bool ) -> Self

source

pub fn matches<S: Into<String>>( type_: ConstraintType, subject: S, pattern: &str ) -> Self

source

pub fn in_range<S: Into<String>, V: ToVariant>( type_: ConstraintType, subject: S, low: V, high: V ) -> Self

source

pub fn in_list<S: Into<String>, V: ToVariant, I: Iterator<Item = V>>( type_: ConstraintType, subject: S, one_of: I ) -> Self

source

pub fn add_to(&self, interest: &ObjectInterest)

Trait Implementations§

source§

impl Clone for Constraint

source§

fn clone(&self) -> Constraint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Constraint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Constraint

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Constraint> for Variant

source§

fn from(v: Constraint) -> Variant

Converts to this type from the input type.
source§

impl FromVariant for Constraint

source§

fn from_variant(variant: &Variant) -> Option<Self>

Tries to extract a value. Read more
source§

impl Serialize for Constraint

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl StaticVariantType for Constraint

source§

fn static_variant_type() -> Cow<'static, VariantTy>

Returns the VariantType corresponding to Self.
source§

impl ToVariant for Constraint

source§

fn to_variant(&self) -> Variant

Returns a Variant clone of self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,