RProtoBuf (version 0.4.13)

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, ...)

Arguments

x

object to coerce to a protobuf message

Passed to as

Value

a '>Message object

Examples

Run this code
# NOT RUN {
# 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 DataCamp Workspace