Struct mml::message::MmlBodyCompiler
source · pub struct MmlBodyCompiler {
pgp: Option<Pgp>,
pgp_sender: Option<String>,
pgp_recipients: Vec<String>,
}
Available on crate feature
compiler
only.Expand description
MML → MIME message body compiler.
The compiler follows the builder pattern, where the build function
is named compile
.
Fields§
§pgp: Option<Pgp>
Available on crate feature
§pgp
only.pgp_sender: Option<String>
Available on crate feature
§pgp
only.pgp_recipients: Vec<String>
Available on crate feature
pgp
only.Implementations§
source§impl<'a> MmlBodyCompiler
impl<'a> MmlBodyCompiler
pub fn set_pgp(&mut self, pgp: impl Into<Pgp>)
Available on crate feature
pgp
only.pub fn with_pgp(self, pgp: impl Into<Pgp>) -> Self
Available on crate feature
pgp
only.pub fn set_some_pgp(&mut self, pgp: Option<impl Into<Pgp>>)
Available on crate feature
pgp
only.pub fn with_some_pgp(self, pgp: Option<impl Into<Pgp>>) -> Self
Available on crate feature
pgp
only.pub fn with_pgp_sender(self, sender: Option<String>) -> Self
Available on crate feature
pgp
only.pub fn with_pgp_recipients(self, recipients: Vec<String>) -> Self
Available on crate feature
pgp
only.sourceasync fn encrypt_part(&self, clear_part: &MimePart<'a>) -> Result<MimePart<'a>>
Available on crate feature pgp
only.
async fn encrypt_part(&self, clear_part: &MimePart<'a>) -> Result<MimePart<'a>>
pgp
only.Encrypt the given MIME part using PGP.
sourceasync fn try_encrypt_part(&self, clear_part: MimePart<'a>) -> MimePart<'a>
Available on crate feature pgp
only.
async fn try_encrypt_part(&self, clear_part: MimePart<'a>) -> MimePart<'a>
pgp
only.Try to encrypt the given MIME part using PGP.
If the operation fails, log a warning and return the original MIME part.
sourceasync fn sign_part(&self, clear_part: MimePart<'a>) -> Result<MimePart<'a>>
Available on crate feature pgp
only.
async fn sign_part(&self, clear_part: MimePart<'a>) -> Result<MimePart<'a>>
pgp
only.Sign the given MIME part using PGP.
sourceasync fn try_sign_part(&self, clear_part: MimePart<'a>) -> MimePart<'a>
Available on crate feature pgp
only.
async fn try_sign_part(&self, clear_part: MimePart<'a>) -> MimePart<'a>
pgp
only.Try to sign the given MIME part using PGP.
If the operation fails, log a warning and return the original MIME part.
sourcefn unescape_mml_markup(text: impl AsRef<str>) -> String
fn unescape_mml_markup(text: impl AsRef<str>) -> String
Replace escaped opening and closing tags by normal opening and closing tags.
sourceasync fn compile_parts(
&'a self,
parts: Vec<Part<'a>>
) -> Result<MessageBuilder<'_>>
async fn compile_parts( &'a self, parts: Vec<Part<'a>> ) -> Result<MessageBuilder<'_>>
Compile given parts parsed from a MML body to a MessageBuilder.
sourcefn compile_part<'async_recursion>(
&'a self,
part: Part<'a>
) -> Pin<Box<dyn Future<Output = Result<MimePart<'_>>> + Send + 'async_recursion>>where
'a: 'async_recursion,
fn compile_part<'async_recursion>(
&'a self,
part: Part<'a>
) -> Pin<Box<dyn Future<Output = Result<MimePart<'_>>> + Send + 'async_recursion>>where
'a: 'async_recursion,
Compile the given part parsed from MML body to a MimePart.
sourcepub async fn compile(&'a self, mml_body: &'a str) -> Result<MessageBuilder<'_>>
pub async fn compile(&'a self, mml_body: &'a str) -> Result<MessageBuilder<'_>>
Compile the given raw MML body to MIME body.
Trait Implementations§
source§impl Clone for MmlBodyCompiler
impl Clone for MmlBodyCompiler
source§fn clone(&self) -> MmlBodyCompiler
fn clone(&self) -> MmlBodyCompiler
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 MmlBodyCompiler
impl Debug for MmlBodyCompiler
source§impl Default for MmlBodyCompiler
impl Default for MmlBodyCompiler
source§fn default() -> MmlBodyCompiler
fn default() -> MmlBodyCompiler
Returns the “default value” for a type. Read more
source§impl PartialEq for MmlBodyCompiler
impl PartialEq for MmlBodyCompiler
source§fn eq(&self, other: &MmlBodyCompiler) -> bool
fn eq(&self, other: &MmlBodyCompiler) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for MmlBodyCompiler
impl StructuralPartialEq for MmlBodyCompiler
Auto Trait Implementations§
impl Freeze for MmlBodyCompiler
impl !RefUnwindSafe for MmlBodyCompiler
impl Send for MmlBodyCompiler
impl Sync for MmlBodyCompiler
impl Unpin for MmlBodyCompiler
impl !UnwindSafe for MmlBodyCompiler
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.