Common utility definitions.
Representation of a bytes Scalar Value Type field.
On a message which has been decoded,
DataBuff will usually be a
In that case, the
DataView is a view into the
received message I/O buffer.
For messages which you intend to encode,
You may set the
whichever seems best.
DataView are mutable, so be careful not to mutate
them if anything might read them again. Here we trade off typechecker
guarantees for implementation simplicity.
class Default a where
In Protobuf, zero values are “default values” and have special semantics.
Nothing into a “default” (zero) value.
The Protobuf spec requires that a no presence field set to its “default” (zero) value must not be serialized to the wire.
When receiving messages we can use this function to interpret a missing no presence field as a “default” value.