proto-lens-0.7.1.3: A lens-based implementation of protocol buffers in Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ProtoLens.Encoding

Synopsis

Documentation

encodeMessage :: Message msg => msg -> ByteString Source #

Encode a message to the wire format as a strict ByteString.

buildMessage :: Message msg => msg -> Builder Source #

Encode a message value.

See also the functions in Data.ProtoLens.Encoding.

decodeMessage :: Message msg => ByteString -> Either String msg Source #

Decode a message from its wire format. Returns Left if the decoding fails.

parseMessage :: Message msg => Parser msg Source #

Decode a message value.

See also the functions in Data.ProtoLens.Encoding.

decodeMessageOrDie :: Message msg => ByteString -> msg Source #

Decode a message from its wire format. Throws an error if the decoding fails.

Delimited messages

buildMessageDelimited :: Message msg => msg -> Builder Source #

Encode a message to the wire format, prefixed by its size as a VarInt, as part of a Builder.

This can be used to build up streams of messages in the size-delimited format expected by some protocols.

decodeMessageDelimitedH :: Message msg => Handle -> IO (Either String msg) Source #

Same as decodeMessage but for delimited messages read through a Handle