package mgit

Build not yet checked
  1. Overview
  2. Docs
Git in OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mgit-0.1.0.tbz
sha256=6fad812ce53e69e045c4d53d958fc0f12c13900841348dd37f0ba6dd0db2ba8d
sha512=3c2427bc9ee42748aa99540582125aea989dca574493ef46cae70d67ab005c517f079c6c537507b3cb53544811864d52d30df22993b7c297f6a6521f6484ff82

doc/mgit.blk/Mgit_blk/Make/index.html

Module Mgit_blk.MakeSource

Parameters

module Block : BLOCK

Signature

Sourcemodule Append : sig ... end
Sourcetype 'metadata t
Sourceval mapper : zone -> 'm t Cachet.map
Sourceval append : 'm t -> zone -> Append.t
Sourceval writer : 'm t -> zone -> 'm t Cachet_wr.t
Sourceval sink : 'm t -> zone -> (string, unit) Flux.sink
Sourceval bounds : 'm t -> zone -> int * int

bounds t which is the absolute offset and the length (in bytes) of the requested zone on the block-device.

Sourceval cachet : 'm t -> zone -> base:int -> len:int -> 'm t Cachet.t

cachet t which ~base ~len is a Cachet.t whose logical address 0 is the byte base of the zone which and which never reads further than base + len. Out of bounds reads return an empty bigstring, as Cachet.map requires.

Sourceval seq : 'm t -> zone -> ?off:int -> ?len:int -> unit -> string Seq.t

seq t which ~off ~len () streams len bytes of the zone which, starting at the byte off of that zone.

Sourceval source : 'm t -> zone -> ?off:int -> ?len:int -> unit -> string Flux.source
Sourceval metadata : 'm t -> 'm
Sourceval with_metadata : 'm t -> 'm -> 'm t
Sourceval sync : 'm t -> 'm t

sync t upgrades the current active zone and atomically save it into the block device.

Sourceval commit : 'm t -> 'm t

commit t sets the current active zone (the inactive zone becomes active and vice-versa) and atomically save it into the block device.

Sourceval format : ?ratio:float -> rd:(Bstr.t -> ('m, [ `Invalid_metadata ]) result) -> wr:('m -> Bstr.t -> int) -> ?length:int -> Block.t -> ('m t, [> `Invalid_metadata | `Msg of string ]) result
Sourceval expand : ?used:int -> ?length:int -> 'm t -> ('m t, [> `Msg of string ]) result

expand ~used ~length t grows the layout of t to length bytes (the length of the block-device by default) by keeping the ratio between the temporary zone and the zones A and B. used is the number of bytes of the active zone which must be kept (the whole zone by default). If the current layout already covers length bytes, t is returned unchanged.

The active zone is copied into a zone of the new layout which does not overlap it, then the superblock is updated: a failure in the middle of expand keeps the old layout valid.

Sourceval make : wr:('m -> Bstr.t -> int) -> rd:(Bstr.t -> ('m, [ `Invalid_metadata ]) result) -> Block.t -> ('m t, [> `Msg of string ]) result