[][src]Struct trapmail::MailStore

pub struct MailStore { /* fields omitted */ }

Mail storage.

Methods

impl MailStore[src]

pub fn new() -> Self[src]

Construct a new MailStore.

The path will be set from the environment or use a default, if not set.

pub fn with_root<P: Into<PathBuf>>(root: P) -> Self[src]

Construct a new MailStore with given path.

pub fn add(&self, mail: &Mail) -> Result<PathBuf, Error>[src]

Add a mail to the MailStore.

Returns the path where the mail has been stored.

pub fn iter_mails(&self) -> impl Iterator<Item = Result<Mail, Error>>[src]

Iterate over all mails in storage.

Mails are ordered by timestamp.

Trait Implementations

impl Debug for MailStore[src]

impl Default for MailStore[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.