Module

Protobuf.Internal.Encode

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

Primitive builders for encoding Google Protocol Buffers.

#encodeDoubleField Source

#encodeDouble Source

#encodeFloatField Source

#encodeFloat Source

#encodeInt32Field Source

#encodeInt32 Source

encodeInt32 :: forall m. MonadEffect m => Int -> PutM m Unit

int32 Scalar Value Type

#encodeInt64Field Source

#encodeInt64 Source

#encodeUint32Field Source

#encodeUint32 Source

encodeUint32 :: forall m. MonadEffect m => UInt -> PutM m Unit

uint32 Scalar Value Type

#encodeUint64Field Source

#encodeUint64 Source

#encodeSint32Field Source

#encodeSint32 Source

encodeSint32 :: forall m. MonadEffect m => Int -> PutM m Unit

sint32 Scalar Value Type

#encodeSint64Field Source

#encodeSint64 Source

#encodeFixed32Field Source

#encodeFixed32 Source

encodeFixed32 :: forall m. MonadEffect m => UInt -> PutM m Unit

fixed32 Scalar Value Type

#encodeFixed64Field Source

#encodeFixed64 Source

#encodeSfixed32Field Source

#encodeSfixed32 Source

encodeSfixed32 :: forall m. MonadEffect m => Int -> PutM m Unit

sfixed32 Scalar Value Type

#encodeSfixed64Field Source

#encodeSfixed64 Source

encodeSfixed64 :: forall m. MonadEffect m => Int64 -> PutM m Unit

sfixed64 Scalar Value Type

#encodeBoolField Source

#encodeBool Source

#encodeStringField Source

#encodeBytesField Source

#encodeBuilder Source

encodeBuilder :: forall m. MonadEffect m => FieldNumber -> Builder -> PutM m Unit

tell with a tag and a length delimit.

#encodeVarint32 Source

encodeVarint32 :: forall m. MonadEffect m => UInt -> PutM m Unit

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

#encodeVarint64 Source

encodeVarint64 :: forall m. MonadEffect m => UInt64 -> PutM m Unit