Struct notcoal::Filter

source ·
pub struct Filter {
    pub desc: Option<String>,
    pub rules: Vec<BTreeMap<String, Value>>,
    pub op: Operations,
    /* private fields */


desc: Option<String>


Not really used for anything at this point in time, but may be good for users to remember what this specific filter is doing

rules: Vec<BTreeMap<String, Value>>

List of rules

This list is an OR list, meaning the filter will match if any rule matches. However, AND combinations may happen within a rule

op: Operations

Operations that will be applied if this any rule matches


Returns either the set name, or a hash of Filter::rules. Please note: hashed names are not used for serialization.

When filters are deserialized from json or have been assembled via code, the regular expressions contained in Filter::rules need to be compiled before any matches are to be made.

Combines Filter::is_match and Operations::apply

Returns a tuple of two bools, the first representing if the filter has been applied, the second if the operation deleted the message that was supplied

Checks if the supplied message matches any of the combinations described in Filter::rules

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.