Struct ruma::push::PatternedPushRule  
source · [−]#[non_exhaustive]pub struct PatternedPushRule {
    pub actions: Vec<Action, Global>,
    pub default: bool,
    pub enabled: bool,
    pub rule_id: String,
    pub pattern: String,
}Expand description
Like SimplePushRule, but with an additional pattern field.
Only applicable to content rules.
To create an instance of this type, first create a PatternedPushRuleInit and convert it via
PatternedPushRule::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, Global>Actions to determine if and how a notification is delivered for events matching this rule.
default: boolWhether this is a default rule, or has been set explicitly.
enabled: boolWhether the push rule is enabled or not.
rule_id: StringThe ID of this rule.
pattern: StringThe glob-style pattern to match against.
Implementations
sourceimpl PatternedPushRule
 
impl PatternedPushRule
Default content push rules
sourcepub fn contains_user_name(user_id: &UserId) -> PatternedPushRule
 
pub fn contains_user_name(user_id: &UserId) -> PatternedPushRule
Matches any message whose content is unencrypted and contains the local part of the user’s Matrix ID, separated by word boundaries.
sourceimpl PatternedPushRule
 
impl PatternedPushRule
sourcepub fn applies_to(
    &self, 
    key: &str, 
    event: &FlattenedJson, 
    context: &PushConditionRoomCtx
) -> bool
 
pub fn applies_to(
    &self, 
    key: &str, 
    event: &FlattenedJson, 
    context: &PushConditionRoomCtx
) -> bool
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
sourceimpl Clone for PatternedPushRule
 
impl Clone for PatternedPushRule
sourcefn clone(&self) -> PatternedPushRule
 
fn clone(&self) -> PatternedPushRule
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 PatternedPushRule
 
impl Debug for PatternedPushRule
sourceimpl<'de> Deserialize<'de> for PatternedPushRule
 
impl<'de> Deserialize<'de> for PatternedPushRule
sourcefn deserialize<__D>(
    __deserializer: __D
) -> Result<PatternedPushRule, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
 
fn deserialize<__D>(
    __deserializer: __D
) -> Result<PatternedPushRule, <__D as Deserializer<'de>>::Error> where
    __D: Deserializer<'de>, 
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Equivalent<PatternedPushRule> for str
 
impl Equivalent<PatternedPushRule> for str
sourcefn equivalent(&self, key: &PatternedPushRule) -> bool
 
fn equivalent(&self, key: &PatternedPushRule) -> bool
Compare self to key and return true if they are equal.
sourceimpl From<PatternedPushRule> for PushRule
 
impl From<PatternedPushRule> for PushRule
sourcefn from(push_rule: PatternedPushRule) -> PushRule
 
fn from(push_rule: PatternedPushRule) -> PushRule
Converts to this type from the input type.
sourceimpl From<PatternedPushRuleInit> for PatternedPushRule
 
impl From<PatternedPushRuleInit> for PatternedPushRule
sourcefn from(init: PatternedPushRuleInit) -> PatternedPushRule
 
fn from(init: PatternedPushRuleInit) -> PatternedPushRule
Converts to this type from the input type.
sourceimpl Hash for PatternedPushRule
 
impl Hash for PatternedPushRule
sourceimpl Serialize for PatternedPushRule
 
impl Serialize for PatternedPushRule
sourcefn serialize<__S>(
    &self, 
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer, 
 
fn serialize<__S>(
    &self, 
    __serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
    __S: Serializer, 
Serialize this value into the given Serde serializer. Read more
sourceimpl TryFrom<PushRule> for PatternedPushRule
 
impl TryFrom<PushRule> for PatternedPushRule
type Error = MissingPatternError
type Error = MissingPatternError
The type returned in the event of a conversion error.
sourcefn try_from(
    push_rule: PushRule
) -> Result<PatternedPushRule, <PatternedPushRule as TryFrom<PushRule>>::Error>
 
fn try_from(
    push_rule: PushRule
) -> Result<PatternedPushRule, <PatternedPushRule as TryFrom<PushRule>>::Error>
Performs the conversion.
impl Eq for PatternedPushRule
Auto Trait Implementations
impl RefUnwindSafe for PatternedPushRule
impl Send for PatternedPushRule
impl Sync for PatternedPushRule
impl Unpin for PatternedPushRule
impl UnwindSafe for PatternedPushRule
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> CallHasher for T where
    T: Hash + ?Sized, 
 
impl<T> CallHasher for T where
    T: Hash + ?Sized, 
sourceimpl<Q, K> Equivalent<K> for Q where
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized, 
 
impl<Q, K> Equivalent<K> for Q where
    Q: Eq + ?Sized,
    K: Borrow<Q> + ?Sized, 
sourcefn equivalent(&self, key: &K) -> bool
 
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
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
