[−][src]Trait mailstrom::storage::MailstromStorage
A trait for implementing Mailstrom storage
Associated Types
type Error: MailstromStorageError
Required methods
fn store(
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus
) -> Result<(), Self::Error>
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus
) -> Result<(), Self::Error>
Store a PreparedEmail
. This should overwrite if message-id matches an existing
email.
fn update_status(
&mut self,
internal_message_status: InternalMessageStatus
) -> Result<(), Self::Error>
&mut self,
internal_message_status: InternalMessageStatus
) -> Result<(), Self::Error>
Update the status of an email
fn retrieve(
&self,
message_id: &str
) -> Result<(PreparedEmail, InternalMessageStatus), Self::Error>
&self,
message_id: &str
) -> Result<(PreparedEmail, InternalMessageStatus), Self::Error>
Retrieve a PreparedEmail
and InternalMessageStatus
based on the message_id
fn retrieve_status(
&self,
message_id: &str
) -> Result<InternalMessageStatus, Self::Error>
&self,
message_id: &str
) -> Result<InternalMessageStatus, Self::Error>
Retrieve an InternalMessageStatus
based on the message_id
fn retrieve_all_incomplete(
&self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
&self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
Retrieve all incomplete emails (status only). This is used to continue retrying after shutdown and later startup.
fn retrieve_all_recent(
&mut self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
&mut self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
Retrieve all incomplete emails as well as all complete emails that have become complete since the last time this function was called. This can be implemented by storing a retrieved boolean as falswe when update_status saves as complete, and setting that boolean to true when this function is run.
Implementors
impl MailstromStorage for MemoryStorage
[src]
type Error = MemoryStorageError
fn store(
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
[src]
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
fn update_status(
&mut self,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
[src]
&mut self,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
fn retrieve(
&self,
message_id: &str
) -> Result<(PreparedEmail, InternalMessageStatus), MemoryStorageError>
[src]
&self,
message_id: &str
) -> Result<(PreparedEmail, InternalMessageStatus), MemoryStorageError>
fn retrieve_status(
&self,
message_id: &str
) -> Result<InternalMessageStatus, MemoryStorageError>
[src]
&self,
message_id: &str
) -> Result<InternalMessageStatus, MemoryStorageError>
fn retrieve_all_incomplete(
&self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
[src]
&self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
fn retrieve_all_recent(
&mut self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
[src]
&mut self
) -> Result<Vec<InternalMessageStatus>, Self::Error>