Struct zbus::MatchRuleBuilder

source ·
pub struct MatchRuleBuilder<'m>(_);
Expand description

Builder for MatchRule.

This is created by MatchRule::builder.

Implementations§

source§

impl<'m> MatchRuleBuilder<'m>

source

pub fn build(self) -> MatchRule<'m>

Build the MatchRule.

source

pub fn sender<B>(self, sender: B) -> Result<Self>where B: TryInto<BusName<'m>>, B::Error: Into<Error>,

Set the sender.

source

pub fn msg_type(self, msg_type: MessageType) -> Self

Set the message type.

source

pub fn interface<I>(self, interface: I) -> Result<Self>where I: TryInto<InterfaceName<'m>>, I::Error: Into<Error>,

Set the interface.

source

pub fn member<M>(self, member: M) -> Result<Self>where M: TryInto<MemberName<'m>>, M::Error: Into<Error>,

Set the member.

source

pub fn path<P>(self, path: P) -> Result<Self>where P: TryInto<ObjectPath<'m>>, P::Error: Into<Error>,

Set the path.

Note: Since both a path and a path namespace are not allowed to appear in a match rule at the same time, this overrides any path namespace previously set.

source

pub fn path_namespace<P>(self, path_namespace: P) -> Result<Self>where P: TryInto<ObjectPath<'m>>, P::Error: Into<Error>,

Set the path namespace.

Note: Since both a path and a path namespace are not allowed to appear in a match rule at the same time, this overrides any path previously set.

source

pub fn destination<B>(self, destination: B) -> Result<Self>where B: TryInto<UniqueName<'m>>, B::Error: Into<Error>,

Set the destination.

source

pub fn add_arg<S>(self, arg: S) -> Result<Self>where S: Into<Str<'m>>,

Append an arguments.

Use this in instead of MatchRuleBuilder::arg if you want to sequentially add args.

Errors

Error::InvalidMatchRule on attempt to add the 65th argument.

source

pub fn arg<S>(self, idx: u8, arg: S) -> Result<Self>where S: Into<Str<'m>>,

Add an argument of a specified index.

Errors

Error::InvalidMatchRule if idx is greater than 64.

source

pub fn add_arg_path<P>(self, arg_path: P) -> Result<Self>where P: TryInto<ObjectPath<'m>>, P::Error: Into<Error>,

Append a path argument.

Use this in instead of MatchRuleBuilder::arg_path if you want to sequentially add args.

Errors

Error::InvalidMatchRule on attempt to add the 65th path argument.

source

pub fn arg_path<P>(self, idx: u8, arg_path: P) -> Result<Self>where P: TryInto<ObjectPath<'m>>, P::Error: Into<Error>,

Add a path argument of a specified index.

Errors

Error::InvalidMatchRule if idx is greater than 64.

source

pub fn arg0namespace<I>(self, namespace: I) -> Result<Self>where I: TryInto<InterfaceName<'m>>, I::Error: Into<Error>,

Set 0th argument’s namespace.

Auto Trait Implementations§

§

impl<'m> RefUnwindSafe for MatchRuleBuilder<'m>

§

impl<'m> Send for MatchRuleBuilder<'m>

§

impl<'m> Sync for MatchRuleBuilder<'m>

§

impl<'m> Unpin for MatchRuleBuilder<'m>

§

impl<'m> UnwindSafe for MatchRuleBuilder<'m>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

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