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
impl Constraint
pub fn has<S: Into<String>>( type_: ConstraintType, subject: S, present: bool ) -> Self
pub fn compare<S: Into<String>, V: ToVariant>( type_: ConstraintType, subject: S, value: V, equal: bool ) -> Self
pub fn matches<S: Into<String>>( type_: ConstraintType, subject: S, pattern: &str ) -> Self
pub fn in_range<S: Into<String>, V: ToVariant>( type_: ConstraintType, subject: S, low: V, high: V ) -> Self
pub fn in_list<S: Into<String>, V: ToVariant, I: Iterator<Item = V>>( type_: ConstraintType, subject: S, one_of: I ) -> Self
pub fn add_to(&self, interest: &ObjectInterest)
Trait Implementations§
source§impl Clone for Constraint
impl Clone for Constraint
source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Constraint
impl Debug for Constraint
source§impl<'de> Deserialize<'de> for Constraint
impl<'de> Deserialize<'de> for Constraint
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
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
impl From<Constraint> for Variant
source§fn from(v: Constraint) -> Variant
fn from(v: Constraint) -> Variant
Converts to this type from the input type.
source§impl FromVariant for Constraint
impl FromVariant for Constraint
source§impl Serialize for Constraint
impl Serialize for Constraint
source§impl StaticVariantType for Constraint
impl StaticVariantType for Constraint
source§fn static_variant_type() -> Cow<'static, VariantTy>
fn static_variant_type() -> Cow<'static, VariantTy>
Returns the
VariantType
corresponding to Self
.source§impl ToVariant for Constraint
impl ToVariant for Constraint
source§fn to_variant(&self) -> Variant
fn to_variant(&self) -> Variant
Returns a
Variant
clone of self
.Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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