package mrmime

  1. Overview
  2. Docs
module Map : sig ... end
type key = string

Type of parameter key.

type value = [
  1. | `String of string
  2. | `Token of string
]

Type of parameter value.

type t = value Map.t

Type of parameters.

val of_list : (key * value) list -> t

Make t from an association list.

val key : string -> (key, [> Rresult.R.msg ]) Stdlib.result

key v makes a new key (according to RFC 2045 - otherwise, it returns an error).

val key_exn : string -> key
val k : string -> key
val value : string -> (value, [> Rresult.R.msg ]) Stdlib.result

value v makes a new value (according to RFC 2045 - otherwise, it returns an error).

val value_exn : string -> value
val v : string -> value
val empty : t

Empty parameters.

val mem : key -> t -> bool

mem key t returns true if key exists in t. Otherwise, it retunrs false.

val add : key -> value -> t -> t

add key value t adds key binded with value in t.

val singleton : key -> value -> t

singleton key value makes a new t with key binded with value.

val remove : key -> t -> t

delete key t deletes key and binded value from t.

val find : key -> t -> value option

find key t returns value binded with key in t.

val iter : (key -> value -> unit) -> t -> unit

iter f t applies f on any bindings availables in t.

val pp_key : key Fmt.t

Pretty-printer of key.

val pp_value : value Fmt.t

Pretty-printer of value.

val pp : t Fmt.t

Pretty-printers of t.

val compare : t -> t -> int

Comparison on t.

val equal : t -> t -> bool

Equal on t.

val default : t

Same as empty.

val to_list : t -> (key * value) list