- protobuf_message(?Template, ?WireStream) is semidet
- protobuf_message(?Template, ?WireStream, ?Rest) is nondet
- Marshals and unmarshals byte streams encoded using Google's
Protobuf grammars. protobuf_message/2 provides a bi-directional
parser that marshals a Prolog structure to WireStream, according
to rules specified by Template. It can also unmarshal WireStream
into a Prolog structure according to the same grammar.
protobuf_message/3 provides a difference list version.
- Arguments:
-
Template - is a protobuf grammar specification. On decode, unbound variables in the Template are unified with their respective values in the WireStream. On encode, Template must be ground. WireStream - is a code list that was generated by a protobuf encoder using an equivalent template. - bug
- - The protobuf specification states that the wire-stream can have the fields in any order and that unknown fields are to be ignored. This implementation assumes that the fields are in the exact order of the definition and match exactly. If you use protobuf_parse_from_codes/3, you can avoid this problem.o