package oasis

  1. Overview
  2. Docs

This module is a set of fields (Field.t and FieldRO.t) that can be addressed by their name (as string). Value can be set and retrieved as string only. However, the value itself is stored in its native type.

type ('a, 'b) value

A value.

type ('a, 'b) t

A schema.

val create : ?case_insensitive:bool -> name -> ('a, 'b) t

Create a schema.

val mem : ('a, 'b) t -> name -> bool

Check that the given field name exists.

val get : ('a, 'b) t -> Data.t -> name -> string

get t data nm Retrieve the string value of field nm from schema t stores in data.

val set : ('a, 'b) t -> Data.t -> name -> ?context:'a -> string -> unit

set t data nm ~context str Parse string value str in ~context and stores it in data for field nm of schema t.

val fold : ('a -> name -> 'b -> (unit -> string) option -> 'a) -> 'a -> ('c, 'b) t -> 'a

fold f acc t Apply f acc field_name field_extra field_help in turn to all fields of schema t.

val iter : (name -> 'a -> (unit -> string) option -> unit) -> ('b, 'a) t -> unit

Same as Schema.fold except no accumulator are involved.

val name : ('a, 'b) t -> name

Get the name of the schema.

OCaml

Innovation. Community. Security.