12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667open!ImportincludePack_value_intfmoduleKind=structtypet=Commit|Contents|Inode|Nodeletto_magic=function|Commit->'C'|Contents->'B'|Inode->'I'|Node->'N'letof_magic=function|'C'->Commit|'B'->Contents|'I'->Inode|'N'->Node|c->Fmt.failwith"Kind.of_magic: unexpected magic char %C"clett=Irmin.Type.(mapchar)of_magicto_magicletpp=Fmt.usingto_magicFmt.charendtype('h,'a)value={hash:'h;kind:Kind.t;v:'a}[@@derivingirmin]moduletypeS=Swithtypekind:=Kind.tmoduleMake(Config:sigvalselected_kind:Kind.tend)(Hash:Irmin.Hash.S)(Data:Irmin.Type.S)=structmoduleHash=Irmin.Hash.Typed(Hash)(Data)typet=Data.t[@@derivingirmin]typehash=Hash.tlethash=Hash.hashletkind=Config.selected_kindletvalue=[%typ:(Hash.t,Data.t)value]letencode_value=Irmin.Type.(unstage(encode_binvalue))letdecode_value=Irmin.Type.(unstage(decode_binvalue))letencode_bin~dict:_~offset:_vhash=encode_value{kind;hash;v}letdecode_bin~dict:_~hash:_soff=letlen,t=decode_valuesoffin(len,t.v)letdecode_bin_length=matchIrmin.Type.(Size.of_encodingvalue)with|Unknown->Fmt.failwith"Type must have a recoverable encoded length: %a"Irmin.Type.pp_tyt|Staticn->fun__->n|Dynamicf->fletkind_=Config.selected_kindendmoduleOf_contents=Make(structletselected_kind=Kind.Contentsend)moduleOf_commit=Make(structletselected_kind=Kind.Commitend)