1234567891011121314151617181920212223242526272829303132333435363738(*
* Copyright (c) 2018-2022 Tarides <contact@tarides.com>
*
* 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.
*)includeIndexable_intfopen!ImportmoduleCloseable(CA:S)=structincludeIrmin.Indexable.Check_closed_store(CA)(** override of {!Irmin.Indexable.S.add} to allow read-only *)letaddtv=(get_if_open_exnt|>CA.add)v(** override of {!Irmin.Indexable.S.unsafe_add} to allow read-only *)letunsafe_addtkv=(get_if_open_exnt|>CA.unsafe_add)kvletindex_directth=(get_if_open_exnt|>CA.index_direct)hletunsafe_append~ensure_unique~overcommittkv=(get_if_open_exnt|>CA.unsafe_append~ensure_unique~overcommit)kvletunsafe_memtk=(get_if_open_exnt|>CA.unsafe_mem)kletunsafe_find~check_integritytk=(get_if_open_exnt|>CA.unsafe_find~check_integrity)kend