Struct mml::message::interpreter::MimeInterpreter
source · pub struct MimeInterpreter { /* private fields */ }
Expand description
The template interpreter interprets full emails as
[crate::Tpl
]. The interpreter needs to be customized first. The
customization follows the builder pattern. When the interpreter is
customized, calling any function matching interpret_*()
consumes
the interpreter and generates the final [crate::Tpl
].
Implementations§
source§impl MimeInterpreter
impl MimeInterpreter
pub fn new() -> Self
pub fn with_show_headers(self, s: ShowHeadersStrategy) -> Self
pub fn with_show_all_headers(self) -> Self
pub fn with_show_only_headers( self, headers: impl IntoIterator<Item = impl ToString> ) -> Self
pub fn with_show_additional_headers( self, headers: impl IntoIterator<Item = impl ToString> ) -> Self
pub fn with_hide_all_headers(self) -> Self
pub fn with_show_multiparts(self, b: bool) -> Self
pub fn with_filter_parts(self, f: FilterParts) -> Self
pub fn with_show_plain_texts_signature(self, b: bool) -> Self
pub fn with_show_attachments(self, b: bool) -> Self
pub fn with_show_inline_attachments(self, b: bool) -> Self
pub fn with_save_attachments(self, b: bool) -> Self
pub fn with_save_attachments_dir(self, dir: impl Into<PathBuf>) -> Self
sourcepub async fn interpret_msg(self, msg: &Message<'_>) -> Result<String>
pub async fn interpret_msg(self, msg: &Message<'_>) -> Result<String>
Interprets the given mail_parser::Message
as a MML string.
sourcepub async fn interpret_bytes(self, bytes: impl AsRef<[u8]>) -> Result<String>
pub async fn interpret_bytes(self, bytes: impl AsRef<[u8]>) -> Result<String>
Interprets the given bytes as a MML string.
sourcepub async fn interpret_msg_builder(
self,
builder: MessageBuilder<'_>
) -> Result<String>
pub async fn interpret_msg_builder( self, builder: MessageBuilder<'_> ) -> Result<String>
Interprets the given mail_builder::MessageBuilder
as a MML
string.
Trait Implementations§
source§impl Clone for MimeInterpreter
impl Clone for MimeInterpreter
source§fn clone(&self) -> MimeInterpreter
fn clone(&self) -> MimeInterpreter
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MimeInterpreter
impl Debug for MimeInterpreter
source§impl Default for MimeInterpreter
impl Default for MimeInterpreter
source§fn default() -> MimeInterpreter
fn default() -> MimeInterpreter
Returns the “default value” for a type. Read more
source§impl PartialEq<MimeInterpreter> for MimeInterpreter
impl PartialEq<MimeInterpreter> for MimeInterpreter
source§fn eq(&self, other: &MimeInterpreter) -> bool
fn eq(&self, other: &MimeInterpreter) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for MimeInterpreter
impl StructuralEq for MimeInterpreter
impl StructuralPartialEq for MimeInterpreter
Auto Trait Implementations§
impl RefUnwindSafe for MimeInterpreter
impl Send for MimeInterpreter
impl Sync for MimeInterpreter
impl Unpin for MimeInterpreter
impl UnwindSafe for MimeInterpreter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.