Struct notcoal::Operations
source · pub struct Operations {
pub rm: Option<Value>,
pub add: Option<Value>,
pub run: Option<Vec<String>>,
pub del: Option<bool>,
}
Expand description
Operations filters can apply.
Just a way to store operations, implementation may be found in
Operations::apply
.
Fields§
§rm: Option<Value>
Remove tags
add: Option<Value>
Add tags
run: Option<Vec<String>>
Run arbitrary commands
del: Option<bool>
Delete from disk and notmuch database
Implementations§
source§impl Operations
impl Operations
sourcepub fn apply(&self, msg: &Message, db: &Database, name: &str) -> Result<bool>
pub fn apply(&self, msg: &Message, db: &Database, name: &str) -> Result<bool>
Apply the operations defined in Filter::op
to the supplied message
regardless if matches this filter or not
Operations can fail, but if not they let you know if the message’s file was deleted and dropped from the database.
If operations have both run
and del
defined, the command is run
before the message is deleted.
Trait Implementations§
source§impl Debug for Operations
impl Debug for Operations
source§impl Default for Operations
impl Default for Operations
source§fn default() -> Operations
fn default() -> Operations
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Operations
impl<'de> Deserialize<'de> for Operations
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
Auto Trait Implementations§
impl Freeze for Operations
impl RefUnwindSafe for Operations
impl Send for Operations
impl Sync for Operations
impl Unpin for Operations
impl UnwindSafe for Operations
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