Protobuf.Internal.Decode
- Package
- purescript-protobuf
- Repository
- xc-jp/purescript-protobuf
Primitive parsers for decoding Google Protocol Buffers.
#decodeDouble Source
decodeDouble :: forall m. MonadEffect m => ParserT DataView m Number
double Scalar Value Type
#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.
#decodeFloat Source
decodeFloat :: forall m. MonadEffect m => ParserT DataView m Float32
float Scalar Value Type
#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
decodeInt32 :: forall m. MonadEffect m => ParserT DataView m Int
int32 Scalar Value Type
#decodeInt64 Source
decodeInt64 :: forall m. MonadEffect m => ParserT DataView m Int64
int64 Scalar Value Type
#decodeUint32 Source
decodeUint32 :: forall m. MonadEffect m => ParserT DataView m UInt
uint32 Scalar Value Type
#decodeUint64 Source
decodeUint64 :: forall m. MonadEffect m => ParserT DataView m UInt64
uint64 Scalar Value Type
#decodeSint32 Source
decodeSint32 :: forall m. MonadEffect m => ParserT DataView m Int
sint32 Scalar Value Type
#decodeSint64 Source
decodeSint64 :: forall m. MonadEffect m => ParserT DataView m Int64
sint64 Scalar Value Type
#decodeFixed32 Source
decodeFixed32 :: forall m. MonadEffect m => ParserT DataView m UInt
fixed32 Scalar Value Type
#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
decodeFixed64 :: forall m. MonadEffect m => ParserT DataView m UInt64
fixed64 Scalar Value Type
#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
decodeSfixed32 :: forall m. MonadEffect m => ParserT DataView m Int
sfixed32 Scalar Value Type
#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
decodeSfixed64 :: forall m. MonadEffect m => ParserT DataView m Int64
sfixed64 Scalar Value Type
#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.
#decodeBool Source
decodeBool :: forall m. MonadEffect m => ParserT DataView m Boolean
bool Scalar Value Type
#decodeString Source
decodeString :: forall m. MonadEffect m => ParserT DataView m String
string Scalar Value Type
#decodeBytes Source
decodeBytes :: forall m. MonadEffect m => ParserT DataView m Bytes
bytes Scalar Value Type
#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
decodeTag32 :: forall m. MonadEffect m => ParserT DataView m (Tuple FieldNumber WireType)
Parse the field number and wire type of the next field. https://developers.google.com/protocol-buffers/docs/encoding#structure