pub struct ReplyTemplateBuilder<'a> {
config: Arc<AccountConfig>,
msg: &'a Message<'a>,
headers: Vec<(String, String)>,
body: String,
reply_all: bool,
posting_style: Option<ReplyTemplatePostingStyle>,
signature_style: Option<ReplyTemplateSignatureStyle>,
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.
reply_all: bool
Should reply to all.
posting_style: Option<ReplyTemplatePostingStyle>
Override the reply posting style.
Uses the posting style from the account configuration if this
one is None
.
signature_style: Option<ReplyTemplateSignatureStyle>
Override the signature style.
Uses the signature style 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> ReplyTemplateBuilder<'a>
impl<'a> ReplyTemplateBuilder<'a>
sourcepub fn new(msg: &'a Message<'_>, config: Arc<AccountConfig>) -> Self
pub fn new(msg: &'a Message<'_>, config: Arc<AccountConfig>) -> Self
Creates a reply 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<ReplyTemplatePostingStyle>>
)
pub fn set_some_posting_style( &mut self, style: Option<impl Into<ReplyTemplatePostingStyle>> )
Set some posting style.
sourcepub fn set_posting_style(&mut self, style: impl Into<ReplyTemplatePostingStyle>)
pub fn set_posting_style(&mut self, style: impl Into<ReplyTemplatePostingStyle>)
Set the posting style.
sourcepub fn with_some_posting_style(
self,
style: Option<impl Into<ReplyTemplatePostingStyle>>
) -> Self
pub fn with_some_posting_style( self, style: Option<impl Into<ReplyTemplatePostingStyle>> ) -> Self
Set some posting style, using the builder pattern.
sourcepub fn with_posting_style(
self,
style: impl Into<ReplyTemplatePostingStyle>
) -> Self
pub fn with_posting_style( self, style: impl Into<ReplyTemplatePostingStyle> ) -> Self
Set the posting style, using the builder pattern.
sourcepub fn set_some_signature_style(
&mut self,
style: Option<impl Into<ReplyTemplateSignatureStyle>>
)
pub fn set_some_signature_style( &mut self, style: Option<impl Into<ReplyTemplateSignatureStyle>> )
Set some signature style.
sourcepub fn set_signature_style(
&mut self,
style: impl Into<ReplyTemplateSignatureStyle>
)
pub fn set_signature_style( &mut self, style: impl Into<ReplyTemplateSignatureStyle> )
Set the signature style.
sourcepub fn with_some_signature_style(
self,
style: Option<impl Into<ReplyTemplateSignatureStyle>>
) -> Self
pub fn with_some_signature_style( self, style: Option<impl Into<ReplyTemplateSignatureStyle>> ) -> Self
Set some signature style, using the builder pattern.
sourcepub fn with_signature_style(
self,
style: impl Into<ReplyTemplateSignatureStyle>
) -> Self
pub fn with_signature_style( self, style: impl Into<ReplyTemplateSignatureStyle> ) -> 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
Set 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
Set the template thread interpreter following the builder pattern.
sourcepub fn with_reply_all(self, all: bool) -> Self
pub fn with_reply_all(self, all: bool) -> Self
Set the reply all flag following the builder pattern.