Module

Protobuf.Runtime

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

This module is for import by the generated .purs message modules.

Do not import this module, or any module from the package purescript-protobuf. See package README for explanation.

#parseMessage Source

parseMessage :: forall r a m. MonadEffect m => (Record r -> a) -> (Record r) -> (FieldNumberInt -> WireType -> ParserT DataView m (Builder (Record r) (Record r))) -> Int -> ParserT DataView m a

The 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.

#parseFieldUnknown Source

parseFieldUnknown :: forall r m. MonadEffect m => WireType -> ParserT DataView m (Builder (Record r) (Record r))

We don't recognize the field number, so consume the field and throw it away and then return a no-op Record builder.

#parseLenDel Source

parseLenDel :: forall a m. MonadEffect m => (Int -> ParserT DataView m a) -> ParserT DataView m a

Parse a length, then call a parser which takes one length as its argument.

#Pos Source

type Pos = Int

Parse position, zero-based, unlike Text.Parsing.Parser.Position which is one-based.

#FieldNumberInt Source

type FieldNumberInt = Int

We want Int FieldNumber to pass to parseField so that we can pattern match on Int literals. UInt doesn't export any constructors, so can't pattern match on it.

#positionZero Source

positionZero :: forall m s. Monad m => ParserT s m Pos

Zero-based position in the parser.

#manyLength Source

manyLength :: forall a m. MonadEffect m => ParserT DataView m a -> Int -> 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 a m. MonadEffect m => (a -> PutM m Unit) -> FieldNumber -> a -> PutM m Unit

#putOptional Source

putOptional :: forall a m. MonadEffect m => FieldNumberInt -> Maybe a -> (FieldNumber -> a -> PutM m Unit) -> PutM m Unit

#putRepeated Source

putRepeated :: forall a m. MonadEffect m => FieldNumberInt -> Array a -> (FieldNumber -> a -> PutM m Unit) -> PutM m Unit

#putPacked Source

putPacked :: forall a m. MonadEffect m => FieldNumberInt -> Array a -> (a -> PutM m Unit) -> PutM m Unit

#putEnum Source

putEnum :: forall a m. MonadEffect m => BoundedEnum a => FieldNumber -> a -> PutM m Unit

#putEnum' Source

putEnum' :: forall a m. MonadEffect m => BoundedEnum a => a -> PutM m Unit

#parseEnum Source

parseEnum :: forall a m. MonadEffect m => BoundedEnum a => ParserT DataView m a