Class: Google::Protobuf::FFI

Inherits:
Object
  • Object
show all
Extended by:
FFI::Library
Defined in:
lib/google/protobuf/ffi/ffi.rb,
lib/google/protobuf/ffi/map.rb,
lib/google/protobuf/ffi/message.rb,
lib/google/protobuf/ffi/descriptor.rb,
lib/google/protobuf/ffi/internal/arena.rb,
lib/google/protobuf/ffi/repeated_field.rb,
lib/google/protobuf/ffi/descriptor_pool.rb,
lib/google/protobuf/ffi/enum_descriptor.rb,
lib/google/protobuf/ffi/file_descriptor.rb,
lib/google/protobuf/ffi/field_descriptor.rb,
lib/google/protobuf/ffi/oneof_descriptor.rb,
lib/google/protobuf/ffi/method_descriptor.rb,
lib/google/protobuf/ffi/service_descriptor.rb

Defined Under Namespace

Classes: MessageValue, MiniTable, MutableMessageValue, Status, StringView

Constant Summary collapse

Upb_Map_Begin =

Map

-1
Upb_Status_MaxMessage =

Encoding Status

511
Upb_Encode_Deterministic =
1
Upb_Encode_SkipUnknown =
2
Upb_JsonEncode_EmitDefaults =

JSON Encoding options When set, emits 0/default values. TODO: proto3 only?

1
Upb_JsonEncode_UseProtoNames =

When set, use normal (snake_case) field names instead of JSON (camelCase) names.

2
Upb_JsonEncode_FormatEnumsAsIntegers =

When set, emits enums as their integer values instead of as their names.

4
Upb_JsonDecode_IgnoreUnknown =

JSON Decoding options

1
FieldType =
enum(
  :double, 1,
  :float,
  :int64,
  :uint64,
  :int32,
  :fixed64,
  :fixed32,
  :bool,
  :string,
  :group,
  :message,
  :bytes,
  :uint32,
  :enum,
  :sfixed32,
  :sfixed64,
  :sint32,
  :sint64
)
CType =
enum(
  :bool, 1,
  :float,
  :int32,
  :uint32,
  :enum,
  :message,
  :double,
  :int64,
  :uint64,
  :string,
  :bytes
)
Label =
enum(
  :optional, 1,
  :required,
  :repeated
)
WellKnown =

All the different kind of well known type messages. For simplicity of check, number wrappers and string wrappers are grouped together. Make sure the order and merber of these groups are not changed.

enum(
  :Unspecified,
  :Any,
  :FieldMask,
  :Duration,
  :Timestamp,
  # number wrappers
  :DoubleValue,
  :FloatValue,
  :Int64Value,
  :UInt64Value,
  :Int32Value,
  :UInt32Value,
  # string wrappers
  :StringValue,
  :BytesValue,
  :BoolValue,
  :Value,
  :ListValue,
  :Struct
)
DecodeStatus =
enum(
  :Ok,
  :Malformed,         # Wire format was corrupt
  :OutOfMemory,       # Arena alloc failed
  :BadUtf8,           # String field had bad UTF-8
  :MaxDepthExceeded,  # Exceeded UPB_DECODE_MAXDEPTH

  # CheckRequired failed, but the parse otherwise succeeded.
  :MissingRequired,
)
EncodeStatus =
enum(
  :Ok,
  :OutOfMemory,       # Arena alloc failed
  :MaxDepthExceeded,  # Exceeded UPB_DECODE_MAXDEPTH

  # CheckRequired failed, but the parse otherwise succeeded.
  :MissingRequired,
)
Upb_Message_Begin =
-1

Class Method Summary collapse

Class Method Details

.decode_max_depth(i) ⇒ Object

Alternatives to pre-processor macros



205
206
207
# File 'lib/google/protobuf/ffi/ffi.rb', line 205

def self.decode_max_depth(i)
  i << 16
end