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>
impl<'m> MatchRuleBuilder<'m>
sourcepub fn sender<B>(self, sender: B) -> Result<Self>where
B: TryInto<BusName<'m>>,
B::Error: Into<Error>,
pub fn sender<B>(self, sender: B) -> Result<Self>where B: TryInto<BusName<'m>>, B::Error: Into<Error>,
Set the sender.
sourcepub fn msg_type(self, msg_type: MessageType) -> Self
pub fn msg_type(self, msg_type: MessageType) -> Self
Set the message type.
sourcepub fn interface<I>(self, interface: I) -> Result<Self>where
I: TryInto<InterfaceName<'m>>,
I::Error: Into<Error>,
pub fn interface<I>(self, interface: I) -> Result<Self>where I: TryInto<InterfaceName<'m>>, I::Error: Into<Error>,
Set the interface.
sourcepub fn member<M>(self, member: M) -> Result<Self>where
M: TryInto<MemberName<'m>>,
M::Error: Into<Error>,
pub fn member<M>(self, member: M) -> Result<Self>where M: TryInto<MemberName<'m>>, M::Error: Into<Error>,
Set the member.
sourcepub fn path<P>(self, path: P) -> Result<Self>where
P: TryInto<ObjectPath<'m>>,
P::Error: Into<Error>,
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.
sourcepub fn path_namespace<P>(self, path_namespace: P) -> Result<Self>where
P: TryInto<ObjectPath<'m>>,
P::Error: Into<Error>,
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.
sourcepub fn destination<B>(self, destination: B) -> Result<Self>where
B: TryInto<UniqueName<'m>>,
B::Error: Into<Error>,
pub fn destination<B>(self, destination: B) -> Result<Self>where B: TryInto<UniqueName<'m>>, B::Error: Into<Error>,
Set the destination.
sourcepub fn add_arg<S>(self, arg: S) -> Result<Self>where
S: Into<Str<'m>>,
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.
sourcepub fn add_arg_path<P>(self, arg_path: P) -> Result<Self>where
P: TryInto<ObjectPath<'m>>,
P::Error: Into<Error>,
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.
sourcepub fn arg_path<P>(self, idx: u8, arg_path: P) -> Result<Self>where
P: TryInto<ObjectPath<'m>>,
P::Error: Into<Error>,
pub fn arg_path<P>(self, idx: u8, arg_path: P) -> Result<Self>where P: TryInto<ObjectPath<'m>>, P::Error: Into<Error>,
sourcepub fn arg0namespace<I>(self, namespace: I) -> Result<Self>where
I: TryInto<InterfaceName<'m>>,
I::Error: Into<Error>,
pub fn arg0namespace<I>(self, namespace: I) -> Result<Self>where I: TryInto<InterfaceName<'m>>, I::Error: Into<Error>,
Set 0th argument’s namespace.