package mrmime

  1. Overview
  2. Docs
type 'a elt = {
  1. header : Header.t;
  2. body : 'a;
}
type 'a t =
  1. | Leaf of 'a elt
  2. | Multipart of 'a t option list elt
  3. | Message of 'a t elt
val heavy_octet : string option -> Header.t -> string Angstrom.t

Heavy parser of a body - it will stores bodies into string.

val light_octet : emitter:(string option -> unit) -> string option -> Header.t -> unit Angstrom.t

Light parser of body - it sends contents to given emitter.

val mail : (Header.t * string t) Angstrom.t

Angstrom parser of an entire RFC 5322 mail (including header).

type 'id emitters = Header.t -> (string option -> unit) * 'id
val stream : emitters:(Header.t -> (string option -> unit) * 'id) -> (Header.t * 'id t) Angstrom.t

stream ~emitters is an Angstrom parser of an entire RFC 5322 mail which will use given emitters by emitters to store bodies.