Struct mailstrom::storage::memory_storage::MemoryStorage
source · [−]pub struct MemoryStorage(_);
Implementations
sourceimpl MemoryStorage
impl MemoryStorage
pub fn new() -> MemoryStorage
Trait Implementations
sourceimpl Default for MemoryStorage
impl Default for MemoryStorage
sourcefn default() -> MemoryStorage
fn default() -> MemoryStorage
Returns the “default value” for a type. Read more
sourceimpl MailstromStorage for MemoryStorage
impl MailstromStorage for MemoryStorage
type Error = MemoryStorageError
sourcefn store(
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
fn store(
&mut self,
email: PreparedEmail,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
Store a PreparedEmail
. This should overwrite if message-id matches an existing
email. Read more
sourcefn update_status(
&mut self,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
fn update_status(
&mut self,
internal_message_status: InternalMessageStatus
) -> Result<(), MemoryStorageError>
Update the status of an email
sourcefn retrieve(
&self,
message_id: &str
) -> Result<(PreparedEmail, InternalMessageStatus), MemoryStorageError>
fn retrieve(
&self,
message_id: &str
) -> Result<(PreparedEmail, InternalMessageStatus), MemoryStorageError>
Retrieve a PreparedEmail
and InternalMessageStatus
based on the message_id
sourcefn retrieve_status(
&self,
message_id: &str
) -> Result<InternalMessageStatus, MemoryStorageError>
fn retrieve_status(
&self,
message_id: &str
) -> Result<InternalMessageStatus, MemoryStorageError>
Retrieve an InternalMessageStatus
based on the message_id
sourcefn retrieve_all_incomplete(
&self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
fn retrieve_all_incomplete(
&self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
Retrieve all incomplete emails (status only). This is used to continue retrying after shutdown and later startup. Read more
sourcefn retrieve_all_recent(
&mut self
) -> Result<Vec<InternalMessageStatus>, Self::Error>
fn retrieve_all_recent(
&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. Read more
Auto Trait Implementations
impl RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl UnwindSafe for MemoryStorage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more