Module Email_message__.Email_content

The cost depends on the encoding of the content and the main media type.

N = Size of the message H = Size of the headers of the sub-message(s)

Format: time complexity, memory complexity

. | 7bit, 8bit, binary | Base64, Quoted_printable ------------------------------------------------------------- message | O(N), O(H) | O(N), O(N) multipart | O(N), O(H) | O(N), O(N) other | O(1), O(1) | O(N), O(N)

Where other is any other main media type: text, image, application...

Encoding and type can be obtained from the headers, using the modules Headers.Content_type and Headers.Content_transfer_encoding, and the corresponding default values.

module Multipart : sig ... end
type t =
| Multipart of Multipart.t
| Message of Email_message.Email.t
| Data of Email_message.Octet_stream.t
include sig ... end
val sexp_of_t : t ‑> Sexplib.Sexp.t
val parse : ?⁠container_headers:Email_message__.Headers.t ‑> Email_message.Email.t ‑> t Core.Or_error.t

parse ?container_headers email parses the content of email. The default content type of a multipart body changes based on the container headers. This only comes into play if the container had "Content-Type: multipart/digest".

val to_email : headers:Email_message__.Headers.t ‑> t ‑> Email_message.Email.t
val set_content : Email_message.Email.t ‑> t ‑> Email_message.Email.t
val map_data : ?⁠on_unparsable_content:[ `Skip | `Raise ] ‑> Email_message.Email.t ‑> f:(Email_message.Octet_stream.t ‑> Email_message.Octet_stream.t) ‑> Email_message.Email.t

Allow changing the message content to mask the actual data but retain the structure

val to_raw_content : t ‑> Email_message__.Email_raw_content.t
val to_bigstring_shared : t ‑> Email_message.Bigstring_shared.t
val to_string_monoid : t ‑> Email_message.String_monoid.t