Safe Haskell | None |
---|---|
Language | Haskell2010 |
Buffer builder
Synopsis
- data BufferBuilder
- emptyBufferBuilder :: BufferBuilder
- toBufferList :: BufferBuilder -> BufferList
- toBuffer :: BufferBuilder -> Buffer
- fromBuffer :: Buffer -> BufferBuilder
- fromWord8 :: Word8 -> BufferBuilder
Documentation
data BufferBuilder Source #
Buffer builder
Instances
Semigroup BufferBuilder Source # | |
Defined in Haskus.Binary.BufferBuilder (<>) :: BufferBuilder -> BufferBuilder -> BufferBuilder # sconcat :: NonEmpty BufferBuilder -> BufferBuilder # stimes :: Integral b => b -> BufferBuilder -> BufferBuilder # | |
Monoid BufferBuilder Source # | |
Defined in Haskus.Binary.BufferBuilder mempty :: BufferBuilder # mappend :: BufferBuilder -> BufferBuilder -> BufferBuilder # mconcat :: [BufferBuilder] -> BufferBuilder # |
emptyBufferBuilder :: BufferBuilder Source #
Empty buffer builder
toBufferList :: BufferBuilder -> BufferList Source #
Execute a Builder and return the generated chunks as a BufferList. The work is performed lazily, i.e., only when a chunk of the BufferList is forced.
toBuffer :: BufferBuilder -> Buffer Source #
Execute a Builder and return the generated chunks as a Buffer.
fromBuffer :: Buffer -> BufferBuilder Source #
Create a Builder denoting the same sequence of bytes as a strict ByteString. The Builder inserts large ByteStrings directly, but copies small ones to ensure that the generated chunks are large on average.
fromWord8 :: Word8 -> BufferBuilder Source #
Encode a single unsigned byte as-is.