pub struct Rule {
pub name: String,
pub account: Option<String>,
pub folder: Option<String>,
pub enabled: bool,
pub proposed_by: Option<String>,
pub matches: Match,
pub actions: Vec<Action>,
}Fields§
§name: StringUnique name; renaming a rule restarts its clock
account: Option<String>Only for this account; default all accounts
folder: Option<String>The folder the rule watches; default INBOX
enabled: boolDisabled rules are skipped; proposals start disabled
proposed_by: Option<String>Who proposed the rule; set by rules propose
matches: MatchConditions that must all hold; at least one
actions: Vec<Action>What to do; at least one
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn definition(&self) -> Result<String, RulesError>
pub fn definition(&self) -> Result<String, RulesError>
What the rule does, as JSON: editing any of it restarts the rule’s clock, so a widened rule never acts on older mail.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
Source§fn 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
Source§impl JsonSchema for Rule
impl JsonSchema for Rule
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more