[][src]Struct melib::collection::Collection

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>>>,
    sent_mailbox: Arc<RwLock<Option<MailboxHash>>>,
    pub mailboxes: Arc<RwLock<HashMap<MailboxHash, HashSet<EnvelopeHash>>>>,
}

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>>>>

Implementations

impl Collection[src]

pub fn new() -> Collection[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn remove(&self, envelope_hash: EnvelopeHash, mailbox_hash: MailboxHash)[src]

pub fn rename(
    &self,
    old_hash: EnvelopeHash,
    new_hash: EnvelopeHash,
    mailbox_hash: MailboxHash
) -> bool
[src]

pub fn merge(
    &self,
    new_envelopes: HashMap<EnvelopeHash, Envelope>,
    mailbox_hash: MailboxHash,
    sent_mailbox: Option<MailboxHash>
) -> Option<SmallVec<[MailboxHash; 8]>>
[src]

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
)
[src]

pub fn update_flags(&self, env_hash: EnvelopeHash, mailbox_hash: MailboxHash)[src]

pub fn insert(&self, envelope: Envelope, mailbox_hash: MailboxHash) -> bool[src]

pub fn insert_reply(&self, env_hash: EnvelopeHash)[src]

pub fn get_env(&self, env_hash: EnvelopeHash) -> EnvelopeRef<'_>[src]

pub fn get_env_mut(&self, env_hash: EnvelopeHash) -> EnvelopeRefMut<'_>[src]

pub fn get_threads(&self, hash: MailboxHash) -> RwRef<'_, MailboxHash, Threads>[src]

pub fn get_mailbox(
    &self,
    hash: MailboxHash
) -> RwRef<'_, MailboxHash, HashSet<EnvelopeHash>>
[src]

pub fn contains_key(&self, env_hash: &EnvelopeHash) -> bool[src]

pub fn new_mailbox(&self, mailbox_hash: MailboxHash)[src]

Trait Implementations

impl Clone for Collection[src]

impl Debug for Collection[src]

impl Default for Collection[src]

Auto Trait Implementations

impl RefUnwindSafe for Collection

impl !Send for Collection

impl !Sync for Collection

impl Unpin for Collection

impl UnwindSafe for Collection

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]