pinch-0.1.0.1: An alternative implementation of Thrift for Haskell.

Copyright(c) Abhinav Gupta 2015
LicenseBSD3
MaintainerAbhinav Gupta <mail@abhinavg.net>
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Pinch.Internal.Builder

Description

This module provides a wrapper around Data.ByteString.Builder that keeps track of the final size of the generated ByteString.

Synopsis

Documentation

data Builder a Source

Used for building a long chain of ByteStrings.

type Build = Builder () Source

Alias for a build that produces no results.

run :: Build -> (Int64, Builder) Source

Returns the ByteString Builder for this build and its length.

int8 :: Int8 -> Build Source

Writes a byte.

int16 :: Int16 -> Build Source

Writes a 16-bit integer.

int32 :: Int32 -> Build Source

Writes a 32-bit integer.

int64 :: Int64 -> Build Source

Writes a 64-bit integer.

double :: Double -> Build Source

Writes a 64-bit double.

byteString :: ByteString -> Build Source

Writes an arbitrary ByteString.