Struct dbus::message::MatchRule

source ·
pub struct MatchRule<'a> {
    pub msg_type: Option<MessageType>,
    pub sender: Option<BusName<'a>>,
    pub strict_sender: bool,
    pub path: Option<Path<'a>>,
    pub path_is_namespace: bool,
    pub interface: Option<Interface<'a>>,
    pub member: Option<Member<'a>>,
    pub eavesdrop: bool,
    /* private fields */
}
Expand description

A “match rule”, that can match Messages on its headers.

A field set to “None” means no filter for that header, a field set to “Some(_)” must match exactly.

Fields§

§msg_type: Option<MessageType>

Match on message type (you typically want to do this)

§sender: Option<BusName<'a>>

Match on message sender

§strict_sender: bool

If false (the default), match if sender could possibly match, due to mismatch between unique names and taken bus names

§path: Option<Path<'a>>

Match on message object path

§path_is_namespace: bool

If true, will match all subpaths to the path as well as the path itself. Defaults to false.

§interface: Option<Interface<'a>>

Match on message interface

§member: Option<Member<'a>>

Match on message member (signal or method name)

§eavesdrop: bool

If true, also receive messages not intended for us. Defaults to false.

Implementations§

Make a string which you can use in the call to “add_match”.

Returns whether or not the message matches the rule.

Create a new struct which matches every message.

Create a new struct which matches every incoming method call message.

Create a new struct which matches signals on the interface and member name.

Returns a clone with no borrowed references

Enables eavesdropping for the generated message. You probably want to use BecomeMonitor instead

Sets the MatchRule to match on the message sender

Sets the MatchRule to match on the message sender and be strict

Sets the MatchRule to match on the message path and treat it as a namespace

Sets the MatchRule to match on the message path

Sets the MatchRule to match on the message interface

Sets the MatchRule to match on the message member

Sets the MatchRule to match on the message type. This will usually be "signal"

Tries parsing a MatchRule from a String. Please note however that not all features supported by DBus are supported by dbus-rs (yet). args and destinations are not supported yet.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.