part
ModuleThe MIME tree.
Contents
use utopia_smtp::mime::part::Chunks;Rust
pub struct Chunks<'a>The pieces a message or part is written in, read lazily: a file is opened and read block by block as the pieces are taken.
Also implements
Iterator.use utopia_smtp::mime::part::Part;Rust
pub struct PartOne node of the MIME tree: content, an attachment, or a boundary with children under it.
Rust
use utopia_smtp::mime::Part;
let part = Part::text("text/plain", "héllo".as_bytes());
assert_eq!(
part.head()?,
"Content-Type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n",
);
assert_eq!(part.to_bytes()?, b"h=C3=A9llo");