Portability | Tested on GHC only |
---|---|
Stability | Experimental |
Maintainer | Simon Meier <iridcode@gmail.com> |
Safe Haskell | None |
Infrastructure and enumeratees for the incremental execution of builders and passing on of the filled chunks as bytestrings to an inner iteratee.
Note that the Buffer
code is likely to move/change in order to
reconciliate it with the rest of the blaze-builder library.
- 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
- builderToByteString :: MonadIO m => Enumeratee Builder ByteString m a
- unsafeBuilderToByteString :: MonadIO m => IO Buffer -> Enumeratee Builder ByteString m a
- builderToByteStringWith :: MonadIO m => BufferAllocStrategy -> Enumeratee Builder ByteString m a
Buffers
data Buffer
Status information
bufferSize :: Buffer -> Int
Creation and modification
allocBuffer :: Int -> IO Buffer
reuseBuffer :: Buffer -> Buffer
Conversion to bytestings
Buffer allocation strategies
Enumeratees from builders to bytestrings
builderToByteString :: MonadIO m => Enumeratee Builder ByteString m aSource
Incrementally execute builders and pass on the filled chunks as bytestrings.
unsafeBuilderToByteString :: MonadIO m => IO Buffer -> Enumeratee Builder ByteString m aSource
Incrementally execute builders on the given buffer and pass on the filled chunks as bytestrings. Note that, if the given buffer is too small for the execution of a build step, a larger one will be allocated.
WARNING: This enumeratee yields bytestrings that are NOT referentially transparent. Their content will be overwritten as soon as control is returned from the inner iteratee!
builderToByteStringWith :: MonadIO m => BufferAllocStrategy -> Enumeratee Builder ByteString m aSource
An enumeratee that incrementally executes builders and passes on the filled chunks as bytestrings to an inner iteratee.
INV: All bytestrings passed to the inner iteratee are non-empty.