| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | GHC2021 | 
Database.LSMTree.Internal.Serialise
Contents
Description
Newtype wrappers and utilities for serialised keys, values and blobs.
Synopsis
- class SerialiseKey k
 - class SerialiseValue v
 - newtype SerialisedKey where
- SerialisedKey RawBytes
 - pattern SerialisedKey' :: Vector Word8 -> SerialisedKey
 
 - serialiseKey :: SerialiseKey k => k -> SerialisedKey
 - deserialiseKey :: SerialiseKey k => SerialisedKey -> k
 - sizeofKey :: SerialisedKey -> Int
 - sizeofKey16 :: SerialisedKey -> Word16
 - sizeofKey32 :: SerialisedKey -> Word32
 - sizeofKey64 :: SerialisedKey -> Word64
 - serialisedKey :: SerialisedKey -> Builder
 - keyTopBits64 :: SerialisedKey -> Word64
 - newtype SerialisedValue where
- SerialisedValue RawBytes
 - pattern SerialisedValue' :: Vector Word8 -> SerialisedValue
 
 - serialiseValue :: SerialiseValue v => v -> SerialisedValue
 - deserialiseValue :: SerialiseValue v => SerialisedValue -> v
 - sizeofValue :: SerialisedValue -> Int
 - sizeofValue16 :: SerialisedValue -> Word16
 - sizeofValue32 :: SerialisedValue -> Word32
 - sizeofValue64 :: SerialisedValue -> Word64
 - serialisedValue :: SerialisedValue -> Builder
 - type ResolveSerialisedValue = SerialisedValue -> SerialisedValue -> SerialisedValue
 - newtype SerialisedBlob where
- SerialisedBlob RawBytes
 - pattern SerialisedBlob' :: Vector Word8 -> SerialisedBlob
 
 - serialiseBlob :: SerialiseValue v => v -> SerialisedBlob
 - deserialiseBlob :: SerialiseValue v => SerialisedBlob -> v
 - sizeofBlob :: SerialisedBlob -> Int
 - sizeofBlob64 :: SerialisedBlob -> Word64
 - serialisedBlob :: SerialisedBlob -> Builder
 
Re-exports
class SerialiseKey k Source #
Serialisation of keys.
Instances should satisfy the following laws:
- Identity
 deserialiseKey(serialiseKeyx) == x- Identity up to slicing
 deserialiseKey(packSliceprefix (serialiseKeyx) suffix) == x
Minimal complete definition
Instances
class SerialiseValue v Source #
Serialisation of values and blobs.
Instances should satisfy the following laws:
- Identity
 deserialiseValue(serialiseValuex) == x- Identity up to slicing
 deserialiseValue(packSliceprefix (serialiseValuex) suffix) == x
Minimal complete definition
Instances
Keys
newtype SerialisedKey Source #
Representation of a serialised key.
Serialisation should preserve equality and ordering. The Ord instance for
 SerialisedKey uses lexicographical ordering.
Constructors
| SerialisedKey RawBytes | 
Bundled Patterns
| pattern SerialisedKey' :: Vector Word8 -> SerialisedKey | 
Instances
serialiseKey :: SerialiseKey k => k -> SerialisedKey Source #
deserialiseKey :: SerialiseKey k => SerialisedKey -> k Source #
sizeofKey :: SerialisedKey -> Int Source #
Size of key in number of bytes.
sizeofKey16 :: SerialisedKey -> Word16 Source #
Size of key in number of bytes.
sizeofKey32 :: SerialisedKey -> Word32 Source #
Size of key in number of bytes.
sizeofKey64 :: SerialisedKey -> Word64 Source #
Size of key in number of bytes.
serialisedKey :: SerialisedKey -> Builder Source #
keyTopBits64 :: SerialisedKey -> Word64 Source #
See topBits64
Values
newtype SerialisedValue Source #
Representation of a serialised value.
Constructors
| SerialisedValue RawBytes | 
Bundled Patterns
| pattern SerialisedValue' :: Vector Word8 -> SerialisedValue | 
Instances
| Show SerialisedValue Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods showsPrec :: Int -> SerialisedValue -> ShowS # show :: SerialisedValue -> String # showList :: [SerialisedValue] -> ShowS #  | |
| NFData SerialisedValue Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods rnf :: SerialisedValue -> () #  | |
| Eq SerialisedValue Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods (==) :: SerialisedValue -> SerialisedValue -> Bool # (/=) :: SerialisedValue -> SerialisedValue -> Bool #  | |
| Ord SerialisedValue Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods compare :: SerialisedValue -> SerialisedValue -> Ordering # (<) :: SerialisedValue -> SerialisedValue -> Bool # (<=) :: SerialisedValue -> SerialisedValue -> Bool # (>) :: SerialisedValue -> SerialisedValue -> Bool # (>=) :: SerialisedValue -> SerialisedValue -> Bool # max :: SerialisedValue -> SerialisedValue -> SerialisedValue # min :: SerialisedValue -> SerialisedValue -> SerialisedValue #  | |
serialiseValue :: SerialiseValue v => v -> SerialisedValue Source #
deserialiseValue :: SerialiseValue v => SerialisedValue -> v Source #
sizeofValue :: SerialisedValue -> Int Source #
sizeofValue16 :: SerialisedValue -> Word16 Source #
Size of value in number of bytes.
sizeofValue32 :: SerialisedValue -> Word32 Source #
Size of value in number of bytes.
sizeofValue64 :: SerialisedValue -> Word64 Source #
Size of value in number of bytes.
Blobs
newtype SerialisedBlob Source #
Representation of a serialised blob.
Constructors
| SerialisedBlob RawBytes | 
Bundled Patterns
| pattern SerialisedBlob' :: Vector Word8 -> SerialisedBlob | 
Instances
| Show SerialisedBlob Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods showsPrec :: Int -> SerialisedBlob -> ShowS # show :: SerialisedBlob -> String # showList :: [SerialisedBlob] -> ShowS #  | |
| NFData SerialisedBlob Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods rnf :: SerialisedBlob -> () #  | |
| Eq SerialisedBlob Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods (==) :: SerialisedBlob -> SerialisedBlob -> Bool # (/=) :: SerialisedBlob -> SerialisedBlob -> Bool #  | |
| Ord SerialisedBlob Source # | |
Defined in Database.LSMTree.Internal.Serialise Methods compare :: SerialisedBlob -> SerialisedBlob -> Ordering # (<) :: SerialisedBlob -> SerialisedBlob -> Bool # (<=) :: SerialisedBlob -> SerialisedBlob -> Bool # (>) :: SerialisedBlob -> SerialisedBlob -> Bool # (>=) :: SerialisedBlob -> SerialisedBlob -> Bool # max :: SerialisedBlob -> SerialisedBlob -> SerialisedBlob # min :: SerialisedBlob -> SerialisedBlob -> SerialisedBlob #  | |
serialiseBlob :: SerialiseValue v => v -> SerialisedBlob Source #
deserialiseBlob :: SerialiseValue v => SerialisedBlob -> v Source #
sizeofBlob :: SerialisedBlob -> Int Source #
Size of blob in number of bytes.
sizeofBlob64 :: SerialisedBlob -> Word64 Source #