package irmin-pack
Irmin backend which stores values in a pack file
Install
Dune Dependency
Authors
Maintainers
Sources
irmin-2.4.0.tbz
sha256=abe7d504aaa4c8fd0f08a04bbfb2748bc23f714df20dd6381b6885bcca56d4ac
sha512=e3097e50ea3598b3c5da4d567a4d3d053a2cd70549afb9ced6fcec8f6faf0677f5d7f8c0541515e0dd3d5eb1d3990e3067d47014deaf93cd52b92bb9f7319968
doc/src/irmin-pack.layered/inode_layers.ml.html
Source file inode_layers.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
(* * Copyright (c) 2013-2020 Thomas Gazagnaire <thomas@gazagnaire.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) include Inode_layers_intf open! Import let src = Logs.Src.create "irmin.pack.i.layers" ~doc:"layered inodes for the irmin-pack backend" module Log = (val Logs.src_log src : Logs.LOG) module I = Inode module Make (Conf : Irmin_pack.Config.S) (H : Irmin.Hash.S) (Pack_maker : S.LAYERED_PACK_MAKER with type key = H.t and type index = Pack_index.Make(H).t) (Node : Irmin.Private.Node.S with type hash = H.t) = struct type index = Pack_maker.index module Inter = Inode.Make_intermediate (Conf) (H) (Node) module P = Pack_maker.Make (Inter.Elt) module Val = Inter.Val module Key = H type 'a t = 'a P.t type key = Key.t type value = Val.t let mem t k = P.mem t k let unsafe_find = P.unsafe_find let find t k = P.find t k >|= function | None -> None | Some v -> let find = unsafe_find ~check_integrity:true t in let v = Inter.Val.of_bin find v in Some v let hash v = Inter.Val.hash v let equal_hash = Irmin.Type.(unstage (equal H.t)) let check_hash expected got = if equal_hash expected got then () else Fmt.invalid_arg "corrupted value: got %a, expecting %a" Inter.pp_hash expected Inter.pp_hash got let batch = P.batch let v = P.v let integrity_check = P.integrity_check let close = P.close let sync = P.sync let clear = P.clear let clear_caches = P.clear_caches let save t v = let add k v = P.unsafe_append ~ensure_unique:true ~overcommit:false t k v in Inter.Val.save ~add ~mem:(P.unsafe_mem t) v let add t v = save t v; Lwt.return (hash v) let unsafe_add t k v = check_hash k (hash v); save t v; Lwt.return () let clear_caches_next_upper = P.clear_caches_next_upper module U = P.U module L = P.L let layer_id = P.layer_id let mem_lower = P.mem_lower let lower = P.lower let mem_next = P.mem_next let flip_upper = P.flip_upper let next_upper = P.next_upper let current_upper = P.current_upper let consume_newies = P.consume_newies let update_flip = P.update_flip let flush ?index t = P.flush ?index t type 'a layer_type = | Upper : read U.t layer_type | Lower : read L.t layer_type let copy_from_lower ~dst t = P.copy_from_lower t "Node" ~dst let copy : type l. l layer_type * l -> read t -> key -> unit = fun (layer, dst) t -> match layer with | Lower -> P.copy (Lower, dst) t "Node" | Upper -> P.copy (Upper, dst) t "Node" let check = P.check let decode_bin ~dict ~hash buff off = Inter.decode_bin ~dict ~hash buff off |> fst let integrity_check_inodes _ _ = failwith "TODO" end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>