Enum vsmtp_common::queue::Queue
[−]pub enum Queue {
Working,
Deliver,
Deferred,
Dead,
}Expand description
identifiers for all mail queues.
Variants
Working
Postq.
Deliver
1st attempt to deliver.
Deferred
1st delivery attempt failed.
Dead
Too many attempts failed.
Implementations
impl Queue
impl Queue
pub fn list_entries(&self, queues_dirpath: &Path) -> Result<Vec<PathBuf>>
pub fn list_entries(&self, queues_dirpath: &Path) -> Result<Vec<PathBuf>>
List the files contained in the queue
Errors
- failed to initialize queue
- error while reading directory
- one entry produced an error
pub fn write_to_queue(
&self,
queues_dirpath: &Path,
ctx: &MailContext
) -> Result<()>
pub fn write_to_queue(
&self,
queues_dirpath: &Path,
ctx: &MailContext
) -> Result<()>
Write a MailContext to the self queue
Errors
- the message’s metadata is ill-formed
- failed to serialize the
@ctx - failed to write on
@ctxonqueues_dirpath/self/ctx.id
pub async fn write_to_quarantine(path: &Path, mail: &MailContext) -> Result<()>
pub async fn write_to_quarantine(path: &Path, mail: &MailContext) -> Result<()>
Write a MessageBody to path provided
Errors
- failed to open file
- failed to serialize the
mail - failed to write the
mailonpath
pub fn write_to_mails(
queues_dirpath: &Path,
message_id: &str,
message: &MessageBody
) -> Result<()>
pub fn write_to_mails(
queues_dirpath: &Path,
message_id: &str,
message: &MessageBody
) -> Result<()>
Errors
- failed to create the folder in
queues_dirpath
pub async fn read_mail_context(
&self,
dirpath: &Path,
id: &str
) -> Result<MailContext>
pub async fn read_mail_context(
&self,
dirpath: &Path,
id: &str
) -> Result<MailContext>
pub async fn read_mail_message(dirpath: &Path, id: &str) -> Result<MessageBody>
pub async fn read_mail_message(dirpath: &Path, id: &str) -> Result<MessageBody>
pub async fn read(
&self,
dirpath: &Path,
id: &str
) -> Result<(MailContext, MessageBody)>
pub async fn read(
&self,
dirpath: &Path,
id: &str
) -> Result<(MailContext, MessageBody)>
Return a message body from a file path. Try to parse the file as JSON, if it fails, try to parse it as plain text.
Errors
- file(s) not found
- file found but failed to read
- file read but failed to serialize
pub fn move_to(
&self,
other: &Self,
queues_dirpath: &Path,
ctx: &MailContext
) -> Result<()>
pub fn move_to(
&self,
other: &Self,
queues_dirpath: &Path,
ctx: &MailContext
) -> Result<()>
Write the ctx to other AND THEN remove ctx from self
Errors
- see
Queue::write_to_queue - see
Queue::remove
Trait Implementations
impl IntoEnumIterator for Queue
impl IntoEnumIterator for Queue
impl Copy for Queue
impl StructuralPartialEq for Queue
Auto Trait Implementations
impl RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl UnwindSafe for Queue
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more