[−][src]Struct trapmail::Mail
A "sent" mail.
Fields
cli_options: CliOptions
The command line arguments passed to trapmail
at the time of call.
pid: Pid
The ID of the trapmail
process that stored this email.
ppid: Pid
The ID of the parent process that called trapmail
.
body: MailBody
The trapmail
call's raw body.
timestamp_us: u128
A microsecond-resolution UNIX timestamp of when the mail arrived.
Methods
impl Mail
[src]
pub fn new(cli_options: CliOptions, raw_body: Vec<u8>) -> Self
[src]
Create a new Mail
using the current time and process information.
This function will sleep for a microsecond to avoid any conflicts in
naming (see file_name
).
Panics
Will panic if the system returns a time before the UNIX epoch.
pub fn file_name(&self) -> PathBuf
[src]
Create a (pathless) file_name depending on the Mail
contents.
pub fn load<P: AsRef<Path>>(source: P) -> Result<Self, Error>
[src]
Load a Mail
from a file.
Trait Implementations
impl Debug for Mail
[src]
impl<'de> Deserialize<'de> for Mail
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Mail
[src]
impl Serialize for Mail
[src]
Auto Trait Implementations
impl RefUnwindSafe for Mail
impl Send for Mail
impl Sync for Mail
impl Unpin for Mail
impl UnwindSafe for Mail
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,