Up

Module Email

Signature

type t
val empty : unit -> t

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) * | O(1), O(1) | O(N), O(N)

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

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

type email = t
module Multipart : sig .. end
module Content : sig .. end
val headers : t -> Headers.t
val set_headers : t -> Headers.t -> t
val add_headers : t -> Headers.t -> t
val add_headers_at_bottom : t -> Headers.t -> t
val content : t -> Content.t
val create : headers:Headers.t -> content:Content.t -> t
val map_data : t -> f:(Octet_stream.t -> Octet_stream.t) -> t

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

val raw_content : t -> Bigstring_shared.t

The content of the body itself, without headers.

val to_bigstring_shared : t -> Bigstring_shared.t
include String_monoidable.S with type t := t
type t
val to_string_monoid : t -> String_monoid.t
include Core.Std.Stringable.S with type t := t
type t
val of_string : string -> t
val to_string : t -> string
include Bigstringable.S with type t := t
type t

Creates an object of type t from a Bigstring.t. The source Bigstring might not be copied, so it should be copied if the need to mutate it arises. The latter does not apply if the implementation of to_bigstring explicitly says that this is unnecessary.

val to_bigstring : t -> Core.Std.Bigstring.t

Bigstring representation of an object of type t. t may hold references to the resulting Bigstring, so it should be copied if the need to mutate it arises. The latter does not apply if the implementation explicitly says that it is unnecessary.

include Core.Std.Sexpable.S with type t := t
type t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
include Core.Std.Comparable.S with type t := t
include Comparable_intf.S_common
include Comparable_intf.Polymorphic_compare
include Polymorphic_compare_intf.Infix
type t
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~cmp:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool
val clamp_exn : t -> min:t -> max:t -> t

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

val clamp : t -> min:t -> max:t -> t Or_error.t
include Comparator.S with type t := t
type t
type comparator_witness
include Comparable_intf.Validate with type t := t
type t
val validate_lbound : min:t Maybe_bound.t -> t Validate.check
val validate_ubound : max:t Maybe_bound.t -> t Validate.check
val validate_bound : min:t Maybe_bound.t -> max:t Maybe_bound.t -> t Validate.check
include Core.Std.Binable.S with type t := t
type t
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (int -> t) Bin_prot.Read.reader

This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.

val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
val hash : t -> int
module Simple : sig .. end