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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
pub mod memory_storage;
pub use self::memory_storage::MemoryStorage;
pub use crate::message_status::InternalMessageStatus;
pub use crate::prepared_email::PreparedEmail;
pub trait MailstromStorageError: ::std::error::Error {}
pub trait MailstromStorage: Send + Sync {
type Error: MailstromStorageError;
fn store(
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus,
) -> Result<(), Self::Error>;
fn update_status(
&mut self,
internal_message_status: InternalMessageStatus,
) -> Result<(), Self::Error>;
fn retrieve(
&self,
message_id: &str,
) -> Result<(PreparedEmail, InternalMessageStatus), Self::Error>;
fn retrieve_status(&self, message_id: &str) -> Result<InternalMessageStatus, Self::Error>;
fn retrieve_all_incomplete(&self) -> Result<Vec<InternalMessageStatus>, Self::Error>;
fn retrieve_all_recent(&mut self) -> Result<Vec<InternalMessageStatus>, Self::Error>;
}
impl MailstromStorageError for lettre::error::Error { }