eml_codec/part/
discrete.rs

1use std::fmt;
2
3use crate::mime;
4
5#[derive(PartialEq)]
6pub struct Text<'a> {
7    pub mime: mime::MIME<'a, mime::r#type::DeductibleText>,
8    pub body: &'a [u8],
9}
10
11impl<'a> fmt::Debug for Text<'a> {
12    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
13        fmt.debug_struct("part::Text")
14            .field("mime", &self.mime)
15            .field("body", &String::from_utf8_lossy(self.body))
16            .finish()
17    }
18}
19
20#[derive(PartialEq)]
21pub struct Binary<'a> {
22    pub mime: mime::MIME<'a, mime::r#type::Binary>,
23    pub body: &'a [u8],
24}
25
26impl<'a> fmt::Debug for Binary<'a> {
27    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
28        fmt.debug_struct("part::Binary")
29            .field("mime", &self.mime)
30            .field("body", &String::from_utf8_lossy(self.body))
31            .finish()
32    }
33}