#[non_exhaustive]pub struct RenderOptions {
pub include_bcc: bool,
pub soft_fold_at: Option<usize>,
}Expand description
Render-time options for render_rfc822_with.
The struct is #[non_exhaustive]; future fields will be additive.
Construct via Self::new or Self::default and chain
with_* setters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.include_bcc: boolWhen true, the rendered message includes a Bcc: header line
listing the message’s BCC recipients. Defaults to false.
Most SMTP relays strip Bcc: on submission anyway; rendering
the field is occasionally useful for archival, .eml fixtures,
or clients that consume the rendered bytes outside the SMTP
path.
soft_fold_at: Option<usize>Optional soft-fold target for header lines, in characters.
None (the default) emits header lines at the RFC 5322 §2.1.1
hard limit of 998 characters with no soft folding, long values
flow on a single physical line. Some(n) instructs the renderer
to fold longer lines at n characters via the standard
folding-whitespace mechanism (CRLF + leading SP/HTAB), targeting
the SHOULD ≤ 78 recommendation when n == 78.
The default is None because correct soft folding requires
per-header-grammar awareness (encoded-word boundaries,
address-list comma discipline, structured-header whitespace
rules) that the simple folding helper cannot guarantee in every
case. Callers who want SHOULD-compliant output for archival or
for strict legacy MTAs can opt in via with_soft_fold(78); the
renderer still respects the 998 hard limit regardless.
Implementations§
Source§impl RenderOptions
impl RenderOptions
pub const fn new() -> Self
pub const fn with_include_bcc(self, value: bool) -> Self
Sourcepub const fn with_soft_fold(self, soft_fold_at: usize) -> Self
pub const fn with_soft_fold(self, soft_fold_at: usize) -> Self
Set the soft-fold target. Pass 78 for the RFC 5322 §2.1.1
SHOULD-compliant recommendation; pass any other positive integer
up to 997 for a custom target.
Sourcepub const fn without_soft_fold(self) -> Self
pub const fn without_soft_fold(self) -> Self
Disable soft folding. Long header values flow on one physical line up to the 998-character hard limit.
Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more