Module B0.Cache

module Cache: sig .. end
Build cache.


Cache


type t 
The type for caches.
val empty : index_file:B0.Fpath.t -> dir:B0.Fpath.t -> t
empty ~index_file ~dir is an empty cache with index index and directory dir. The file system is left untouched, in particular dir is not created, see also B0.Cache.load.
val is_empty : t -> bool
is_empty c is true iff c is empty.
val dir : t -> B0.Fpath.t
dir c is c's directory.
val index_file : t -> B0.Fpath.t
index_file c is c's index file.

Persist


val exists : index_file:B0.Fpath.t -> bool B0.result
exists ~index_file ~dir is true if index_file exists.
val load : index_file:B0.Fpath.t -> dir:B0.Fpath.t -> t B0.result
load ~index_file ~dir loads a cache from index_file and dir. If index_file doesn't exist an B0.Cache.empty index is created (but index_file is not written yet). If dir doesn't exist it is created.
val save : t -> unit B0.result
save t saves the cache.