protobuf-nim icon indicating copy to clipboard operation
protobuf-nim copied to clipboard

provide easy serialization / deserialization

Open timotheecour opened this issue 6 years ago • 0 comments

same as done here: https://github.com/oswjk/protobuf-nim/blob/master/README.md

let message = newTest1()
# ...
let data = serialize(message)
let message2 = newTest1(data)
assert message2 == message

This could be in addition to the existing stream based API:

var stream = newStringStream()
stream.write message
stream.setPosition(0)
var message2 = stream.readExampleMessage()

timotheecour avatar Apr 02 '18 17:04 timotheecour