package irmin-indexeddb

  1. Overview
  2. Docs

Private slices.

Slices

Slices are serializable.

include Tc.S0 with type t = slice
type t = slice
val equal : t Tc.equal
val compare : t Tc.compare
val hash : t Tc.hash
val to_json : t Tc.to_json

The REST inteface.

val of_json : t Tc.of_json
val size_of : t Tc.size_of

The serialization format.

val write : t Tc.writer
val read : t Tc.reader
type contents = Contents.key * Contents.value

The type for exported contents.

type node = Node.key * Node.value

The type for exported nodes.

type commit = Commit.key * Commit.value

The type for exported commits.

val create : unit -> t Lwt.t

Create a new empty slice.

val add_contents : t -> contents -> unit Lwt.t

add_contents t c adds the contents c to the slice t.

val add_node : t -> node -> unit Lwt.t

add_node t n adds the node n to the slice t.

val add_commit : t -> commit -> unit Lwt.t

add_commit t c adds the commit c to the slice t.

val iter_contents : t -> (contents -> unit Lwt.t) -> unit Lwt.t

iter_contents t f calls f on t's contents.

val iter_nodes : t -> (node -> unit Lwt.t) -> unit Lwt.t

iter_nodes t f calls f on t's nodes.

val iter_commits : t -> (commit -> unit Lwt.t) -> unit Lwt.t

iter_commits t f calls f on t's commits.