Module mail_internals::encoder
source · Expand description
This module provides the encoding buffer.
The encoding buffer is the buffer header implementations write there data to. It provides a view special aspects to make it more robust.
For example it handles the writing of trailing newlines for headers (if they don’t do it) and it fails if you write utf-8 data (in the header) to an buffer which knows that the used mail type doesn’t support it.
There is also a special tracing (cargo) feature which
will make it’s usage slower, but which will keep track of
what data was inserted in which way making debugging and
writing tests easier. (Through it should only be enabled
for testing and maybe debugging in some cases).
Macros
Generate a think implementing
EncodableInHeader from an closure.Generate a think implementing
EncodableInHeader from an function.Structs
A wrapper for an closure making it implement
EncodableInHeader.A wrapper for an function making it implement
EncodableInHeader.EncodingBuffer for a Mail providing a buffer for encodable traits.
A handle providing method to write to the underlying buffer
keeping track of newlines the current line length and places
where the line can be broken so that the soft line length
limit (78) and the hard length limit (998) can be kept.
Enums
Constants
as specified in RFC 5322 (mail) + RFC 5321 (smtp) not including CRLF
as specified in RFC 5322 not including CRLF
Traits
Trait Implemented by “components” used in header field bodies