module type KV =sig..end
KV provides access to typed and named values.
type'acodec =('a -> string) * (string -> ('a, Rresult.R.msg) Rresult.result)
exception Decode_error of string * Rresult.R.msg
Decode (key,
msg) is raised it means that the store's data for key could
not be decoded using the client's codec. This exception is not
meant to be handled by programs, it indicates a configuration
mismatch between the program and its environment.type 'a key
'a.val key : string -> 'a codec -> 'a keykey name codec is a key with lookup name name and whose value
is codec'd by codec.val key_name : 'a key -> stringkey_name k is k's name.val key_codec : 'a key -> 'a codeckey_codec k is k's codec.val mem : 'a key -> boolmem k is true iff k is bound to a value of type 'a
in the key-value store.val find : 'a key -> 'a optionfind k is k's binding in the key-value store (if any).Decode_error in case of value decode error.val get : ?absent:'a -> 'a key -> 'aget k is k's binding the key-value store. If absent is
specified this value is returned if k is not bound in the store.Invalid_argument if k is unbound in the key-value store
and absent is not specified. TODO maybe unify that with
Decode_error.Decode_error in case of value decode error.val set : 'a key -> 'a option -> unitset k v sets the key value of k to v.type watcher
val watch : 'a key -> ('a key -> 'a option -> unit) -> watcher
val unwatch : watcher -> unitunwatch w stops the watcher w. After that call it's callback
is guaranteed not to be called again.