Module

Protobuf.Internal.Decode

Package
purescript-protobuf
Repository
xc-jp/purescript-protobuf

Primitive parsers for decoding Google Protocol Buffers.

#decodeDoubleArray Source

decodeDoubleArray :: forall m. MonadEffect m => ByteLength -> ParserT DataView m (Array Number)

repeated packed double

Equivalent to manyLength decodeDouble, but specialized so it’s faster.

#decodeFloatArray Source

decodeFloatArray :: forall m. MonadEffect m => ByteLength -> ParserT DataView m (Array Float32)

repeated packed float

Equivalent to manyLength decodeFloat, but specialized so it’s faster.

#decodeInt32 Source

#decodeUint32 Source

#decodeSint32 Source

#decodeSint64 Source

#decodeFixed32 Source

#decodeFixed32Array Source

decodeFixed32Array :: forall m. MonadEffect m => ByteLength -> ParserT DataView m (Array UInt)

repeated packed fixed32

Equivalent to manyLength decodeFixed32, but specialized so it’s faster.

#decodeFixed64 Source

#decodeFixed64Array Source

decodeFixed64Array :: forall m. MonadEffect m => ByteLength -> ParserT DataView m (Array UInt64)

repeated packed fixed64

Equivalent to manyLength decodeFixed64, but specialized so it’s faster.

#decodeSfixed32 Source

#decodeSfixed32Array Source

decodeSfixed32Array :: forall m. MonadEffect m => ByteLength -> ParserT DataView m (Array Int)

repeated packed sfixed32

Equivalent to manyLength decodeSfixed32, but specialized so it’s faster.

#decodeSfixed64 Source

#decodeSfixed64Array Source

decodeSfixed64Array :: forall m. MonadEffect m => ByteLength -> ParserT DataView m (Array Int64)

repeated packed sfixed64

Equivalent to manyLength decodeSfixed64, but specialized so it’s faster.

#decodeVarint32 Source

decodeVarint32 :: forall m. MonadEffect m => ParserT DataView m UInt

There is no varint32 in the Protbuf spec, this is just a performance-improving assumption we make in cases where we would be surprised to see a number larger than 32 bits, such as in field numbers. We think this is worth the risk because UInt is represented as a native Javascript Number whereas UInt64 is a composite library type, so we expect the performance difference to be significant.

https://developers.google.com/protocol-buffers/docs/encoding#varints

#decodeTag32 Source