as.list.Message {RProtoBuf} | R Documentation |
Grab the protocol buffer message as an R list
Description
Utility to grab the protocol buffer message as an R list, with one item per field.
Usage
## S3 method for class 'Message'
as.list(x, ...)
## S3 method for class 'Descriptor'
as.list(x, ...)
## S3 method for class 'EnumDescriptor'
as.list(x, ...)
## S3 method for class 'FileDescriptor'
as.list(x, ...)
## S3 method for class 'ServiceDescriptor'
as.list(x, ...)
Arguments
x |
A protocol buffer message, instance of Message, or a protocol message descriptor, instance of Descriptor |
... |
ignored |
Value
For messages, a list of the content of the fields is returned.
For message type descriptors, a list containing nested type descriptors (Descriptor objects), enum type descriptors (EnumDescriptor objects), then field descriptors (FieldDescriptor objects) in that order.
For enum descriptors, a named list of the enumerated values.
For file descriptors, a named list of descriptors defined in the specified file descriptor.
For service descriptors, ...
Author(s)
Romain Francois <francoisromain@free.fr>
Examples
Person <- P( "tutorial.Person" )
romain <- new( Person, email = "francoisromain@free.fr", id = 1 )
as.list( romain )
as.list( Person )
as.list( Person$PhoneType)
[Package RProtoBuf version 0.4.22 Index]