pub struct ForwardTemplateBuilder<'a> {
config: Arc<AccountConfig>,
msg: &'a Message<'a>,
headers: Vec<(String, String)>,
body: String,
posting_style: Option<ForwardTemplatePostingStyle>,
signature_style: Option<ForwardTemplateSignatureStyle>,
pub interpreter: MimeInterpreterBuilder,
pub thread_interpreter: MimeInterpreterBuilder,
}
Expand description
The message reply template builder.
This builder helps you to create a template in order to reply to an existing message.
Fields§
§config: Arc<AccountConfig>
Reference to the current account configuration.
msg: &'a Message<'a>
Reference to the original message.
headers: Vec<(String, String)>
Additional headers to add at the top of the template.
body: String
Default body to put in the template.
posting_style: Option<ForwardTemplatePostingStyle>
Override the placement of the quote.
Uses the quote placement from the account configuration if
this one is None
.
signature_style: Option<ForwardTemplateSignatureStyle>
Override the placement of the signature.
Uses the signature placement from the account configuration if
this one is None
.
interpreter: MimeInterpreterBuilder
Template interpreter instance.
thread_interpreter: MimeInterpreterBuilder
Template interpreter instance dedicated to the message thread.
Implementations§
source§impl<'a> ForwardTemplateBuilder<'a>
impl<'a> ForwardTemplateBuilder<'a>
sourcepub fn new(msg: &'a Message<'_>, config: Arc<AccountConfig>) -> Self
pub fn new(msg: &'a Message<'_>, config: Arc<AccountConfig>) -> Self
Creates a forward template builder from an account configuration and a message references.
sourcepub fn with_headers(
self,
headers: impl IntoIterator<Item = (impl ToString, impl ToString)>
) -> Self
pub fn with_headers( self, headers: impl IntoIterator<Item = (impl ToString, impl ToString)> ) -> Self
Sets additional template headers following the builder pattern.
sourcepub fn with_some_headers(
self,
headers: Option<impl IntoIterator<Item = (impl ToString, impl ToString)>>
) -> Self
pub fn with_some_headers( self, headers: Option<impl IntoIterator<Item = (impl ToString, impl ToString)>> ) -> Self
Sets some additional template headers following the builder pattern.
sourcepub fn with_body(self, body: impl ToString) -> Self
pub fn with_body(self, body: impl ToString) -> Self
Sets the template body following the builder pattern.
sourcepub fn with_some_body(self, body: Option<impl ToString>) -> Self
pub fn with_some_body(self, body: Option<impl ToString>) -> Self
Sets some template body following the builder pattern.
sourcepub fn set_some_posting_style(
&mut self,
style: Option<impl Into<ForwardTemplatePostingStyle>>
)
pub fn set_some_posting_style( &mut self, style: Option<impl Into<ForwardTemplatePostingStyle>> )
Set some forward posting style.
sourcepub fn set_posting_style(
&mut self,
style: impl Into<ForwardTemplatePostingStyle>
)
pub fn set_posting_style( &mut self, style: impl Into<ForwardTemplatePostingStyle> )
Set the forward posting style.
sourcepub fn with_some_posting_style(
self,
style: Option<impl Into<ForwardTemplatePostingStyle>>
) -> Self
pub fn with_some_posting_style( self, style: Option<impl Into<ForwardTemplatePostingStyle>> ) -> Self
Set some forward posting style, using the builder pattern.
sourcepub fn with_posting_style(
self,
style: impl Into<ForwardTemplatePostingStyle>
) -> Self
pub fn with_posting_style( self, style: impl Into<ForwardTemplatePostingStyle> ) -> Self
Set the forward posting style, using the builder pattern.
sourcepub fn set_signature_style(
&mut self,
style: impl Into<ForwardTemplateSignatureStyle>
)
pub fn set_signature_style( &mut self, style: impl Into<ForwardTemplateSignatureStyle> )
Set the signature style.
sourcepub fn set_some_signature_style(
&mut self,
style: Option<impl Into<ForwardTemplateSignatureStyle>>
)
pub fn set_some_signature_style( &mut self, style: Option<impl Into<ForwardTemplateSignatureStyle>> )
Set some signature style.
sourcepub fn with_some_signature_style(
self,
style: Option<impl Into<ForwardTemplateSignatureStyle>>
) -> Self
pub fn with_some_signature_style( self, style: Option<impl Into<ForwardTemplateSignatureStyle>> ) -> Self
Set some signature style, using the builder pattern.
sourcepub fn with_signature_style(
self,
style: impl Into<ForwardTemplateSignatureStyle>
) -> Self
pub fn with_signature_style( self, style: impl Into<ForwardTemplateSignatureStyle> ) -> Self
Set the signature style, using the builder pattern.
sourcepub fn with_interpreter(self, interpreter: MimeInterpreterBuilder) -> Self
pub fn with_interpreter(self, interpreter: MimeInterpreterBuilder) -> Self
Sets the template interpreter following the builder pattern.
sourcepub fn with_thread_interpreter(
self,
interpreter: MimeInterpreterBuilder
) -> Self
pub fn with_thread_interpreter( self, interpreter: MimeInterpreterBuilder ) -> Self
Sets the template thread interpreter following the builder pattern.