[−][src]Trait melib::backends::BackendOp
A BackendOp
manages common operations for the various mail backends. They only live for the
duration of the operation. They are generated by the operation
method of Mailbackend
trait.
Motivation
We need a way to do various operations on individual mails regardless of what backend they come from (eg local or imap).
Creation
ⓘThis example is not tested
/* Create operation from Backend */ let op = backend.operation(message.hash(), mailbox.hash());
Example
ⓘThis example is not tested
use melib::backends::{BackendOp}; use melib::Result; use melib::{Envelope, Flag}; #[derive(Debug)] struct FooOp {} impl BackendOp for FooOp { fn as_bytes(&mut self) -> Result<&[u8]> { unimplemented!() } fn fetch_flags(&self) -> Result<Flag> { unimplemented!() } } let operation = Box::new(FooOp {});