Skip to main content

MailProvider

Trait MailProvider 

Source
pub trait MailProvider: Send {
    // Required methods
    fn list_mailboxes(
        &self,
    ) -> impl Future<Output = Result<Vec<Mailbox>, CoreError>> + Send;
    fn search(
        &self,
        query: &MailSearch,
    ) -> impl Future<Output = Result<MailPage, CoreError>> + Send;
    fn get_message(
        &self,
        id: &MessageId,
    ) -> impl Future<Output = Result<Message, CoreError>> + Send;
    fn get_attachment(
        &self,
        id: &MessageId,
        part: &str,
    ) -> impl Future<Output = Result<Attachment, CoreError>> + Send;
    fn create_draft(
        &self,
        draft: &Draft,
    ) -> impl Future<Output = Result<MessageId, CoreError>> + Send;
    fn send(
        &self,
        draft: &Draft,
    ) -> impl Future<Output = Result<MessageId, CoreError>> + Send;
    fn move_to(
        &self,
        id: &MessageId,
        destination: &MailboxPath,
    ) -> impl Future<Output = Result<(), CoreError>> + Send;
    fn set_flags(
        &self,
        id: &MessageId,
        flags: &FlagChange,
    ) -> impl Future<Output = Result<(), CoreError>> + Send;
}
Expand description

Mail read and write operations.

Required Methods§

Source

fn list_mailboxes( &self, ) -> impl Future<Output = Result<Vec<Mailbox>, CoreError>> + Send

Lists mailboxes.

§Errors

Returns CoreError when the mailbox list cannot be read.

Source

fn search( &self, query: &MailSearch, ) -> impl Future<Output = Result<MailPage, CoreError>> + Send

Searches messages.

§Errors

Returns CoreError when the search cannot be run.

Source

fn get_message( &self, id: &MessageId, ) -> impl Future<Output = Result<Message, CoreError>> + Send

Fetches one message.

§Errors

Returns CoreError when the message cannot be read.

Source

fn get_attachment( &self, id: &MessageId, part: &str, ) -> impl Future<Output = Result<Attachment, CoreError>> + Send

Fetches one attachment.

§Errors

Returns CoreError when the part cannot be read.

Source

fn create_draft( &self, draft: &Draft, ) -> impl Future<Output = Result<MessageId, CoreError>> + Send

Appends a draft.

§Errors

Returns CoreError when the draft cannot be saved.

Source

fn send( &self, draft: &Draft, ) -> impl Future<Output = Result<MessageId, CoreError>> + Send

Sends a message.

§Errors

Returns CoreError when the message cannot be sent.

Source

fn move_to( &self, id: &MessageId, destination: &MailboxPath, ) -> impl Future<Output = Result<(), CoreError>> + Send

Moves a message to another mailbox.

§Errors

Returns CoreError when the move cannot be done.

Source

fn set_flags( &self, id: &MessageId, flags: &FlagChange, ) -> impl Future<Output = Result<(), CoreError>> + Send

Sets or clears flags.

§Errors

Returns CoreError when the flags cannot be stored.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§