Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Protocol a where
- readByte :: a -> IO ByteString
- readVal :: a -> ThriftType -> IO ThriftVal
- readMessage :: a -> ((Text, MessageType, Int32) -> IO b) -> IO b
- writeVal :: a -> ThriftVal -> IO ()
- writeMessage :: a -> (Text, MessageType, Int32) -> IO () -> IO ()
- class Protocol a => StatelessProtocol a where
- serializeVal :: a -> ThriftVal -> ByteString
- deserializeVal :: a -> ThriftType -> ByteString -> ThriftVal
- data ProtocolExn = ProtocolExn ProtocolExnType String
- data ProtocolExnType
- getTypeOf :: ThriftVal -> ThriftType
- runParser :: (Protocol p, Show a) => p -> Parser a -> IO a
- bsToDouble :: ByteString -> Double
- bsToDoubleLE :: ByteString -> Double
Documentation
class Protocol a where Source #
readByte :: a -> IO ByteString Source #
readVal :: a -> ThriftType -> IO ThriftVal Source #
readMessage :: a -> ((Text, MessageType, Int32) -> IO b) -> IO b Source #
writeVal :: a -> ThriftVal -> IO () Source #
writeMessage :: a -> (Text, MessageType, Int32) -> IO () -> IO () Source #
Instances
class Protocol a => StatelessProtocol a where Source #
serializeVal :: a -> ThriftVal -> ByteString Source #
deserializeVal :: a -> ThriftType -> ByteString -> ThriftVal Source #
Instances
Transport t => StatelessProtocol (JSONProtocol t) Source # | |
Defined in Thrift.Protocol.JSON serializeVal :: JSONProtocol t -> ThriftVal -> ByteString Source # deserializeVal :: JSONProtocol t -> ThriftType -> ByteString -> ThriftVal Source # | |
Transport t => StatelessProtocol (CompactProtocol t) Source # | |
Defined in Thrift.Protocol.Compact serializeVal :: CompactProtocol t -> ThriftVal -> ByteString Source # deserializeVal :: CompactProtocol t -> ThriftType -> ByteString -> ThriftVal Source # | |
Transport t => StatelessProtocol (BinaryProtocol t) Source # | |
Defined in Thrift.Protocol.Binary serializeVal :: BinaryProtocol t -> ThriftVal -> ByteString Source # deserializeVal :: BinaryProtocol t -> ThriftType -> ByteString -> ThriftVal Source # |
data ProtocolExn Source #
Instances
Show ProtocolExn Source # | |
Defined in Thrift.Protocol showsPrec :: Int -> ProtocolExn -> ShowS # show :: ProtocolExn -> String # showList :: [ProtocolExn] -> ShowS # | |
Exception ProtocolExn Source # | |
Defined in Thrift.Protocol |
data ProtocolExnType Source #
PE_UNKNOWN | |
PE_INVALID_DATA | |
PE_NEGATIVE_SIZE | |
PE_SIZE_LIMIT | |
PE_BAD_VERSION | |
PE_NOT_IMPLEMENTED | |
PE_MISSING_REQUIRED_FIELD |
Instances
Eq ProtocolExnType Source # | |
Defined in Thrift.Protocol (==) :: ProtocolExnType -> ProtocolExnType -> Bool # (/=) :: ProtocolExnType -> ProtocolExnType -> Bool # | |
Show ProtocolExnType Source # | |
Defined in Thrift.Protocol showsPrec :: Int -> ProtocolExnType -> ShowS # show :: ProtocolExnType -> String # showList :: [ProtocolExnType] -> ShowS # |
getTypeOf :: ThriftVal -> ThriftType Source #
bsToDouble :: ByteString -> Double Source #
Converts a ByteString to a Floating point number The ByteString is assumed to be encoded in network order (Big Endian) therefore the behavior of this function varies based on whether the local machine is big endian or little endian.
bsToDoubleLE :: ByteString -> Double Source #