[][src]Trait melib::backends::MailBackend

pub trait MailBackend: Debug + Send + Sync {
    fn capabilities(&self) -> MailBackendCapabilities;
fn fetch(
        &mut self,
        mailbox_hash: MailboxHash
    ) -> Result<Pin<Box<dyn Stream<Item = Result<Vec<Envelope>>> + Send + 'static>>>;
fn refresh(&mut self, mailbox_hash: MailboxHash) -> ResultFuture<()>;
fn watch(&self) -> ResultFuture<()>;
fn mailboxes(&self) -> ResultFuture<HashMap<MailboxHash, Mailbox>>;
fn operation(&self, hash: EnvelopeHash) -> Result<Box<dyn BackendOp>>;
fn save(
        &self,
        bytes: Vec<u8>,
        mailbox_hash: MailboxHash,
        flags: Option<Flag>
    ) -> ResultFuture<()>;
fn copy_messages(
        &mut self,
        env_hashes: EnvelopeHashBatch,
        source_mailbox_hash: MailboxHash,
        destination_mailbox_hash: MailboxHash,
        move_: bool
    ) -> ResultFuture<()>;
fn set_flags(
        &mut self,
        env_hashes: EnvelopeHashBatch,
        mailbox_hash: MailboxHash,
        flags: SmallVec<[(Result<Flag, String>, bool); 8]>
    ) -> ResultFuture<()>;
fn delete_messages(
        &mut self,
        env_hashes: EnvelopeHashBatch,
        mailbox_hash: MailboxHash
    ) -> ResultFuture<()>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any; fn is_online(&self) -> ResultFuture<()> { ... }
fn tags(&self) -> Option<Arc<RwLock<BTreeMap<u64, String>>>> { ... }
fn create_mailbox(
        &mut self,
        _path: String
    ) -> ResultFuture<(MailboxHash, HashMap<MailboxHash, Mailbox>)> { ... }
fn delete_mailbox(
        &mut self,
        _mailbox_hash: MailboxHash
    ) -> ResultFuture<HashMap<MailboxHash, Mailbox>> { ... }
fn set_mailbox_subscription(
        &mut self,
        _mailbox_hash: MailboxHash,
        _val: bool
    ) -> ResultFuture<()> { ... }
fn rename_mailbox(
        &mut self,
        _mailbox_hash: MailboxHash,
        _new_path: String
    ) -> ResultFuture<Mailbox> { ... }
fn set_mailbox_permissions(
        &mut self,
        _mailbox_hash: MailboxHash,
        _val: MailboxPermissions
    ) -> ResultFuture<()> { ... }
fn search(
        &self,
        _query: Query,
        _mailbox_hash: Option<MailboxHash>
    ) -> ResultFuture<SmallVec<[EnvelopeHash; 512]>> { ... } }

Required methods

fn capabilities(&self) -> MailBackendCapabilities

fn fetch(
    &mut self,
    mailbox_hash: MailboxHash
) -> Result<Pin<Box<dyn Stream<Item = Result<Vec<Envelope>>> + Send + 'static>>>

fn refresh(&mut self, mailbox_hash: MailboxHash) -> ResultFuture<()>

fn watch(&self) -> ResultFuture<()>

fn mailboxes(&self) -> ResultFuture<HashMap<MailboxHash, Mailbox>>

fn operation(&self, hash: EnvelopeHash) -> Result<Box<dyn BackendOp>>

fn save(
    &self,
    bytes: Vec<u8>,
    mailbox_hash: MailboxHash,
    flags: Option<Flag>
) -> ResultFuture<()>

fn copy_messages(
    &mut self,
    env_hashes: EnvelopeHashBatch,
    source_mailbox_hash: MailboxHash,
    destination_mailbox_hash: MailboxHash,
    move_: bool
) -> ResultFuture<()>

fn set_flags(
    &mut self,
    env_hashes: EnvelopeHashBatch,
    mailbox_hash: MailboxHash,
    flags: SmallVec<[(Result<Flag, String>, bool); 8]>
) -> ResultFuture<()>

fn delete_messages(
    &mut self,
    env_hashes: EnvelopeHashBatch,
    mailbox_hash: MailboxHash
) -> ResultFuture<()>

fn as_any(&self) -> &dyn Any

fn as_any_mut(&mut self) -> &mut dyn Any

Loading content...

Provided methods

fn is_online(&self) -> ResultFuture<()>

fn tags(&self) -> Option<Arc<RwLock<BTreeMap<u64, String>>>>

fn create_mailbox(
    &mut self,
    _path: String
) -> ResultFuture<(MailboxHash, HashMap<MailboxHash, Mailbox>)>

fn delete_mailbox(
    &mut self,
    _mailbox_hash: MailboxHash
) -> ResultFuture<HashMap<MailboxHash, Mailbox>>

fn set_mailbox_subscription(
    &mut self,
    _mailbox_hash: MailboxHash,
    _val: bool
) -> ResultFuture<()>

fn rename_mailbox(
    &mut self,
    _mailbox_hash: MailboxHash,
    _new_path: String
) -> ResultFuture<Mailbox>

fn set_mailbox_permissions(
    &mut self,
    _mailbox_hash: MailboxHash,
    _val: MailboxPermissions
) -> ResultFuture<()>

fn search(
    &self,
    _query: Query,
    _mailbox_hash: Option<MailboxHash>
) -> ResultFuture<SmallVec<[EnvelopeHash; 512]>>

Loading content...

Implementors

impl MailBackend for ImapType[src]

impl MailBackend for JmapType[src]

impl MailBackend for MaildirType[src]

impl MailBackend for MboxType[src]

impl MailBackend for NntpType[src]

impl MailBackend for NotmuchDb[src]

Loading content...