Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Transport = Transport {
- writeMessage :: Builder -> IO ()
- readMessage :: forall a. Get a -> IO (ReadResult a)
- framedTransport :: Connection c => c -> IO Transport
- unframedTransport :: Connection c => c -> IO Transport
- class Connection c where
- cGetSome :: c -> Int -> IO ByteString
- cPut :: c -> ByteString -> IO ()
- data ReadResult a
Documentation
A bidirectional transport to readwrite messages fromto.
Transport | |
|
framedTransport :: Connection c => c -> IO Transport Source #
Creates a thrift framed transport. See also https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md#framed-vs-unframed-transport.
unframedTransport :: Connection c => c -> IO Transport Source #
Creates a thrift unframed transport. See also https://github.com/apache/thrift/blob/master/doc/specs/thrift-rpc.md#framed-vs-unframed-transport.
class Connection c where Source #
cGetSome :: c -> Int -> IO ByteString Source #
Gets up to n bytes. Returns an empty bytestring if EOF is reached.
cPut :: c -> ByteString -> IO () Source #
Writes the given bytestring.
Instances
Connection Handle Source # | |
Defined in Pinch.Transport | |
Connection Socket Source # | |
Defined in Pinch.Transport |
data ReadResult a Source #
Instances
Show a => Show (ReadResult a) Source # | |
Defined in Pinch.Transport showsPrec :: Int -> ReadResult a -> ShowS # show :: ReadResult a -> String # showList :: [ReadResult a] -> ShowS # | |
Eq a => Eq (ReadResult a) Source # | |
Defined in Pinch.Transport (==) :: ReadResult a -> ReadResult a -> Bool # (/=) :: ReadResult a -> ReadResult a -> Bool # |