Protobuf.Internal.Common
- Package
- purescript-protobuf
- Repository
- xc-jp/purescript-protobuf
Common utility definitions.
#FieldNumber Source
type FieldNumber = UInt#Bytes Source
newtype BytesRepresentation of a bytes Scalar Value Type field.
On a message which has been decoded,
The wrapped DataBuff will usually be a DataView.
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 it the DataBuff to DataView or ArrayBuffer,
whichever seems best.
The ArrayBuffer and 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.
Constructors
Instances
#Default Source
class Default a whereIn Protobuf, zero values are “default values” and have special semantics.
Members
Instances
#fromDefault Source
fromDefault :: forall a. Default a => Eq a => a -> Maybe aTurns a default value into Nothing.
#mkUint8Array Source
mkUint8Array :: DataView -> Effect Uint8ArrayMake a Uint8Array Typed Array from a DataView. We can do this
for the case of Uint8 because byte arrays are always aligned.