Struct melib::Collection
source · pub struct Collection {
pub envelopes: Arc<RwLock<HashMap<EnvelopeHash, Envelope>>>,
pub message_id_index: Arc<RwLock<HashMap<Vec<u8>, EnvelopeHash>>>,
pub threads: Arc<RwLock<HashMap<MailboxHash, Threads>>>,
pub sent_mailbox: Arc<RwLock<Option<MailboxHash>>>,
pub mailboxes: Arc<RwLock<HashMap<MailboxHash, HashSet<EnvelopeHash>>>>,
pub tag_index: Arc<RwLock<BTreeMap<TagHash, String>>>,
}
Fields§
§envelopes: Arc<RwLock<HashMap<EnvelopeHash, Envelope>>>
§message_id_index: Arc<RwLock<HashMap<Vec<u8>, EnvelopeHash>>>
§threads: Arc<RwLock<HashMap<MailboxHash, Threads>>>
§sent_mailbox: Arc<RwLock<Option<MailboxHash>>>
§mailboxes: Arc<RwLock<HashMap<MailboxHash, HashSet<EnvelopeHash>>>>
§tag_index: Arc<RwLock<BTreeMap<TagHash, String>>>
Implementations§
source§impl Collection
impl Collection
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn remove(&self, envelope_hash: EnvelopeHash, mailbox_hash: MailboxHash)
pub fn rename( &self, old_hash: EnvelopeHash, new_hash: EnvelopeHash, mailbox_hash: MailboxHash ) -> bool
sourcepub fn merge(
&self,
new_envelopes: HashMap<EnvelopeHash, Envelope>,
mailbox_hash: MailboxHash,
sent_mailbox: Option<MailboxHash>
) -> Option<SmallVec<[MailboxHash; 8]>>
pub fn merge( &self, new_envelopes: HashMap<EnvelopeHash, Envelope>, mailbox_hash: MailboxHash, sent_mailbox: Option<MailboxHash> ) -> Option<SmallVec<[MailboxHash; 8]>>
Merge new mailbox to collection and update threads. Returns a list of already existing mailboxs whose threads were updated
pub fn update( &self, old_hash: EnvelopeHash, envelope: Envelope, mailbox_hash: MailboxHash )
pub fn update_flags(&self, env_hash: EnvelopeHash, mailbox_hash: MailboxHash)
pub fn insert(&self, envelope: Envelope, mailbox_hash: MailboxHash) -> bool
pub fn insert_reply(&self, env_hash: EnvelopeHash)
pub fn get_env(&self, hash: EnvelopeHash) -> EnvelopeRef<'_>
pub fn get_env_mut(&self, hash: EnvelopeHash) -> EnvelopeRefMut<'_>
pub fn get_threads(&self, hash: MailboxHash) -> RwRef<'_, MailboxHash, Threads>
pub fn get_mailbox( &self, hash: MailboxHash ) -> RwRef<'_, MailboxHash, HashSet<EnvelopeHash>>
pub fn contains_key(&self, env_hash: &EnvelopeHash) -> bool
pub fn new_mailbox(&self, mailbox_hash: MailboxHash)
Trait Implementations§
source§impl Clone for Collection
impl Clone for Collection
source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Collection
impl Debug for Collection
Auto Trait Implementations§
impl Freeze for Collection
impl RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl UnwindSafe for Collection
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more