pub trait MailRemote {
// Required methods
fn list_mailboxes(&self) -> Result<Value>;
fn action_mailbox_folder(&self, mailbox_id: &str) -> Result<String>;
fn append_message(
&self,
folder: &str,
raw_eml: &[u8],
draft: bool,
) -> Result<()>;
fn move_message(
&self,
source_folder: &str,
uid: u64,
target_folder: &str,
rfc822_message_id: Option<&str>,
) -> Result<MoveOutcome>;
fn add_flags(
&self,
source_folder: &str,
uid: u64,
flags: &[String],
) -> Result<()>;
fn send_raw_message(
&self,
envelope_from: &str,
envelope_to: &[String],
raw: &[u8],
) -> Result<()>;
// Provided method
fn find_by_message_id(
&self,
_folder: &str,
_rfc822_message_id: &str,
) -> Result<Option<RemoteLocation>> { ... }
}Expand description
Remote mail side effects used by push/pull code.
Workspace code depends on this trait so retry/state-machine tests can use a fake provider without reaching IMAP or SMTP.
Required Methods§
fn list_mailboxes(&self) -> Result<Value>
fn action_mailbox_folder(&self, mailbox_id: &str) -> Result<String>
fn append_message( &self, folder: &str, raw_eml: &[u8], draft: bool, ) -> Result<()>
fn move_message( &self, source_folder: &str, uid: u64, target_folder: &str, rfc822_message_id: Option<&str>, ) -> Result<MoveOutcome>
fn add_flags( &self, source_folder: &str, uid: u64, flags: &[String], ) -> Result<()>
fn send_raw_message( &self, envelope_from: &str, envelope_to: &[String], raw: &[u8], ) -> Result<()>
Provided Methods§
fn find_by_message_id( &self, _folder: &str, _rfc822_message_id: &str, ) -> Result<Option<RemoteLocation>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".