diff options
Diffstat (limited to 'lib/abstract')
| -rw-r--r-- | lib/abstract/Storage.ml | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/abstract/Storage.ml b/lib/abstract/Storage.ml index d0f2097..f456567 100644 --- a/lib/abstract/Storage.ml +++ b/lib/abstract/Storage.ml @@ -2,17 +2,28 @@ module type STORAGE = sig type connection type transaction - val connect: Concepts.Configuration.configuration -> connection + val connect : + Concepts.Configuration.configuration -> (connection, Concepts.Condition.condition) result (** begin a transaction within `connection` *) - val start: connection -> transaction + val start : connection -> (transaction, Concepts.Condition.condition) result + (** `commit` the current transaction *) - val commit: transaction -> () + val commit : transaction -> (unit, Concepts.Condition.condition) result + (** `abort` the current transaction *) - val abort: transaction -> () + val abort : transaction -> (unit, Concepts.Condition.condition) result (** within a transaction, fetch a blob from disk *) - val get: transaction -> Concepts.Hash.hash -> Concepts.Representation.blob + val get : + transaction -> + Concepts.Hash.hash -> + (Concepts.Representation.blob option, Concepts.Condition.condition) result + (** within a transaction, associate a hash with a blob on disk *) - val put: transaction -> Concepts.Hash.hash -> Concepts.Representation.blob -> () + val put : + transaction -> + Concepts.Hash.hash -> + Concepts.Representation.blob -> + (unit, Concepts.Condition.condition) result end |
