DBus.MatchRule
- data MatchRule = MatchRule {}
- data MessageType
- = MethodCall
- | MethodReturn
- | Signal
- | Error
- data ParameterValue
- formatRule :: MatchRule -> Text
- addMatch :: MatchRule -> MethodCall
- matchAll :: MatchRule
- matches :: MatchRule -> ReceivedMessage -> Bool
Documentation
A match rule is a set of filters; most filters may have one possible value assigned, such as a single message type. The exception are parameter filters, which are limited in number only by the server implementation.
Constructors
MatchRule | |
Fields |
data MessageType Source
The set of allowed message types to filter on is separate from the set supported for sending over the wire. This allows the server to support additional types not yet implemented in the library, or vice-versa.
Constructors
MethodCall | |
MethodReturn | |
Signal | |
Error |
Instances
data ParameterValue Source
Parameters may match against two types, strings and object paths. It's probably an error to have two values for the same parameter.
The constructor StringValue 3 "hello"
means that the fourth parameter
in the message body must be the string "hello"
. PathValue
is the
same, but its value must be an object path.
Constructors
StringValue Word8 Text | |
PathValue Word8 ObjectPath |
Instances
formatRule :: MatchRule -> TextSource
Format a MatchRule
as the bus expects to receive in a call to
AddMatch
.
addMatch :: MatchRule -> MethodCallSource
Build a MethodCall
for adding a match rule to the bus.
matches :: MatchRule -> ReceivedMessage -> BoolSource
Whether a ReceivedMessage
matches a given rule. This is useful
for implementing signal handlers.