package opium

  1. Overview
  2. Docs

A context holds heterogeneous value and is passed to the requests or responses.

Keys

type 'a key = 'a Rock.Context.key

The type for keys whose lookup value is of type 'a.

Key

module Key : sig ... end

Maps

The type for heterogeneous value maps.

empty

val empty : t

empty is the empty map.

is_empty

val is_empty : t -> bool

is_empty m is true iff m is empty.

mem

val mem : 'a key -> t -> bool

mem k m is true iff k is bound in m.

add

val add : 'a key -> 'a -> t -> t

add k v m is m with k bound to v.

singleton

val singleton : 'a key -> 'a -> t

singleton k v is add k v empty.

rem

val rem : 'a key -> t -> t

rem k m is m with k unbound.

find

val find : 'a key -> t -> 'a option

find k m is the value of k's binding in m, if any.

find_exn

val find_exn : 'a key -> t -> 'a

find_exn k m is the value of k's binding find_exn m.

Utilities

sexp_of_t

val sexp_of_t : t -> Sexplib0.Sexp.t

sexp_of_t t converts the request t to an s-expression

pp_hum

val pp_hum : Format.formatter -> t -> unit

pp_hum formats the request t as a standard HTTP request

OCaml

Innovation. Community. Security.