[−]Struct matrix_sdk_common::push::Ruleset
A push ruleset scopes a set of rules according to some criteria.
For example, some rules may only be applied for messages from a particular sender, a particular room, or by default. The push ruleset contains the entire set of scopes and rules.
Fields (Non-exhaustive)
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content: BTreeSet<ContentPushRule>These rules configure behavior for (unencrypted) messages that match certain patterns.
override_: BTreeSet<OverridePushRule>These user-configured rules are given the highest priority.
This field is named override_ instead of override because the latter is a reserved
keyword in Rust.
room: BTreeSet<RoomPushRule>These rules change the behavior of all messages for a given room.
sender: BTreeSet<SenderPushRule>These rules configure notification behavior for messages from a specific Matrix user ID.
underride: BTreeSet<UnderridePushRule>These rules are identical to override rules, but have a lower priority than content,
room and sender rules.
Implementations
impl Ruleset
pub fn server_default(user_id: &UserId) -> Ruleset
The list of all predefined push rules.
Parameters
user_id: the user for which to generate the default rules. Some rules depend on the user's ID (for instance those to send notifications when they are mentioned).
impl Ruleset
pub fn new() -> Ruleset
Creates an empty Ruleset.
pub fn add<R>(&mut self, rule: R) -> bool where
R: RulesetMember,
R: RulesetMember,
Adds a rule to the rule set.
Returns true if the new rule was correctly added, and false
if a rule with the same rule_id is already present for this kind
of rule.
Trait Implementations
impl Clone for Ruleset
pub fn clone(&self) -> Ruleset
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for Ruleset
impl Default for Ruleset
impl<'de> Deserialize<'de> for Ruleset
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Ruleset, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
__deserializer: __D
) -> Result<Ruleset, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Extend<ContentPushRule> for Ruleset
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = ContentPushRule>,
T: IntoIterator<Item = ContentPushRule>,
pub fn extend_one(&mut self, item: A)[src]
pub fn extend_reserve(&mut self, additional: usize)[src]
impl Extend<OverridePushRule> for Ruleset
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = OverridePushRule>,
T: IntoIterator<Item = OverridePushRule>,
pub fn extend_one(&mut self, item: A)[src]
pub fn extend_reserve(&mut self, additional: usize)[src]
impl Extend<RoomPushRule> for Ruleset
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = RoomPushRule>,
T: IntoIterator<Item = RoomPushRule>,
pub fn extend_one(&mut self, item: A)[src]
pub fn extend_reserve(&mut self, additional: usize)[src]
impl Extend<SenderPushRule> for Ruleset
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = SenderPushRule>,
T: IntoIterator<Item = SenderPushRule>,
pub fn extend_one(&mut self, item: A)[src]
pub fn extend_reserve(&mut self, additional: usize)[src]
impl Extend<UnderridePushRule> for Ruleset
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = UnderridePushRule>,
T: IntoIterator<Item = UnderridePushRule>,
pub fn extend_one(&mut self, item: A)[src]
pub fn extend_reserve(&mut self, additional: usize)[src]
impl IntoIterator for Ruleset
type Item = AnyPushRule
The type of the elements being iterated over.
type IntoIter = RulesetIter
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <Ruleset as IntoIterator>::IntoIter
impl Serialize for Ruleset
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl RefUnwindSafe for Ruleset[src]
impl Send for Ruleset[src]
impl Sync for Ruleset[src]
impl Unpin for Ruleset[src]
impl UnwindSafe for Ruleset[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> AsyncTraitDeps for T where
T: Send + Sync + Debug, [src]
T: Send + Sync + Debug,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,