Module Fm.Index

An abstraction on top of the index library that exposes an API that better fits the irmin-pack use case.

type t
type key
type value = Optint.Int63.t * int * Irmin_pack.Pack_value.Kind.t
include Index.S with type value := value and type t := t and type key := key
type cache
val empty_cache : unit -> cache
val clear : t -> unit
val replace : ?overcommit:bool -> t -> key -> value -> unit
val sync : t -> unit
val is_merging : t -> bool
module Checks : sig ... end
module Io : Io.S

Low level IO abstraction. A typical implementation is unix. This abstraction is meant to be dead simple. Not a lot of documentation is required.

val v_exn : ?flush_callback:(unit -> unit) -> ?fresh:bool -> ?readonly:bool -> ?throttle:[ `Block_writes | `Overcommit_memory ] -> ?lru_size:int -> log_size:int -> string -> t
type create_error := [
  1. | `Index_failure of string
  2. | `Io_misc of Io.misc_error
]
type write_error := [
  1. | `Index_failure of string
  2. | `Io_misc of Io.misc_error
  3. | `Ro_not_allowed
]
val v : ?flush_callback:(unit -> unit) -> ?fresh:bool -> ?readonly:bool -> ?throttle:[ `Block_writes | `Overcommit_memory ] -> ?lru_size:int -> log_size:int -> string -> (t, [> create_error ]) Stdlib.result
val reload : t -> (unit, [> write_error ]) Stdlib.result
val close : t -> (unit, [> write_error ]) Stdlib.result
val close_exn : t -> unit
val flush : t -> with_fsync:bool -> (unit, [> write_error ]) Stdlib.result
val find : t -> key -> value option
val add : ?overcommit:bool -> t -> key -> value -> unit
val merge : t -> unit
val mem : t -> key -> bool
val iter : (key -> value -> unit) -> t -> unit
val filter : t -> ((key * value) -> bool) -> unit
val try_merge : t -> unit
module Stats = Index.Stats
module Key : Index.Key.S with type t = key