Protobuf.Internal.Runtime
- Package
- purescript-protobuf
- Repository
- xc-jp/purescript-protobuf
This module is for import by the generated .purs message modules.
#parseMessage Source
parseMessage :: forall m a r. MonadEffect m => MonadRec m => (Record r -> a) -> (Record r) -> (FieldNumberInt -> WireType -> ParserT DataView m (Builder (Record r) (Record r))) -> ByteLength -> ParserT DataView m aThe parseField argument is a parser which returns a Record builder which, when applied to a Record, will modify the Record to add the parsed field.
#UnknownField Source
data UnknownFieldA message field value from an unknown .proto definition.
See Message Structure for an explanation.
UnknownVarIntUseProtobuf.Internal.Decode.decodeZigzag64to interpret this as a signed integer.UnknownLenDelholds a variable-lengthBytes.UnknownBits64must holdBytesof length 8.UnknownBits32must holdBytesof length 4.
See the modules Protobuf.Internal.Encode
and Protobuf.Internal.Decode for ways to operate on the Bytes.
Constructors
UnknownVarInt FieldNumber UInt64UnknownBits64 FieldNumber BytesUnknownLenDel FieldNumber BytesUnknownBits32 FieldNumber Bytes
Instances
#parseFieldUnknown Source
parseFieldUnknown :: forall m r. MonadEffect m => Int -> WireType -> ParserT DataView m (Builder ({ __unknown_fields :: Array UnknownField | r }) ({ __unknown_fields :: Array UnknownField | r }))Parse and preserve an unknown field.
#putFieldUnknown Source
putFieldUnknown :: forall m. MonadEffect m => UnknownField -> PutM m Unit#parseLenDel Source
parseLenDel :: forall m a. MonadEffect m => (Int -> ParserT DataView m a) -> ParserT DataView m aParse a length, then call a parser which takes one length as its argument.
#FieldNumberInt Source
type FieldNumberInt = IntWe want an Int FieldNumber to pass to parseField so that we can pattern match on Int literals. UInt doesn't export any constructors, so we can’t pattern match on it.
#manyLength Source
manyLength :: forall m a. MonadEffect m => MonadRec m => ParserT DataView m a -> ByteLength -> ParserT DataView m (Array a)Call a parser repeatedly until exactly N bytes have been consumed. Will fail if too many bytes are consumed.
#putLenDel Source
putLenDel :: forall m a. MonadEffect m => (a -> PutM m Unit) -> FieldNumber -> a -> PutM m Unit#putOptional Source
putOptional :: forall m a. MonadEffect m => FieldNumberInt -> Maybe a -> (a -> Boolean) -> (FieldNumber -> a -> PutM m Unit) -> PutM m Unit#putRepeated Source
putRepeated :: forall m a. MonadEffect m => MonadRec m => FieldNumberInt -> Array a -> (FieldNumber -> a -> PutM m Unit) -> PutM m Unit#putPacked Source
putPacked :: forall m a. MonadEffect m => MonadRec m => FieldNumberInt -> Array a -> (a -> PutM m Unit) -> PutM m Unit#putEnumField Source
putEnumField :: forall m a. MonadEffect m => BoundedEnum a => FieldNumber -> a -> PutM m Unit#putEnum Source
putEnum :: forall m a. MonadEffect m => BoundedEnum a => a -> PutM m Unit#parseEnum Source
parseEnum :: forall m a. MonadEffect m => BoundedEnum a => ParserT DataView m a