Enum ruma_common::push::PushCondition
source · [−]#[non_exhaustive]
pub enum PushCondition {
EventMatch {
key: String,
pattern: String,
},
ContainsDisplayName,
RoomMemberCount {
is: RoomMemberCountIs,
},
SenderNotificationPermission {
key: String,
},
}
Expand description
A condition that must apply for an associated push rule’s action to be taken.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
EventMatch
Fields
key: String
The dot-separated field of the event to match.
pattern: String
The glob-style pattern to match against.
Patterns with no special glob characters should be treated as having asterisks prepended and appended when testing the condition.
A glob pattern match on a field of the event.
ContainsDisplayName
Matches unencrypted messages where content.body
contains the owner’s display name in that
room.
RoomMemberCount
Fields
is: RoomMemberCountIs
The condition on the current number of members in the room.
Matches the current number of members in the room.
SenderNotificationPermission
Fields
key: String
The field in the power level event the user needs a minimum power level for.
Fields must be specified under the notifications
property in the power level event’s
content
.
Takes into account the current power levels in the room, ensuring the sender of the event has high enough power to trigger the notification.
Implementations
sourceimpl PushCondition
impl PushCondition
sourcepub fn applies(
&self,
event: &FlattenedJson,
context: &PushConditionRoomCtx
) -> bool
pub fn applies(
&self,
event: &FlattenedJson,
context: &PushConditionRoomCtx
) -> bool
Check if this condition 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
sourceimpl Clone for PushCondition
impl Clone for PushCondition
sourcefn clone(&self) -> PushCondition
fn clone(&self) -> PushCondition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PushCondition
impl Debug for PushCondition
sourceimpl<'de> Deserialize<'de> for PushCondition
impl<'de> Deserialize<'de> for PushCondition
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for PushCondition
impl Serialize for PushCondition
Auto Trait Implementations
impl RefUnwindSafe for PushCondition
impl Send for PushCondition
impl Sync for PushCondition
impl Unpin for PushCondition
impl UnwindSafe for PushCondition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more