Module header_encoding

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).

Structs§

EncodeClosure
A wrapper for an closure making it implement EncodableInHeader.
EncodeFn
A wrapper for an function making it implement EncodableInHeader.
EncodingBuffer
EncodingBuffer for a Mail providing a buffer for encodable traits.
EncodingWriter
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§

ConditionalWriteResult

Constants§

LINE_LEN_HARD_LIMIT
as specified in RFC 5322 (mail) + RFC 5321 (smtp) not including CRLF
LINE_LEN_SOFT_LIMIT
as specified in RFC 5322 not including CRLF
NEWLINE
NEWLINE_WITH_SPACE

Traits§

EncodableInHeader
Trait Implemented by “components” used in header field bodies
EncodableInHeaderBoxExt