Struct zbus::OwnedMatchRule
source · pub struct OwnedMatchRule(_);
Expand description
Owned sibling of MatchRule
.
Implementations§
Methods from Deref<Target = MatchRule<'static>>§
sourcepub fn msg_type(&self) -> Option<MessageType>
pub fn msg_type(&self) -> Option<MessageType>
The message type, if set.
sourcepub fn interface(&self) -> Option<&InterfaceName<'_>>
pub fn interface(&self) -> Option<&InterfaceName<'_>>
The interfac, if set.
sourcepub fn member(&self) -> Option<&MemberName<'_>>
pub fn member(&self) -> Option<&MemberName<'_>>
The member name if set.
sourcepub fn path_spec(&self) -> Option<&MatchRulePathSpec<'_>>
pub fn path_spec(&self) -> Option<&MatchRulePathSpec<'_>>
The path or path namespace, if set.
sourcepub fn destination(&self) -> Option<&UniqueName<'_>>
pub fn destination(&self) -> Option<&UniqueName<'_>>
The destination, if set.
sourcepub fn arg_paths(&self) -> &[(u8, ObjectPath<'_>)]
pub fn arg_paths(&self) -> &[(u8, ObjectPath<'_>)]
The argument paths.
sourcepub fn arg0namespace(&self) -> Option<&InterfaceName<'_>>
pub fn arg0namespace(&self) -> Option<&InterfaceName<'_>>
Match messages whose first argument is within the specified namespace.
Note that while the spec allows this to be any string that’s a valid bus or interface name
except that it can have no .
, we only allow valid interface names. The reason is not only
to keep things simple and type safe at the same time but also for the fact that use cases of
only matching on the first component of a bus or interface name are unheard of.
sourcepub fn matches(&self, msg: &Message) -> Result<bool>
pub fn matches(&self, msg: &Message) -> Result<bool>
Match the given message against this rule.
Caveats
Since this method doesn’t have any knowledge of names on the bus (or even connection to a bus) matching always succeeds for:
sender
in the rule (if set) that is a well-known name. Thesender
on a message is always a unique name.destination
in the rule whendestination
on themsg
is a well-known name. Thedestination
on match rule is always a unique name.
Trait Implementations§
source§impl Clone for OwnedMatchRule
impl Clone for OwnedMatchRule
source§fn clone(&self) -> OwnedMatchRule
fn clone(&self) -> OwnedMatchRule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OwnedMatchRule
impl Debug for OwnedMatchRule
source§impl Deref for OwnedMatchRule
impl Deref for OwnedMatchRule
source§impl<'de> Deserialize<'de> for OwnedMatchRule
impl<'de> Deserialize<'de> for OwnedMatchRule
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>,
source§impl<'unowned, 'owned: 'unowned> From<&'owned OwnedMatchRule> for MatchRule<'unowned>
impl<'unowned, 'owned: 'unowned> From<&'owned OwnedMatchRule> for MatchRule<'unowned>
source§fn from(rule: &'owned OwnedMatchRule) -> Self
fn from(rule: &'owned OwnedMatchRule) -> Self
source§impl From<MatchRule<'_>> for OwnedMatchRule
impl From<MatchRule<'_>> for OwnedMatchRule
source§impl From<OwnedMatchRule> for MatchRule<'static>
impl From<OwnedMatchRule> for MatchRule<'static>
source§fn from(o: OwnedMatchRule) -> Self
fn from(o: OwnedMatchRule) -> Self
source§impl Hash for OwnedMatchRule
impl Hash for OwnedMatchRule
source§impl PartialEq<MatchRule<'_>> for OwnedMatchRule
impl PartialEq<MatchRule<'_>> for OwnedMatchRule
source§impl PartialEq<OwnedMatchRule> for OwnedMatchRule
impl PartialEq<OwnedMatchRule> for OwnedMatchRule
source§fn eq(&self, other: &OwnedMatchRule) -> bool
fn eq(&self, other: &OwnedMatchRule) -> bool
self
and other
values to be equal, and is used
by ==
.