From 335750a29a83edba9bce2fb7e1452001e4962d1f Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 5 Jan 2024 15:36:40 +0100 Subject: MOVE command is optimized --- src/mail/mailbox.rs | 3 --- src/mail/mod.rs | 2 ++ src/mail/query.rs | 0 src/mail/snapshot.rs | 11 +++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/mail/query.rs create mode 100644 src/mail/snapshot.rs (limited to 'src/mail') diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index e424ba3..b011110 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -149,7 +149,6 @@ impl Mailbox { /// Move an email from an other Mailbox to this mailbox /// (use this when possible, as it allows for a certain number of storage optimizations) - #[allow(dead_code)] pub async fn move_from(&self, from: &Mailbox, uuid: UniqueIdent) -> Result<()> { if self.id == from.id { bail!("Cannot copy move same mailbox"); @@ -403,8 +402,6 @@ impl MailboxInternal { Ok(new_id) } - #[allow(dead_code)] - // 2023-05-15 will probably be used later async fn move_from(&mut self, from: &mut MailboxInternal, id: UniqueIdent) -> Result<()> { self.copy_internal(from, id, id).await?; from.delete(id).await?; diff --git a/src/mail/mod.rs b/src/mail/mod.rs index bbe4033..7371b53 100644 --- a/src/mail/mod.rs +++ b/src/mail/mod.rs @@ -3,6 +3,8 @@ use std::io::Write; pub mod incoming; pub mod mailbox; +pub mod snapshot; +pub mod query; pub mod uidindex; pub mod unique_ident; pub mod user; diff --git a/src/mail/query.rs b/src/mail/query.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/mail/snapshot.rs b/src/mail/snapshot.rs new file mode 100644 index 0000000..7256d50 --- /dev/null +++ b/src/mail/snapshot.rs @@ -0,0 +1,11 @@ +use std::sync::Arc; +use super::mailbox::Mailbox; +use super::uidindex::UidIndex; + +pub struct Snapshot { + pub mailbox: Arc, + pub snapshot: UidIndex, +} + +impl Snapshot { +} -- cgit v1.2.3