Email_message_kernel.Headersinclude module type of struct include Headers endmodule Normalize : sig ... endNormalize specifies how to handle header values. It is used in two contexts:
module Name : sig ... endCase insensitive
module Common : sig ... endThis is just a list of commonly used header field names for simple reuse
module Value : sig ... endinclude Ppx_compare_lib.Comparable.S with type t := tinclude Ppx_hash_lib.Hashable.S_any with type t := tval hash_fold_t : t Ppx_hash_lib.hash_foldval hash : t -> Ppx_hash_lib.Std.Hash.hash_valueval sexp_of_t : t -> Sexplib0.Sexp.tinclude Ppx_compare_lib.Equal.S with type t := tval to_string_monoid : ?eol:Lf_or_crlf.t -> t -> String_monoid.teol defaults to `LF
val to_string : ?eol:Lf_or_crlf.t -> t -> stringval empty : tval length : t -> intval of_list : normalize:Normalize.encode -> (Name.t * Value.t) list -> tval to_list : ?normalize:Normalize.decode -> t -> (Name.t * Value.t) listval last : ?normalize:Normalize.decode -> t -> Name.t -> Value.t optionval any : ?normalize:Normalize.decode -> t -> Name.t -> Value.t optionval find_all : ?normalize:Normalize.decode -> t -> Name.t -> Value.t listval add : ?normalize:Normalize.encode -> t -> name:Name.t -> value:Value.t -> tval add_at_bottom :
?normalize:Normalize.encode ->
t ->
name:Name.t ->
value:Value.t ->
tval add_if_missing :
?normalize:Normalize.encode ->
t ->
name:Name.t ->
value:Value.t ->
tval add_at_bottom_if_missing :
?normalize:Normalize.encode ->
t ->
name:Name.t ->
value:Value.t ->
tval set : ?normalize:Normalize.encode -> t -> name:Name.t -> value:Value.t -> tval set_at_bottom :
?normalize:Normalize.encode ->
t ->
name:Name.t ->
value:Value.t ->
tval add_all : ?normalize:Normalize.encode -> t -> (Name.t * Value.t) list -> tval add_all_at_bottom :
?normalize:Normalize.encode ->
t ->
(Name.t * Value.t) list ->
tval smash_and_add :
?normalize:Normalize.encode ->
t ->
name:Name.t ->
value:Value.t ->
tIf headers with this name already exist, concatenates the values for all separated by a comma, and appends the new value. Otherwise, creates a new header.
val filter :
?normalize:Normalize.decode ->
t ->
f:(name:Name.t -> value:Value.t -> bool) ->
trewrite header values, preserving original whitespace where possible.
normalize is used to Value.of_string ?normalize the ~value before passing to f, and again to Value.to_string ?normalize the result. If the ~value and f ~name ~value are the same no change will be made (white space is preserved).
Particularly the following is an identity transform: map ~normalize:`Whitespace ~f:(fun ~name:_ ~value -> Value.of_string ~normalize:`Whitespace value) . By contrast the following will 'normalize' the whitespace on all headers. map ~normalize:`None ~f:(fun ~name:_ ~value -> Value.of_string ~normalize:`Whitespace value) .
module Stable : sig ... endmodule Encoded_word : sig ... end