Safe Haskell | None |
---|---|
Language | Haskell98 |
Convert a stream of blaze-builder Builder
s into a stream of ByteString
s.
Adapted from blaze-builder-enumerator, written by myself and Simon Meier.
Note that the functions here can work in any monad built on top of IO
or
ST
.
- type BlazeRecv = Builder -> IO BlazePopper
- type BlazePopper = IO ByteString
- type BlazeFinish = IO (Maybe ByteString)
- newBlazeRecv :: BufferAllocStrategy -> IO (BlazeRecv, BlazeFinish)
- data Buffer :: *
- freeSize :: Buffer -> Int
- sliceSize :: Buffer -> Int
- bufferSize :: Buffer -> Int
- allocBuffer :: Int -> IO Buffer
- reuseBuffer :: Buffer -> Buffer
- nextSlice :: Int -> Buffer -> Maybe Buffer
- unsafeFreezeBuffer :: Buffer -> ByteString
- unsafeFreezeNonEmptyBuffer :: Buffer -> Maybe ByteString
- type BufferAllocStrategy = (IO Buffer, Int -> Buffer -> IO (IO Buffer))
- allNewBuffersStrategy :: Int -> BufferAllocStrategy
- reuseBufferStrategy :: IO Buffer -> BufferAllocStrategy
- defaultStrategy :: BufferAllocStrategy
Documentation
type BlazeRecv = Builder -> IO BlazePopper Source
type BlazePopper = IO ByteString Source
Provides a series of ByteString
s until empty, at which point it provides
an empty ByteString
.
Since 0.1.2
type BlazeFinish = IO (Maybe ByteString) Source
Buffers
data Buffer :: *
Status information
bufferSize :: Buffer -> Int
Creation and modification
allocBuffer :: Int -> IO Buffer
reuseBuffer :: Buffer -> Buffer
Conversion to bytestings
unsafeFreezeBuffer :: Buffer -> ByteString
unsafeFreezeNonEmptyBuffer :: Buffer -> Maybe ByteString