1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pub mod memory_storage;
pub use self::memory_storage::MemoryStorage;
use email_format::Email;
use internal_status::InternalStatus;
pub trait MailstromStorageError: ::std::error::Error { }
pub trait MailstromStorage: Send + Sync {
type Error: MailstromStorageError;
fn store(&mut self, email: &Email, internal_status: &InternalStatus)
-> Result<(), Self::Error>;
fn update_status(&mut self, internal_status: &InternalStatus)
-> Result<(), Self::Error>;
fn retrieve(&self, message_id: &str) -> Result<(Email, InternalStatus), Self::Error>;
fn retrieve_status(&self, message_id: &str) -> Result<InternalStatus, Self::Error>;
fn retrieve_all_incomplete(&self) -> Result<Vec<InternalStatus>, Self::Error>;
}