proto-lens-0.3.0.0: A lens-based implementation of protocol buffers in Haskell.

Safe HaskellNone
LanguageHaskell2010

Data.ProtoLens.TextFormat

Description

Functions for converting protocol buffers to a human-readable text format.

Synopsis

Documentation

showMessage :: Message msg => msg -> String Source #

Convert the given message into a human-readable String.

showMessageWithRegistry :: Message msg => Registry -> msg -> String Source #

Convert the given message into a human-readable String, using the Registry to encode google.protobuf.Any values.

showMessageShort :: Message msg => msg -> String Source #

Serializes a proto as a string on a single line. Useful for debugging and error messages like .DebugString() in other languages.

pprintMessage :: Message msg => msg -> Doc Source #

Pretty-print the given message into a human-readable form.

pprintMessageWithRegistry :: Message msg => Registry -> msg -> Doc Source #

Pretty-print the given message into human-readable form, using the given Registry to decode google.protobuf.Any values.

readMessage :: Message msg => Text -> Either String msg Source #

Parse a Message from the human-readable protocol buffer text format.

readMessageWithRegistry :: Message msg => Registry -> Text -> Either String msg Source #

Parse a Message from a human-readable protocol buffer text format, using the given Registry to decode Any fields

readMessageOrDie :: Message msg => Text -> msg Source #

Parse a Message from the human-readable protocol buffer text format. Throws an error if the parse was not successful.