Learn R Programming

RProtoBuf (version 0.4.22)

asMessage: coerce an object to a protobuf message

Description

coerce an object to the Message class. This is a short-hand to the as method with the Class argument set to "Message"

Usage

asMessage(x, ...)

Value

a Message object

Arguments

x

object to coerce to a protobuf message

...

Passed to as

Author

Romain Francois <francoisromain@free.fr>

Examples

Run this code
# coerce a message type descriptor to a message
asMessage( tutorial.Person )

# coerce a enum descriptor
asMessage( tutorial.Person.PhoneType )

# coerce a field descriptor
asMessage( tutorial.Person$email )

# coerce a file descriptor 
asMessage( fileDescriptor( tutorial.Person ) )

Run the code above in your browser using DataLab