Safe Haskell | None |
---|
- conduitDecode :: (Binary b, MonadThrow m) => Conduit ByteString m b
- conduitEncode :: (Binary b, MonadThrow m) => Conduit b m ByteString
- conduitMsgEncode :: (Binary b, MonadThrow m) => Conduit b m ByteString
- conduitGet :: MonadThrow m => Get b -> Conduit ByteString m b
- conduitPut :: MonadThrow m => Conduit Put m ByteString
- conduitPutList :: MonadThrow m => Conduit Put m [ByteString]
- conduitPutLBS :: MonadThrow m => Conduit Put m ByteString
- conduitPutMany :: MonadThrow m => Conduit Put m (Vector ByteString)
- sourcePut :: MonadThrow m => Put -> Producer m ByteString
- sinkGet :: MonadThrow m => Get b -> Consumer ByteString m b
- data ParseError = ParseError {
- unconsumed :: ByteString
- offset :: ByteOffset
- content :: String
Documentation
conduitDecode :: (Binary b, MonadThrow m) => Conduit ByteString m bSource
Runs default Decoder
repeatedly on a input stream.
conduitEncode :: (Binary b, MonadThrow m) => Conduit b m ByteStringSource
Runs default encoder on a input stream.
This function produces a stream of bytes where for each input
value you will have a number of ByteString
s, and no boundary
between different values.
conduitMsgEncode :: (Binary b, MonadThrow m) => Conduit b m ByteStringSource
Runs default encoder on input stream.
This function produces a ByteString per each incomming packet, it may be useful in datagram based protocols. Function maintains following property
'conduitMsgEncode' xs == 'CL.map' 'Data.ByteString.encode' =$= 'CL.map' 'LBS.toStrict'
This invariant is maintaind by the cost of additional data copy,
so if you packets can be serialized to the large data chunks or
you interested in iterative packet serialization
concider using conduitPutList
or conduitPutMany
conduitGet :: MonadThrow m => Get b -> Conduit ByteString m bSource
Runs getter repeatedly on a input stream.
conduitPut :: MonadThrow m => Conduit Put m ByteStringSource
Runs putter repeatedly on a input stream, returns an output stream.
conduitPutList :: MonadThrow m => Conduit Put m [ByteString]Source
Vectorized variant of conduitPut
returning list contains
all chunks from one element representation
conduitPutLBS :: MonadThrow m => Conduit Put m ByteStringSource
Runs putter repeatedly on a input stream.
Returns a lazy butestring so it's possible to use vectorized
IO on the result either by calling' LBS.toChunks' or by
calling send
.
conduitPutMany :: MonadThrow m => Conduit Put m (Vector ByteString)Source
Vectorized variant of conduitPut
.
sourcePut :: MonadThrow m => Put -> Producer m ByteStringSource
Create stream of strict bytestrings from Put
value.
sinkGet :: MonadThrow m => Get b -> Consumer ByteString m bSource
Decode message from input stream.
data ParseError Source
ParseError | |
|
Show ParseError | |
Typeable ParseError | |
Exception ParseError |