{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
module FoundationDB.Versionstamp
( Versionstamp (..),
VersionstampCompleteness (..),
TransactionVersionstamp (..),
encodeVersionstamp,
encodeTransactionVersionstamp,
decodeVersionstamp,
decodeTransactionVersionstamp,
transactionVersion,
transactionBatchOrder,
userVersion,
)
where
import Data.Word (Word16, Word64)
import FoundationDB.Versionstamp.Internal
transactionVersion :: TransactionVersionstamp -> Word64
transactionVersion :: TransactionVersionstamp -> Word64
transactionVersion (TransactionVersionstamp Word64
x Word16
_) = Word64
x
transactionBatchOrder :: TransactionVersionstamp -> Word16
transactionBatchOrder :: TransactionVersionstamp -> Word16
transactionBatchOrder (TransactionVersionstamp Word64
_ Word16
x) = Word16
x
userVersion :: Versionstamp a -> Word16
userVersion :: Versionstamp a -> Word16
userVersion (CompleteVersionstamp TransactionVersionstamp
_ Word16
x) = Word16
x
userVersion (IncompleteVersionstamp Word16
x) = Word16
x