zbus

Struct OwnedMatchRule

source
pub struct OwnedMatchRule(/* private fields */);
Expand description

Owned sibling of MatchRule.

Implementations§

source§

impl OwnedMatchRule

source

pub fn into_inner(self) -> MatchRule<'static>

Convert to the inner MatchRule, consuming self.

source

pub fn inner(&self) -> &MatchRule<'static>

Get a reference to the inner MatchRule.

Methods from Deref<Target = MatchRule<'static>>§

source

pub fn sender(&self) -> Option<&BusName<'_>>

The sender, if set.

source

pub fn msg_type(&self) -> Option<MessageType>

The message type, if set.

source

pub fn interface(&self) -> Option<&InterfaceName<'_>>

The interfac, if set.

source

pub fn member(&self) -> Option<&MemberName<'_>>

The member name if set.

source

pub fn path_spec(&self) -> Option<&MatchRulePathSpec<'_>>

The path or path namespace, if set.

source

pub fn destination(&self) -> Option<&UniqueName<'_>>

The destination, if set.

source

pub fn args(&self) -> &[(u8, Str<'_>)]

The arguments.

source

pub fn arg_paths(&self) -> &[(u8, ObjectPath<'_>)]

The argument paths.

source

pub fn arg0namespace(&self) -> Option<&InterfaceName<'_>>

👎Deprecated: use arg0ns instead

Match messages whose first argument is within the specified namespace.

This function is deprecated because the choice of InterfaceName was too restrictive.

source

pub fn arg0ns(&self) -> Option<&Str<'m>>

Match messages whose first argument is within the specified namespace.

source

pub fn to_owned(&self) -> MatchRule<'static>

Creates an owned clone of self.

source

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. The sender on a message is always a unique name.
  • destination in the rule when destination on the msg is a well-known name. The destination on match rule is always a unique name.

Trait Implementations§

source§

impl Clone for OwnedMatchRule

source§

fn clone(&self) -> OwnedMatchRule

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 OwnedMatchRule

source§

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

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

impl Deref for OwnedMatchRule

source§

type Target = MatchRule<'static>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for OwnedMatchRule

source§

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

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

impl<'unowned, 'owned: 'unowned> From<&'owned OwnedMatchRule> for MatchRule<'unowned>

source§

fn from(rule: &'owned OwnedMatchRule) -> Self

Converts to this type from the input type.
source§

impl From<MatchRule<'_>> for OwnedMatchRule

source§

fn from(rule: MatchRule<'_>) -> Self

Converts to this type from the input type.
source§

impl From<OwnedMatchRule> for MatchRule<'static>

source§

fn from(o: OwnedMatchRule) -> Self

Converts to this type from the input type.
source§

impl Hash for OwnedMatchRule

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<MatchRule<'_>> for OwnedMatchRule

source§

fn eq(&self, other: &MatchRule<'_>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for OwnedMatchRule

source§

fn eq(&self, other: &OwnedMatchRule) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for OwnedMatchRule

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

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

impl TryFrom<&str> for OwnedMatchRule

source§

type Error = Error

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

fn try_from(value: &str) -> Result<Self>

Performs the conversion.
source§

impl Type for OwnedMatchRule

source§

fn signature() -> Signature<'static>

Get the signature for the implementing type. Read more
source§

impl Eq for OwnedMatchRule

source§

impl StructuralPartialEq for OwnedMatchRule

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<'de, T> DynamicDeserialize<'de> for T
where T: Type + Deserialize<'de> + ?Sized,

source§

type Deserializer = PhantomData<T>

A DeserializeSeed implementation for this type.
source§

fn deserializer_for_signature<S>( signature: S, ) -> Result<<T as DynamicDeserialize<'de>>::Deserializer, Error>
where S: TryInto<Signature<'de>>, <S as TryInto<Signature<'de>>>::Error: Into<Error>,

Get a deserializer compatible with this signature.
source§

impl<T> DynamicType for T
where T: Type + ?Sized,

source§

fn dynamic_signature(&self) -> Signature<'_>

Get the signature for the implementing type. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

source§

type Output = T

Should always be Self
source§

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

source§

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>,

source§

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>,

source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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