Trait mailstrom::MailstromStorage
[−]
[src]
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>; }
A trait for implementing Mailstrom storage
Associated Types
type Error: MailstromStorageError
Required Methods
fn store(
&mut self,
email: &Email,
internal_status: &InternalStatus
) -> Result<(), Self::Error>
&mut self,
email: &Email,
internal_status: &InternalStatus
) -> Result<(), Self::Error>
Store an Email
. This should overwrite if message-id matches an existing email.
fn update_status(
&mut self,
internal_status: &InternalStatus
) -> Result<(), Self::Error>
&mut self,
internal_status: &InternalStatus
) -> Result<(), Self::Error>
Update the status of an email
fn retrieve(
&self,
message_id: &str
) -> Result<(Email, InternalStatus), Self::Error>
&self,
message_id: &str
) -> Result<(Email, InternalStatus), Self::Error>
Retrieve an Email
and InternalStatus
based on the message_id
fn retrieve_status(
&self,
message_id: &str
) -> Result<InternalStatus, Self::Error>
&self,
message_id: &str
) -> Result<InternalStatus, Self::Error>
Retrieve an InternalStatus
based on the message_id
fn retrieve_all_incomplete(&self) -> Result<Vec<InternalStatus>, Self::Error>
Retrieve all incomplete emails (status only). This is used to continue retrying after shutdown and later startup.
Implementors
impl MailstromStorage for MemoryStorage