package mirage-kv

  1. Overview
  2. Docs
On This Page
  1. Structured keys
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Mirage_kv.KeySource

Structured keys

Sourcetype t

The type for structured keys.

Sourceval empty : t

empty is the empty key. It refers to the top-level dictionary.

Sourceval v : string -> t

v s is the string s as a key. A key "/foo/bar" is decomposed into the segments "foo" and "bar". The initial "/" is always ignored so "foo/bar" and "/foo/bar" are equal.

Sourceval add : t -> string -> t

add t s is the concatenated key t/s. Raise Invalid_argument if s contains "/".

Sourceval (/) : t -> string -> t

t / x is add t x.

Sourceval append : t -> t -> t

append x y is the concatenated key x/y.

Sourceval (//) : t -> t -> t

x // y is append x y.

Sourceval segments : t -> string list

segments t is t's list of segments.

Sourceval basename : t -> string

basename t is the last segment of t. basename empty is the empty string "".

Sourceval parent : t -> t

parent t is the key without the last segment. parent empty is empty.

For any t, the invariant have parent t / basename t is t.

Sourceval compare : t -> t -> int

The comparison function for keys.

Sourceval equal : t -> t -> bool

The equality function for keys.

Sourceval pp : t Fmt.t

The pretty printer for keys.

Sourceval to_string : t -> string

to_string t is the string representation of t. "/" is used as separator between segements and it always starts with "/".

OCaml

Innovation. Community. Security.