Safe Haskell | None |
---|---|
Language | Haskell2010 |
Thrift.Protocol
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 #
Methods
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 #
Methods
serializeVal :: a -> ThriftVal -> ByteString Source #
deserializeVal :: a -> ThriftType -> ByteString -> ThriftVal Source #
Instances
Transport t => StatelessProtocol (JSONProtocol t) Source # | |
Defined in Thrift.Protocol.JSON Methods serializeVal :: JSONProtocol t -> ThriftVal -> ByteString Source # deserializeVal :: JSONProtocol t -> ThriftType -> ByteString -> ThriftVal Source # | |
Transport t => StatelessProtocol (CompactProtocol t) Source # | |
Defined in Thrift.Protocol.Compact Methods serializeVal :: CompactProtocol t -> ThriftVal -> ByteString Source # deserializeVal :: CompactProtocol t -> ThriftType -> ByteString -> ThriftVal Source # | |
Transport t => StatelessProtocol (BinaryProtocol t) Source # | |
Defined in Thrift.Protocol.Binary Methods serializeVal :: BinaryProtocol t -> ThriftVal -> ByteString Source # deserializeVal :: BinaryProtocol t -> ThriftType -> ByteString -> ThriftVal Source # |
data ProtocolExn Source #
Constructors
ProtocolExn ProtocolExnType String |
Instances
Show ProtocolExn Source # | |
Defined in Thrift.Protocol Methods showsPrec :: Int -> ProtocolExn -> ShowS # show :: ProtocolExn -> String # showList :: [ProtocolExn] -> ShowS # | |
Exception ProtocolExn Source # | |
Defined in Thrift.Protocol Methods toException :: ProtocolExn -> SomeException # fromException :: SomeException -> Maybe ProtocolExn # displayException :: ProtocolExn -> String # |
data ProtocolExnType Source #
Constructors
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 Methods (==) :: ProtocolExnType -> ProtocolExnType -> Bool # (/=) :: ProtocolExnType -> ProtocolExnType -> Bool # | |
Show ProtocolExnType Source # | |
Defined in Thrift.Protocol Methods 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 #