diff options
Diffstat (limited to 'src/Erebos/Storage/Backend.hs')
| -rw-r--r-- | src/Erebos/Storage/Backend.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Erebos/Storage/Backend.hs b/src/Erebos/Storage/Backend.hs index 59097b6..07bd63e 100644 --- a/src/Erebos/Storage/Backend.hs +++ b/src/Erebos/Storage/Backend.hs @@ -9,6 +9,8 @@ module Erebos.Storage.Backend ( Complete, Partial, Storage, PartialStorage, newStorage, + withStorageBackend, + refDigestBytes, WatchID, startWatchID, nextWatchID, @@ -30,6 +32,9 @@ newStorage stBackend = do stRefRoots <- newMVar =<< HT.new return Storage {..} +withStorageBackend :: Storage' c -> (forall bck. (StorageBackend bck, BackendCompleteness bck ~ c) => bck -> IO a) -> IO a +withStorageBackend Storage {..} f = f stBackend + refDigestBytes :: RefDigest -> ByteString refDigestBytes = BA.convert |