Struct ruma_common::push::ConditionalPushRule [−][src]
#[non_exhaustive]pub struct ConditionalPushRule { pub actions: Vec<Action>, pub default: bool, pub enabled: bool, pub rule_id: String, pub conditions: Vec<PushCondition>, }
Expand description
Like SimplePushRule, but with an additional conditions field.
Only applicable to underride and override rules.
To create an instance of this type, first create a ConditionalPushRuleInit and convert it via
ConditionalPushRule::from / .into().
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct {{ .. }} syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.actions: Vec<Action>Expand description
Actions to determine if and how a notification is delivered for events matching this rule.
default: boolExpand description
Whether this is a default rule, or has been set explicitly.
enabled: boolExpand description
Whether the push rule is enabled or not.
rule_id: StringExpand description
The ID of this rule.
conditions: Vec<PushCondition>Expand description
The conditions that must hold true for an event in order for a rule to be applied to an event.
A rule with no conditions always matches.
Implementations
impl ConditionalPushRule[src]
impl ConditionalPushRule[src]Default override push rules
pub fn master() -> Self[src]
pub fn master() -> Self[src]Matches all events, this can be enabled to turn off all push notifications other than those generated by override rules set by the user.
pub fn suppress_notices() -> Self[src]
pub fn suppress_notices() -> Self[src]Matches messages with a msgtype of notice.
pub fn invite_for_me(user_id: &UserId) -> Self[src]
pub fn invite_for_me(user_id: &UserId) -> Self[src]Matches any invites to a new room for this user.
pub fn member_event() -> Self[src]
pub fn member_event() -> Self[src]Matches any m.room.member_event.
pub fn contains_display_name() -> Self[src]
pub fn contains_display_name() -> Self[src]Matches any message whose content is unencrypted and contains the user’s current display name in the room in which it was sent.
impl ConditionalPushRule[src]
impl ConditionalPushRule[src]Default underrides push rules
pub fn encrypted_room_one_to_one() -> Self[src]
pub fn encrypted_room_one_to_one() -> Self[src]Matches any encrypted event sent in a room with exactly two members. Unlike other push rules, this rule cannot be matched against the content of the event by nature of it being encrypted. This causes the rule to be an “all or nothing” match where it either matches all events that are encrypted (in 1:1 rooms) or none.
pub fn room_one_to_one() -> Self[src]
pub fn room_one_to_one() -> Self[src]Matches any message sent in a room with exactly two members.
pub fn encrypted() -> Self[src]
pub fn encrypted() -> Self[src]Matches all encrypted events. Unlike other push rules, this rule cannot be matched against the content of the event by nature of it being encrypted. This causes the rule to be an “all or nothing” match where it either matches all events that are encrypted (in group rooms) or none.
impl ConditionalPushRule[src]
impl ConditionalPushRule[src]pub fn applies(
&self,
event: &FlattenedJson,
context: &PushConditionRoomCtx
) -> bool[src]
pub fn applies(
&self,
event: &FlattenedJson,
context: &PushConditionRoomCtx
) -> bool[src]Check if the push rule applies to the event.
Arguments
event- The flattened JSON representation of a room message event.context- The context of the room at the time of the event.
Trait Implementations
impl Clone for ConditionalPushRule[src]
impl Clone for ConditionalPushRule[src]fn clone(&self) -> ConditionalPushRule[src]
fn clone(&self) -> ConditionalPushRule[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for ConditionalPushRule[src]
impl Debug for ConditionalPushRule[src]impl<'de> Deserialize<'de> for ConditionalPushRule[src]
impl<'de> Deserialize<'de> for ConditionalPushRule[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]Deserialize this value from the given Serde deserializer. Read more
impl From<ConditionalPushRuleInit> for ConditionalPushRule[src]
impl From<ConditionalPushRuleInit> for ConditionalPushRule[src]fn from(init: ConditionalPushRuleInit) -> Self[src]
fn from(init: ConditionalPushRuleInit) -> Self[src]Performs the conversion.
impl Hash for ConditionalPushRule[src]
impl Hash for ConditionalPushRule[src]impl Serialize for ConditionalPushRule[src]
impl Serialize for ConditionalPushRule[src]impl Eq for ConditionalPushRule[src]
Auto Trait Implementations
impl RefUnwindSafe for ConditionalPushRule
impl Send for ConditionalPushRule
impl Sync for ConditionalPushRule
impl Unpin for ConditionalPushRule
impl UnwindSafe for ConditionalPushRule
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]pub fn equivalent(&self, key: &K) -> bool[src]
pub fn equivalent(&self, key: &K) -> bool[src]Compare self to key and return true if they are equal.
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,