123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106moduletypeS=sigtypekeytypevaluetypettypecachevalempty_cache:unit->cache(** [empty_cache ()] returns a fresh, empty cache. *)valcreate:?cache:cache->?record:string->string->t(** [create ?cache ?record root] creates a btree storage in directory [root]. If no [cache] is
specified each call to create opens a fresh instance. If [record] is specified then a trace is
recorded in file [record]. *)valreplay:string->?prog:[`None|`Single|`Multiple]->t->unit(** [replay ?prog path t] replays the operations stored in file [path]. *)valinit:root:string->int->read:(int->string)->t(** [init ~root n ~read] performs a batch initialisation. [read] is an iterator-like function :
[read n] reads the next [n] bindings and returns them in a single string chunk which is the
concatenation of each [key ^ value]. [init] is (much) faster than adding each bindings one by
one. It assumes that the bindings are sorted. *)valreconstruct:string->t(** [reconstruct root] is like [create root] but assumes that the b.tree file in directory [root]
is corrupted (nodes are possibly corrupted but the leaves are not impacted) and repairs it
first. *)valadd:t->key->value->unitvalremove:t->key->unitvalfind:t->key->valuevalmem:t->key->boolvalclear:t->unitvalclose:t->unitvalflush:t->unitvaliter:(key->value->unit)->t->unitvaliteri:(int->key->value->unit)->t->unitvallength:t->int(** [length t] is the number of bindings in [t] *)valpp:tFmt.tvalsnapshot:?depth:int->t->unit(** For every node/leaf in [t] which are at least [depth] away from the leaves,
[snapshot ~depth t], write in a file its rep as given by their corresponding pp function. *)modulePrivate:sigmoduleParams:Params.SmoduleCommon:Field.COMMONmoduleEntry:Data.Entrywithtypeinput_key=keyandtypeinput_value=valuemoduleKey=Entry.KeymoduleValue=Entry.ValuemoduleStore:Store.SwithmoduleCommon=Field.MakeCommon(Params)modulePage=Store.PagemoduleLeaf:Leaf.Swithtypevalue=Value.tandtypekey=Key.tandtypestore:=Store.tandtypeaddress:=Store.addressmoduleNode:Node.Swithtypekey=Key.tandtypeaddress:=Store.addressandtypestore:=Store.tandtypekind:=Field.kindvaldir:t->stringvalstore:t->Store.tvalroot:t->intvalgo_to_leaf:t->key->intlistvalcache_size:t->intvalpp:t->intFmt.tendendmoduletypeSigs=sigmoduletypeS=SmoduleMake_ext(InKey:Input.Key)(InValue:Input.Value)(Size:Input.Size):Swithtypekey=InKey.tandtypevalue=InValue.tend