| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | GHC2021 | 
Database.LSMTree.Internal.BlobFile
Synopsis
- data BlobFile m h = BlobFile {
- blobFileHandle :: !(Handle h)
 - blobFileRefCounter :: !(RefCounter m)
 
 - data BlobSpan = BlobSpan {
- blobSpanOffset :: !Word64
 - blobSpanSize :: !Word32
 
 - openBlobFile :: (PrimMonad m, MonadCatch m) => HasCallStack => HasFS m h -> RefCtx -> FsPath -> OpenMode -> m (Ref (BlobFile m h))
 - readBlob :: (MonadThrow m, PrimMonad m) => HasFS m h -> Ref (BlobFile m h) -> BlobSpan -> m SerialisedBlob
 - readBlobRaw :: (MonadThrow m, PrimMonad m) => HasFS m h -> BlobFile m h -> BlobSpan -> m SerialisedBlob
 - writeBlob :: (MonadThrow m, PrimMonad m) => HasFS m h -> Ref (BlobFile m h) -> SerialisedBlob -> Word64 -> m ()
 
Documentation
A handle to a file containing blobs.
This is a reference counted object. Upon finalisation, the file is closed and deleted.
Constructors
| BlobFile | |
Fields 
  | |
Instances
| RefCounted m (BlobFile m h) Source # | |
Defined in Database.LSMTree.Internal.BlobFile Methods getRefCounter :: BlobFile m h -> RefCounter m Source #  | |
| Show (BlobFile m h) Source # | |
| NFData h => NFData (BlobFile m h) Source # | |
Defined in Database.LSMTree.Internal.BlobFile  | |
The location of a blob inside a blob file.
Constructors
| BlobSpan | |
Fields 
  | |
openBlobFile :: (PrimMonad m, MonadCatch m) => HasCallStack => HasFS m h -> RefCtx -> FsPath -> OpenMode -> m (Ref (BlobFile m h)) Source #
Open the given file to make a BlobFile. The finaliser will close and
 delete the file.
REF: the resulting reference must be released once it is no longer used.
ASYNC: this should be called with asynchronous exceptions masked because it allocates/creates resources.
readBlob :: (MonadThrow m, PrimMonad m) => HasFS m h -> Ref (BlobFile m h) -> BlobSpan -> m SerialisedBlob Source #
readBlobRaw :: (MonadThrow m, PrimMonad m) => HasFS m h -> BlobFile m h -> BlobSpan -> m SerialisedBlob Source #
writeBlob :: (MonadThrow m, PrimMonad m) => HasFS m h -> Ref (BlobFile m h) -> SerialisedBlob -> Word64 -> m () Source #