aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Storage.mli
blob: 92f602d4acdc39e4282f03b4008fa9a9e68f4959 (plain) (blame)
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
module Make : functor (S : Abstract.Storage.STORAGE) -> sig
  module Pointer : sig
    type 'a t

    val make :
      (S.transaction -> S.address -> ('a, Concepts.Condition.condition) result) -> S.address -> 'a t

    val address_of : 'a t -> S.address
    val swap : 'a t -> S.address -> 'a t
    val deref : S.transaction -> 'a t -> ('a, Concepts.Condition.condition) result
  end

  val as_hash : S.address -> Concepts.Hash.hash

  val finish :
    S.transaction ->
    ('a, Concepts.Condition.condition) result ->
    ('a, Concepts.Condition.condition) result

  val with_transaction :
    S.connection ->
    (S.transaction -> ('a, Concepts.Condition.condition) result) ->
    ('a, Concepts.Condition.condition) result

  val with_read :
    S.connection ->
    (S.transaction -> ('a, Concepts.Condition.condition) result) ->
    ('a, Concepts.Condition.condition) result

  val store_blob :
    S.transaction -> Concepts.Blob.t -> (Concepts.Hash.hash, Concepts.Condition.condition) result

  val get_req : S.transaction -> S.address -> (Concepts.Blob.t, Concepts.Condition.condition) result
end