Struct async_rustbus::MatchRule [−][src]
pub struct MatchRule {
pub sender: Option<Arc<str>>,
pub path: Option<Arc<str>>,
pub path_namespace: Option<Arc<str>>,
pub interface: Option<Arc<str>>,
pub member: Option<Arc<str>>,
// some fields omitted
}Expand description
Represents a match for incoming signals.
Signals match a MatchRule if they match every field.
When one of the fields is None it is equivelent to a wildcard for that field,
causing that field to be matching for every signal.
MatchRule’s are ordered by their specificity.
If one MatchRule is ‘less than’ another, then it is more specific than the other one.
See the Ord impl for details.
Fields
sender: Option<Arc<str>>Checks against the sender of the signal.
path: Option<Arc<str>>Matches against the object path of the signal requiring an exact match (no children).
path and path_namespace cannot be used simultanously.
path_namespace: Option<Arc<str>>Matches against the object path of the signal.
It accepts an exact match, or a child of path_namespace.
path and path_namespace cannot be used simultanously.
interface: Option<Arc<str>>Matches against the interface of the signal.
member: Option<Arc<str>>Matches against the signal member.
Implementations
Returns true if the message is a signal and matches the rule.
Returns the org.freedesktop.DBus.AddMatch match rule string.
Trait Implementations
MatchRules are ordered by their specificity.
If one match rule is ‘less than’ another then it is more specific than the other.
When evaluating specificity the following steps are taken:
- If one rule has
Somesenderand the otherNonethen, the former is less than the latter. Otherwise continue to the next step. - If one rule has
Somepathand the otherNonethen, the former is less than the latter. Otherwise continue to the next step. - If one rule has
Somepath_namespaceand the otherNonethen, the former is less than the latter. Otherwise continue to the next step. - If both rules have
Somepath_namespaceand one is a subset of the other than the former is less than the latter. Otherwise continue to the next step. - If one rule has
Someinterfaceand the otherNonethen, the former is less than the latter. Otherwise continue to the next step. - If one rule has
Somememberand the otherNonethen, the former is less than the latter. Otherwise continue to the next step. - Compare
senderfield. If not equal return theOrdering, otherwise continue to the next step. - Compare
pathfield. If not equal return theOrdering, otherwise continue to the next step. - Compare
path_namespacefield. If not equal return theOrdering, otherwise continue to the next step. - Compare
interfacefield. If not equal return theOrdering, otherwise continue to the next step. - Compare
memberfield, and return the result.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for MatchRuleimpl UnwindSafe for MatchRuleBlanket Implementations
Mutably borrows from an owned value. Read more