[]Module matrix_sdk::push

Common types for the push notifications module

Understanding the types of this module

Push rules are grouped in RuleSets, and are grouped in five kinds (for more details about the different kind of rules, see the Ruleset documentation, or the specification). These five kinds are:

  • content rules
  • override rules
  • underride rules
  • room rules
  • sender rules

Each of these kind of rule has a corresponding type that is just a wrapper around another type:

  • SimplePushRule for room and sender rules
  • ConditionalPushRule for override and underride rules: push rules that may depend on a condition
  • PatternedPushRules for content rules, that can filter events based on a pattern to trigger the rule or not

Having these wrapper types allows to tell at the type level what kind of rule you are handling, and makes sure the Ruleset::add method adds your rule to the correct field of Ruleset, and that rules that are not of the same kind are never mixed even if they share the same representation.

It is still possible to write code that is generic over a representation by manipulating SimplePushRule, ConditonalPushRule or PatternedPushRule directly, instead of the wrappers.

There is also the AnyPushRule type that is the most generic form of push rule, with all the possible fields.

Structs

AnyPushRule

Like SimplePushRule, but may represent any kind of push rule thanks to pattern and conditions being optional.

ConditionalPushRule

Like SimplePushRule, but with an additional conditions field.

ConditionalPushRuleInit

Initial set of fields of ConditionalPushRule.

ContentPushRule

Wrapper type to disambiguate the kind of the wrapped rule

MissingConditionsError

An error that happens when AnyPushRule cannot be converted into ConditionalPushRule

MissingPatternError

An error that happens when AnyPushRule cannot be converted into PatternedPushRule

OverridePushRule

Wrapper type to disambiguate the kind of the wrapped rule

PatternedPushRule

Like SimplePushRule, but with an additional pattern field.

PatternedPushRuleInit

Initial set of fields of PatterenedPushRule.

PusherData

Information for the pusher implementation itself.

RoomMemberCountIs

A decimal integer optionally prefixed by one of ==, <, >, >= or <=.

RoomPushRule

Wrapper type to disambiguate the kind of the wrapped rule

Ruleset

A push ruleset scopes a set of rules according to some criteria.

RulesetIter

Iterator type for Ruleset

SenderPushRule

Wrapper type to disambiguate the kind of the wrapped rule

SimplePushRule

A push rule is a single rule that states under what conditions an event should be passed onto a push gateway and how the notification should be presented.

SimplePushRuleInit

Initial set of fields of SimplePushRule.

UnderridePushRule

Wrapper type to disambiguate the kind of the wrapped rule

Enums

Action

This represents the different actions that should be taken when a rule is matched, and controls how notifications are delivered to the client.

ComparisonOperator

One of ==, <, >, >= or <=.

PushCondition

A condition that must apply for an associated push rule's action to be taken.

PushFormat

A special format that the homeserver should use when sending notifications to a Push Gateway. Currently, only "event_id_only" is supported as of Push Gateway API r0.1.1.

Tweak

The set_tweak action.

Traits

RulesetMember

A trait for types that can be added in a Ruleset