google-protobuf 4.30.2 → 4.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/defs.c +330 -150
- data/ext/google/protobuf_c/extconf.rb +8 -10
- data/ext/google/protobuf_c/map.c +76 -39
- data/ext/google/protobuf_c/message.c +94 -58
- data/ext/google/protobuf_c/protobuf.c +1 -1
- data/ext/google/protobuf_c/protobuf.h +0 -8
- data/ext/google/protobuf_c/repeated_field.c +75 -38
- data/ext/google/protobuf_c/ruby-upb.c +13697 -14467
- data/ext/google/protobuf_c/ruby-upb.h +2687 -2039
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.c +6 -6
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range_neon.inc +1 -1
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range_sse.inc +1 -1
- data/lib/google/protobuf/any_pb.rb +1 -1
- data/lib/google/protobuf/api_pb.rb +2 -2
- data/lib/google/protobuf/descriptor_pb.rb +5 -2
- data/lib/google/protobuf/duration_pb.rb +1 -1
- data/lib/google/protobuf/empty_pb.rb +1 -1
- data/lib/google/protobuf/ffi/descriptor_pool.rb +3 -1
- data/lib/google/protobuf/ffi/field_descriptor.rb +6 -0
- data/lib/google/protobuf/ffi/file_descriptor.rb +26 -0
- data/lib/google/protobuf/ffi/internal/pointer_helper.rb +2 -1
- data/lib/google/protobuf/ffi/map.rb +2 -2
- data/lib/google/protobuf/field_mask_pb.rb +1 -1
- data/lib/google/protobuf/message_exts.rb +4 -0
- data/lib/google/protobuf/plugin_pb.rb +1 -1
- data/lib/google/protobuf/source_context_pb.rb +1 -1
- data/lib/google/protobuf/struct_pb.rb +1 -1
- data/lib/google/protobuf/timestamp_pb.rb +1 -1
- data/lib/google/protobuf/type_pb.rb +1 -1
- data/lib/google/protobuf/wrappers_pb.rb +1 -1
- data/lib/google/protobuf_ffi.rb +1 -1
- data/lib/google/tasks/ffi.rake +1 -1
- metadata +20 -21
- data/ext/google/protobuf_c/wrap_memcpy.c +0 -29
@@ -93,9 +93,15 @@ const upb_DefPool* DescriptorPool_GetSymtab(VALUE desc_pool_rb) {
|
|
93
93
|
return pool->symtab;
|
94
94
|
}
|
95
95
|
|
96
|
+
/**
|
97
|
+
* ruby-doc: DescriptorPool
|
98
|
+
*
|
99
|
+
* A DescriptorPool is the registry of all known Protobuf descriptor objects.
|
100
|
+
*
|
101
|
+
*/
|
102
|
+
|
96
103
|
/*
|
97
|
-
*
|
98
|
-
* DescriptorPool.new => pool
|
104
|
+
* ruby-doc: DescriptorPool.new
|
99
105
|
*
|
100
106
|
* Creates a new, empty, descriptor pool.
|
101
107
|
*/
|
@@ -112,10 +118,14 @@ static VALUE DescriptorPool_alloc(VALUE klass) {
|
|
112
118
|
}
|
113
119
|
|
114
120
|
/*
|
115
|
-
*
|
116
|
-
*
|
121
|
+
* ruby-doc: DescriptorPool#add_serialized_file
|
122
|
+
*
|
123
|
+
* Adds the given serialized
|
124
|
+
* {https://protobuf.com/docs/descriptors#file-descriptors FileDescriptorProto}
|
125
|
+
* to the pool.
|
117
126
|
*
|
118
|
-
*
|
127
|
+
* @param serialized_file_proto [String]
|
128
|
+
* @return [FileDescriptor]
|
119
129
|
*/
|
120
130
|
VALUE DescriptorPool_add_serialized_file(VALUE _self,
|
121
131
|
VALUE serialized_file_proto) {
|
@@ -143,11 +153,14 @@ VALUE DescriptorPool_add_serialized_file(VALUE _self,
|
|
143
153
|
}
|
144
154
|
|
145
155
|
/*
|
146
|
-
*
|
147
|
-
* DescriptorPool.lookup(name) => descriptor
|
156
|
+
* ruby-doc: DescriptorPool#lookup
|
148
157
|
*
|
149
|
-
* Finds a Descriptor, EnumDescriptor,
|
158
|
+
* Finds a {Descriptor}, {EnumDescriptor},
|
159
|
+
* {FieldDescriptor} or {ServiceDescriptor} by
|
150
160
|
* name and returns it, or nil if none exists with the given name.
|
161
|
+
*
|
162
|
+
* @param name [String]
|
163
|
+
* @return [Descriptor,EnumDescriptor,FieldDescriptor,ServiceDescriptor]
|
151
164
|
*/
|
152
165
|
static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
|
153
166
|
DescriptorPool* self = ruby_to_DescriptorPool(_self);
|
@@ -156,6 +169,7 @@ static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
|
|
156
169
|
const upb_EnumDef* enumdef;
|
157
170
|
const upb_FieldDef* fielddef;
|
158
171
|
const upb_ServiceDef* servicedef;
|
172
|
+
const upb_FileDef* filedef;
|
159
173
|
|
160
174
|
msgdef = upb_DefPool_FindMessageByName(self->symtab, name_str);
|
161
175
|
if (msgdef) {
|
@@ -177,17 +191,23 @@ static VALUE DescriptorPool_lookup(VALUE _self, VALUE name) {
|
|
177
191
|
return get_servicedef_obj(_self, servicedef);
|
178
192
|
}
|
179
193
|
|
194
|
+
filedef = upb_DefPool_FindFileByName(self->symtab, name_str);
|
195
|
+
if (filedef) {
|
196
|
+
return get_filedef_obj(_self, filedef);
|
197
|
+
}
|
198
|
+
|
180
199
|
return Qnil;
|
181
200
|
}
|
182
201
|
|
183
202
|
/*
|
184
|
-
*
|
185
|
-
* DescriptorPool.generated_pool => descriptor_pool
|
203
|
+
* ruby-doc: DescriptorPool.generated_pool
|
186
204
|
*
|
187
|
-
* Class method that returns the global DescriptorPool. This is a singleton
|
188
|
-
* which generated-code message and enum types are registered. The user may
|
189
|
-
* register types in this pool for convenience so that they do not have to
|
190
|
-
* a reference to a private pool instance.
|
205
|
+
* Class method that returns the global {DescriptorPool}. This is a singleton
|
206
|
+
* into which generated-code message and enum types are registered. The user may
|
207
|
+
* also register types in this pool for convenience so that they do not have to
|
208
|
+
* hold a reference to a private pool instance.
|
209
|
+
*
|
210
|
+
* @return [DescriptorPool]
|
191
211
|
*/
|
192
212
|
static VALUE DescriptorPool_generated_pool(VALUE _self) {
|
193
213
|
return generated_pool;
|
@@ -284,8 +304,13 @@ static VALUE decode_options(VALUE self, const char* option_type, int size,
|
|
284
304
|
}
|
285
305
|
|
286
306
|
/*
|
287
|
-
*
|
288
|
-
*
|
307
|
+
* ruby-doc: Descriptor
|
308
|
+
*
|
309
|
+
* A Descriptor provides information about a given Protobuf definition.
|
310
|
+
*/
|
311
|
+
|
312
|
+
/*
|
313
|
+
* ruby-doc: Descriptor.initialize
|
289
314
|
*
|
290
315
|
* Creates a new, empty, message type descriptor. At a minimum, its name must be
|
291
316
|
* set before it is added to a pool. It cannot be used to create messages until
|
@@ -323,10 +348,11 @@ static VALUE Descriptor_initialize(VALUE _self, VALUE cookie,
|
|
323
348
|
}
|
324
349
|
|
325
350
|
/*
|
326
|
-
*
|
327
|
-
* Descriptor.file_descriptor
|
351
|
+
* ruby-doc: Descriptor#file_descriptor
|
328
352
|
*
|
329
|
-
* Returns the FileDescriptor object this message belongs to.
|
353
|
+
* Returns the {FileDescriptor} object this message belongs to.
|
354
|
+
*
|
355
|
+
* @return [FileDescriptor]
|
330
356
|
*/
|
331
357
|
static VALUE Descriptor_file_descriptor(VALUE _self) {
|
332
358
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -335,11 +361,12 @@ static VALUE Descriptor_file_descriptor(VALUE _self) {
|
|
335
361
|
}
|
336
362
|
|
337
363
|
/*
|
338
|
-
*
|
339
|
-
* Descriptor.name => name
|
364
|
+
* ruby-doc: Descriptor#name
|
340
365
|
*
|
341
366
|
* Returns the name of this message type as a fully-qualified string (e.g.,
|
342
367
|
* My.Package.MessageType).
|
368
|
+
*
|
369
|
+
* @return [String]
|
343
370
|
*/
|
344
371
|
static VALUE Descriptor_name(VALUE _self) {
|
345
372
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -347,10 +374,12 @@ static VALUE Descriptor_name(VALUE _self) {
|
|
347
374
|
}
|
348
375
|
|
349
376
|
/*
|
350
|
-
*
|
351
|
-
* Descriptor.each(&block)
|
377
|
+
* ruby-doc: Descriptor#each
|
352
378
|
*
|
353
379
|
* Iterates over fields in this message type, yielding to the block on each one.
|
380
|
+
*
|
381
|
+
* @yield [FieldDescriptor]
|
382
|
+
* @return [nil]
|
354
383
|
*/
|
355
384
|
static VALUE Descriptor_each(VALUE _self) {
|
356
385
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -365,11 +394,13 @@ static VALUE Descriptor_each(VALUE _self) {
|
|
365
394
|
}
|
366
395
|
|
367
396
|
/*
|
368
|
-
*
|
369
|
-
* Descriptor.lookup(name) => FieldDescriptor
|
397
|
+
* ruby-doc: Descriptor#lookup
|
370
398
|
*
|
371
399
|
* Returns the field descriptor for the field with the given name, if present,
|
372
400
|
* or nil if none.
|
401
|
+
*
|
402
|
+
* @param name [String]
|
403
|
+
* @return [FieldDescriptor]
|
373
404
|
*/
|
374
405
|
static VALUE Descriptor_lookup(VALUE _self, VALUE name) {
|
375
406
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -382,11 +413,13 @@ static VALUE Descriptor_lookup(VALUE _self, VALUE name) {
|
|
382
413
|
}
|
383
414
|
|
384
415
|
/*
|
385
|
-
*
|
386
|
-
* Descriptor.each_oneof(&block) => nil
|
416
|
+
* ruby-doc: Descriptor#each_oneof
|
387
417
|
*
|
388
418
|
* Invokes the given block for each oneof in this message type, passing the
|
389
|
-
* corresponding OneofDescriptor.
|
419
|
+
* corresponding {OneofDescriptor}.
|
420
|
+
*
|
421
|
+
* @yield [OneofDescriptor]
|
422
|
+
* @return [nil]
|
390
423
|
*/
|
391
424
|
static VALUE Descriptor_each_oneof(VALUE _self) {
|
392
425
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -401,11 +434,13 @@ static VALUE Descriptor_each_oneof(VALUE _self) {
|
|
401
434
|
}
|
402
435
|
|
403
436
|
/*
|
404
|
-
*
|
405
|
-
* Descriptor.lookup_oneof(name) => OneofDescriptor
|
437
|
+
* ruby-doc: Descriptor#lookup_oneof
|
406
438
|
*
|
407
439
|
* Returns the oneof descriptor for the oneof with the given name, if present,
|
408
440
|
* or nil if none.
|
441
|
+
*
|
442
|
+
* @param name [String]
|
443
|
+
* @return [OneofDescriptor]
|
409
444
|
*/
|
410
445
|
static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
|
411
446
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -418,10 +453,11 @@ static VALUE Descriptor_lookup_oneof(VALUE _self, VALUE name) {
|
|
418
453
|
}
|
419
454
|
|
420
455
|
/*
|
421
|
-
*
|
422
|
-
* Descriptor.msgclass => message_klass
|
456
|
+
* ruby-doc: Descriptor#msgclass
|
423
457
|
*
|
424
458
|
* Returns the Ruby class created for this message type.
|
459
|
+
*
|
460
|
+
* @return [Class<Google::Protobuf::AbstractMessage>]
|
425
461
|
*/
|
426
462
|
static VALUE Descriptor_msgclass(VALUE _self) {
|
427
463
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -432,10 +468,13 @@ static VALUE Descriptor_msgclass(VALUE _self) {
|
|
432
468
|
}
|
433
469
|
|
434
470
|
/*
|
435
|
-
*
|
436
|
-
*
|
471
|
+
* ruby-doc: Descriptor#options
|
472
|
+
*
|
473
|
+
* Returns the
|
474
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L571
|
475
|
+
* MessageOptions} for this {Descriptor}.
|
437
476
|
*
|
438
|
-
*
|
477
|
+
* @return [MessageOptions]
|
439
478
|
*/
|
440
479
|
static VALUE Descriptor_options(VALUE _self) {
|
441
480
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -452,10 +491,13 @@ static VALUE Descriptor_options(VALUE _self) {
|
|
452
491
|
}
|
453
492
|
|
454
493
|
/*
|
455
|
-
*
|
456
|
-
*
|
494
|
+
* ruby-doc: Descriptor#to_proto
|
495
|
+
*
|
496
|
+
* Returns the
|
497
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L147
|
498
|
+
* DescriptorProto} of this {Descriptor}.
|
457
499
|
*
|
458
|
-
*
|
500
|
+
* @return [DescriptorProto]
|
459
501
|
*/
|
460
502
|
static VALUE Descriptor_to_proto(VALUE _self) {
|
461
503
|
Descriptor* self = ruby_to_Descriptor(_self);
|
@@ -528,9 +570,15 @@ static VALUE FileDescriptor_alloc(VALUE klass) {
|
|
528
570
|
return ret;
|
529
571
|
}
|
530
572
|
|
573
|
+
/**
|
574
|
+
* ruby-doc: FileDescriptor
|
575
|
+
*
|
576
|
+
* A FileDescriptor provides information about all Protobuf definitions in a
|
577
|
+
* particular file.
|
578
|
+
*/
|
579
|
+
|
531
580
|
/*
|
532
|
-
*
|
533
|
-
* FileDescriptor.new => file
|
581
|
+
* ruby-doc: FileDescriptor#initialize
|
534
582
|
*
|
535
583
|
* Returns a new file descriptor. May
|
536
584
|
* to a builder.
|
@@ -551,10 +599,11 @@ static VALUE FileDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
551
599
|
}
|
552
600
|
|
553
601
|
/*
|
554
|
-
*
|
555
|
-
* FileDescriptor.name => name
|
602
|
+
* ruby-doc: FileDescriptor#name
|
556
603
|
*
|
557
604
|
* Returns the name of the file.
|
605
|
+
*
|
606
|
+
* @return [String]
|
558
607
|
*/
|
559
608
|
static VALUE FileDescriptor_name(VALUE _self) {
|
560
609
|
FileDescriptor* self = ruby_to_FileDescriptor(_self);
|
@@ -563,10 +612,13 @@ static VALUE FileDescriptor_name(VALUE _self) {
|
|
563
612
|
}
|
564
613
|
|
565
614
|
/*
|
566
|
-
*
|
567
|
-
*
|
615
|
+
* ruby-doc: FileDescriptor#options
|
616
|
+
*
|
617
|
+
* Returns the
|
618
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L442
|
619
|
+
* FileOptions} for this {FileDescriptor}.
|
568
620
|
*
|
569
|
-
*
|
621
|
+
* @return [FileOptions]
|
570
622
|
*/
|
571
623
|
static VALUE FileDescriptor_options(VALUE _self) {
|
572
624
|
FileDescriptor* self = ruby_to_FileDescriptor(_self);
|
@@ -581,10 +633,13 @@ static VALUE FileDescriptor_options(VALUE _self) {
|
|
581
633
|
}
|
582
634
|
|
583
635
|
/*
|
584
|
-
*
|
585
|
-
*
|
636
|
+
* ruby-doc: FileDescriptor#to_proto
|
637
|
+
*
|
638
|
+
* Returns the
|
639
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L104
|
640
|
+
* FileDescriptorProto} of this {FileDescriptor}.
|
586
641
|
*
|
587
|
-
*
|
642
|
+
* @return [FileDescriptorProto]
|
588
643
|
*/
|
589
644
|
static VALUE FileDescriptor_to_proto(VALUE _self) {
|
590
645
|
FileDescriptor* self = ruby_to_FileDescriptor(_self);
|
@@ -645,9 +700,15 @@ static FieldDescriptor* ruby_to_FieldDescriptor(VALUE val) {
|
|
645
700
|
return ret;
|
646
701
|
}
|
647
702
|
|
703
|
+
/**
|
704
|
+
* ruby-doc: FieldDescriptor
|
705
|
+
*
|
706
|
+
* A FieldDescriptor provides information about the Protobuf definition of a
|
707
|
+
* field inside a {Descriptor}.
|
708
|
+
*/
|
709
|
+
|
648
710
|
/*
|
649
|
-
*
|
650
|
-
* FieldDescriptor.new => field
|
711
|
+
* ruby-doc: FieldDescriptor#initialize
|
651
712
|
*
|
652
713
|
* Returns a new field descriptor. Its name, type, etc. must be set before it is
|
653
714
|
* added to a message type.
|
@@ -681,10 +742,11 @@ static VALUE FieldDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
681
742
|
}
|
682
743
|
|
683
744
|
/*
|
684
|
-
*
|
685
|
-
* FieldDescriptor.name => name
|
745
|
+
* ruby-doc: FieldDescriptor#name
|
686
746
|
*
|
687
747
|
* Returns the name of this field.
|
748
|
+
*
|
749
|
+
* @return [String]
|
688
750
|
*/
|
689
751
|
static VALUE FieldDescriptor_name(VALUE _self) {
|
690
752
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -749,14 +811,15 @@ static VALUE descriptortype_to_ruby(upb_FieldType type) {
|
|
749
811
|
}
|
750
812
|
|
751
813
|
/*
|
752
|
-
*
|
753
|
-
* FieldDescriptor.type => type
|
814
|
+
* ruby-doc: FieldDescriptor#type
|
754
815
|
*
|
755
816
|
* Returns this field's type, as a Ruby symbol, or nil if not yet set.
|
756
817
|
*
|
757
818
|
* Valid field types are:
|
758
819
|
* :int32, :int64, :uint32, :uint64, :float, :double, :bool, :string,
|
759
820
|
* :bytes, :message.
|
821
|
+
*
|
822
|
+
* @return [Symbol]
|
760
823
|
*/
|
761
824
|
static VALUE FieldDescriptor__type(VALUE _self) {
|
762
825
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -764,10 +827,11 @@ static VALUE FieldDescriptor__type(VALUE _self) {
|
|
764
827
|
}
|
765
828
|
|
766
829
|
/*
|
767
|
-
*
|
768
|
-
* FieldDescriptor.default => default
|
830
|
+
* ruby-doc: FieldDescriptor#default
|
769
831
|
*
|
770
832
|
* Returns this field's default, as a Ruby object, or nil if not yet set.
|
833
|
+
*
|
834
|
+
* @return [Object,nil]
|
771
835
|
*/
|
772
836
|
static VALUE FieldDescriptor_default(VALUE _self) {
|
773
837
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -782,10 +846,11 @@ static VALUE FieldDescriptor_default(VALUE _self) {
|
|
782
846
|
}
|
783
847
|
|
784
848
|
/*
|
785
|
-
*
|
786
|
-
* FieldDescriptor.has_presence? => bool
|
849
|
+
* ruby-doc: FieldDescriptor.has_presence?
|
787
850
|
*
|
788
851
|
* Returns whether this field tracks presence.
|
852
|
+
*
|
853
|
+
* @return [Boolean]
|
789
854
|
*/
|
790
855
|
static VALUE FieldDescriptor_has_presence(VALUE _self) {
|
791
856
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -793,10 +858,33 @@ static VALUE FieldDescriptor_has_presence(VALUE _self) {
|
|
793
858
|
}
|
794
859
|
|
795
860
|
/*
|
796
|
-
*
|
797
|
-
*
|
861
|
+
* ruby-doc: FieldDescriptor#required?
|
862
|
+
*
|
863
|
+
* Returns whether this is a required field.
|
864
|
+
*
|
865
|
+
* @return [Boolean]
|
866
|
+
*/
|
867
|
+
static VALUE FieldDescriptor_is_required(VALUE _self) {
|
868
|
+
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
869
|
+
return upb_FieldDef_IsRequired(self->fielddef) ? Qtrue : Qfalse;
|
870
|
+
}
|
871
|
+
|
872
|
+
/*
|
873
|
+
* ruby-doc: FieldDescriptor#repeated?
|
874
|
+
*
|
875
|
+
* Returns whether this is a repeated field.
|
876
|
+
* @return [Boolean]
|
877
|
+
*/
|
878
|
+
static VALUE FieldDescriptor_is_repeated(VALUE _self) {
|
879
|
+
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
880
|
+
return upb_FieldDef_IsRepeated(self->fielddef) ? Qtrue : Qfalse;
|
881
|
+
}
|
882
|
+
|
883
|
+
/*
|
884
|
+
* ruby-doc: FieldDescriptor#is_packed?
|
798
885
|
*
|
799
886
|
* Returns whether this is a repeated field that uses packed encoding.
|
887
|
+
* @return [Boolean]
|
800
888
|
*/
|
801
889
|
static VALUE FieldDescriptor_is_packed(VALUE _self) {
|
802
890
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -804,10 +892,11 @@ static VALUE FieldDescriptor_is_packed(VALUE _self) {
|
|
804
892
|
}
|
805
893
|
|
806
894
|
/*
|
807
|
-
*
|
808
|
-
* FieldDescriptor.json_name => json_name
|
895
|
+
* ruby-doc: FieldDescriptor#json_name
|
809
896
|
*
|
810
897
|
* Returns this field's json_name, as a Ruby string, or nil if not yet set.
|
898
|
+
*
|
899
|
+
* @return [String,nil]
|
811
900
|
*/
|
812
901
|
static VALUE FieldDescriptor_json_name(VALUE _self) {
|
813
902
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -817,13 +906,14 @@ static VALUE FieldDescriptor_json_name(VALUE _self) {
|
|
817
906
|
}
|
818
907
|
|
819
908
|
/*
|
820
|
-
*
|
821
|
-
* FieldDescriptor.label => label
|
909
|
+
* ruby-doc: FieldDescriptor#label
|
822
910
|
*
|
823
911
|
* Returns this field's label (i.e., plurality), as a Ruby symbol.
|
824
|
-
*
|
825
912
|
* Valid field labels are:
|
826
|
-
*
|
913
|
+
* :optional, :repeated
|
914
|
+
*
|
915
|
+
* @return [Symbol]
|
916
|
+
* @deprecated Use {#repeated?} or {#required?} instead.
|
827
917
|
*/
|
828
918
|
static VALUE FieldDescriptor_label(VALUE _self) {
|
829
919
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -843,10 +933,11 @@ static VALUE FieldDescriptor_label(VALUE _self) {
|
|
843
933
|
}
|
844
934
|
|
845
935
|
/*
|
846
|
-
*
|
847
|
-
* FieldDescriptor.number => number
|
936
|
+
* ruby-doc: FieldDescriptor#number
|
848
937
|
*
|
849
938
|
* Returns the tag number for this field.
|
939
|
+
*
|
940
|
+
* @return [Integer]
|
850
941
|
*/
|
851
942
|
static VALUE FieldDescriptor_number(VALUE _self) {
|
852
943
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -854,13 +945,14 @@ static VALUE FieldDescriptor_number(VALUE _self) {
|
|
854
945
|
}
|
855
946
|
|
856
947
|
/*
|
857
|
-
*
|
858
|
-
* FieldDescriptor.submsg_name => submsg_name
|
948
|
+
* ruby-doc: FieldDescriptor#submsg_name
|
859
949
|
*
|
860
950
|
* Returns the name of the message or enum type corresponding to this field, if
|
861
951
|
* it is a message or enum field (respectively), or nil otherwise. This type
|
862
952
|
* name will be resolved within the context of the pool to which the containing
|
863
953
|
* message type is added.
|
954
|
+
*
|
955
|
+
* @return [String,nil]
|
864
956
|
*/
|
865
957
|
static VALUE FieldDescriptor_submsg_name(VALUE _self) {
|
866
958
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -877,13 +969,14 @@ static VALUE FieldDescriptor_submsg_name(VALUE _self) {
|
|
877
969
|
}
|
878
970
|
|
879
971
|
/*
|
880
|
-
*
|
881
|
-
* FieldDescriptor.subtype => message_or_enum_descriptor
|
972
|
+
* ruby-doc: FieldDescriptor#subtype
|
882
973
|
*
|
883
974
|
* Returns the message or enum descriptor corresponding to this field's type if
|
884
975
|
* it is a message or enum field, respectively, or nil otherwise. Cannot be
|
885
976
|
* called *until* the containing message type is added to a pool (and thus
|
886
977
|
* resolved).
|
978
|
+
*
|
979
|
+
* @return [Descriptor,EnumDescriptor,nil]
|
887
980
|
*/
|
888
981
|
static VALUE FieldDescriptor_subtype(VALUE _self) {
|
889
982
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -900,11 +993,13 @@ static VALUE FieldDescriptor_subtype(VALUE _self) {
|
|
900
993
|
}
|
901
994
|
|
902
995
|
/*
|
903
|
-
*
|
904
|
-
* FieldDescriptor.get(message) => value
|
996
|
+
* ruby-doc: FieldDescriptor#get
|
905
997
|
*
|
906
998
|
* Returns the value set for this field on the given message. Raises an
|
907
999
|
* exception if message is of the wrong type.
|
1000
|
+
*
|
1001
|
+
* @param message [AbstractMessage]
|
1002
|
+
* @return [Object]
|
908
1003
|
*/
|
909
1004
|
static VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb) {
|
910
1005
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -920,11 +1015,13 @@ static VALUE FieldDescriptor_get(VALUE _self, VALUE msg_rb) {
|
|
920
1015
|
}
|
921
1016
|
|
922
1017
|
/*
|
923
|
-
*
|
924
|
-
* FieldDescriptor.has?(message) => boolean
|
1018
|
+
* ruby-doc: FieldDescriptor.has?
|
925
1019
|
*
|
926
1020
|
* Returns whether the value is set on the given message. Raises an
|
927
1021
|
* exception when calling for fields that do not have presence.
|
1022
|
+
*
|
1023
|
+
* @param message [AbstractMessage]
|
1024
|
+
* @return [Boolean]
|
928
1025
|
*/
|
929
1026
|
static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
|
930
1027
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -941,10 +1038,12 @@ static VALUE FieldDescriptor_has(VALUE _self, VALUE msg_rb) {
|
|
941
1038
|
}
|
942
1039
|
|
943
1040
|
/*
|
944
|
-
*
|
945
|
-
* FieldDescriptor.clear(message)
|
1041
|
+
* ruby-doc: FieldDescriptor#clear
|
946
1042
|
*
|
947
1043
|
* Clears the field from the message if it's set.
|
1044
|
+
*
|
1045
|
+
* @param message [AbstractMessage]
|
1046
|
+
* @return [nil]
|
948
1047
|
*/
|
949
1048
|
static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
|
950
1049
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -960,12 +1059,14 @@ static VALUE FieldDescriptor_clear(VALUE _self, VALUE msg_rb) {
|
|
960
1059
|
}
|
961
1060
|
|
962
1061
|
/*
|
963
|
-
*
|
964
|
-
* FieldDescriptor.set(message, value)
|
1062
|
+
* ruby-doc: FieldDescriptor#set
|
965
1063
|
*
|
966
1064
|
* Sets the value corresponding to this field to the given value on the given
|
967
1065
|
* message. Raises an exception if message is of the wrong type. Performs the
|
968
1066
|
* ordinary type-checks for field setting.
|
1067
|
+
*
|
1068
|
+
* @param message [AbstractMessage]
|
1069
|
+
* @param value [Object]
|
969
1070
|
*/
|
970
1071
|
static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
|
971
1072
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -985,10 +1086,13 @@ static VALUE FieldDescriptor_set(VALUE _self, VALUE msg_rb, VALUE value) {
|
|
985
1086
|
}
|
986
1087
|
|
987
1088
|
/*
|
988
|
-
*
|
989
|
-
*
|
1089
|
+
* ruby-doc: FieldDescriptor#options
|
1090
|
+
*
|
1091
|
+
* Returns the
|
1092
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L656
|
1093
|
+
* FieldOptions} for this {FieldDescriptor}.
|
990
1094
|
*
|
991
|
-
*
|
1095
|
+
* @return [FieldOptions]
|
992
1096
|
*/
|
993
1097
|
static VALUE FieldDescriptor_options(VALUE _self) {
|
994
1098
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -1004,10 +1108,13 @@ static VALUE FieldDescriptor_options(VALUE _self) {
|
|
1004
1108
|
}
|
1005
1109
|
|
1006
1110
|
/*
|
1007
|
-
*
|
1008
|
-
*
|
1111
|
+
* ruby-doc: FieldDescriptor#to_proto
|
1112
|
+
*
|
1113
|
+
* Returns the
|
1114
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L236
|
1115
|
+
* FieldDescriptorProto} of this {FieldDescriptor}.
|
1009
1116
|
*
|
1010
|
-
*
|
1117
|
+
* @return [FieldDescriptorProto]
|
1011
1118
|
*/
|
1012
1119
|
static VALUE FieldDescriptor_to_proto(VALUE _self) {
|
1013
1120
|
FieldDescriptor* self = ruby_to_FieldDescriptor(_self);
|
@@ -1032,6 +1139,8 @@ static void FieldDescriptor_register(VALUE module) {
|
|
1032
1139
|
rb_define_method(klass, "type", FieldDescriptor__type, 0);
|
1033
1140
|
rb_define_method(klass, "default", FieldDescriptor_default, 0);
|
1034
1141
|
rb_define_method(klass, "has_presence?", FieldDescriptor_has_presence, 0);
|
1142
|
+
rb_define_method(klass, "required?", FieldDescriptor_is_required, 0);
|
1143
|
+
rb_define_method(klass, "repeated?", FieldDescriptor_is_repeated, 0);
|
1035
1144
|
rb_define_method(klass, "is_packed?", FieldDescriptor_is_packed, 0);
|
1036
1145
|
rb_define_method(klass, "json_name", FieldDescriptor_json_name, 0);
|
1037
1146
|
rb_define_method(klass, "label", FieldDescriptor_label, 0);
|
@@ -1078,9 +1187,15 @@ static OneofDescriptor* ruby_to_OneofDescriptor(VALUE val) {
|
|
1078
1187
|
return ret;
|
1079
1188
|
}
|
1080
1189
|
|
1190
|
+
/**
|
1191
|
+
* ruby-doc: OneofDescriptor
|
1192
|
+
*
|
1193
|
+
* A OneofDescriptor provides information about the Protobuf definition of a
|
1194
|
+
* oneof inside a {Descriptor}.
|
1195
|
+
*/
|
1196
|
+
|
1081
1197
|
/*
|
1082
|
-
*
|
1083
|
-
* OneofDescriptor.new => oneof_descriptor
|
1198
|
+
* ruby-doc: OneofDescriptor#initialize
|
1084
1199
|
*
|
1085
1200
|
* Creates a new, empty, oneof descriptor. The oneof may only be modified prior
|
1086
1201
|
* to being added to a message descriptor which is subsequently added to a pool.
|
@@ -1115,10 +1230,11 @@ static VALUE OneofDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
1115
1230
|
}
|
1116
1231
|
|
1117
1232
|
/*
|
1118
|
-
*
|
1119
|
-
* OneofDescriptor.name => name
|
1233
|
+
* ruby-doc: OneofDescriptor#name
|
1120
1234
|
*
|
1121
1235
|
* Returns the name of this oneof.
|
1236
|
+
*
|
1237
|
+
* @return [String]
|
1122
1238
|
*/
|
1123
1239
|
static VALUE OneofDescriptor_name(VALUE _self) {
|
1124
1240
|
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
|
@@ -1126,10 +1242,12 @@ static VALUE OneofDescriptor_name(VALUE _self) {
|
|
1126
1242
|
}
|
1127
1243
|
|
1128
1244
|
/*
|
1129
|
-
*
|
1130
|
-
* OneofDescriptor.each(&block) => nil
|
1245
|
+
* ruby-doc: OneofDescriptor#each
|
1131
1246
|
*
|
1132
1247
|
* Iterates through fields in this oneof, yielding to the block on each one.
|
1248
|
+
*
|
1249
|
+
* @yield [FieldDescriptor]
|
1250
|
+
* @return [nil]
|
1133
1251
|
*/
|
1134
1252
|
static VALUE OneofDescriptor_each(VALUE _self) {
|
1135
1253
|
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
|
@@ -1144,10 +1262,13 @@ static VALUE OneofDescriptor_each(VALUE _self) {
|
|
1144
1262
|
}
|
1145
1263
|
|
1146
1264
|
/*
|
1147
|
-
*
|
1148
|
-
*
|
1265
|
+
* ruby-doc: OneofDescriptor#options
|
1266
|
+
*
|
1267
|
+
* Returns the
|
1268
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L824
|
1269
|
+
* OneofOptions} for this {OneofDescriptor}.
|
1149
1270
|
*
|
1150
|
-
*
|
1271
|
+
* @return [OneofOptions]
|
1151
1272
|
*/
|
1152
1273
|
static VALUE OneOfDescriptor_options(VALUE _self) {
|
1153
1274
|
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
|
@@ -1163,10 +1284,13 @@ static VALUE OneOfDescriptor_options(VALUE _self) {
|
|
1163
1284
|
}
|
1164
1285
|
|
1165
1286
|
/*
|
1166
|
-
*
|
1167
|
-
* OneofDescriptor.to_proto => OneofDescriptorProto
|
1287
|
+
* ruby-doc: OneofDescriptor#to_proto
|
1168
1288
|
*
|
1169
|
-
* Returns the
|
1289
|
+
* Returns the
|
1290
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L343
|
1291
|
+
* OneofDescriptorProto} of this {OneofDescriptor}.
|
1292
|
+
*
|
1293
|
+
* @return [OneofDescriptorProto]
|
1170
1294
|
*/
|
1171
1295
|
static VALUE OneOfDescriptor_to_proto(VALUE _self) {
|
1172
1296
|
OneofDescriptor* self = ruby_to_OneofDescriptor(_self);
|
@@ -1243,6 +1367,13 @@ const upb_EnumDef* EnumDescriptor_GetEnumDef(VALUE enum_desc_rb) {
|
|
1243
1367
|
return desc->enumdef;
|
1244
1368
|
}
|
1245
1369
|
|
1370
|
+
/**
|
1371
|
+
* ruby-doc: EnumDescriptor
|
1372
|
+
*
|
1373
|
+
* An EnumDescriptor provides information about the Protobuf definition of an
|
1374
|
+
* enum inside a {Descriptor}.
|
1375
|
+
*/
|
1376
|
+
|
1246
1377
|
/*
|
1247
1378
|
* call-seq:
|
1248
1379
|
* EnumDescriptor.new(c_only_cookie, ptr) => EnumDescriptor
|
@@ -1265,10 +1396,11 @@ static VALUE EnumDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
1265
1396
|
}
|
1266
1397
|
|
1267
1398
|
/*
|
1268
|
-
*
|
1269
|
-
* EnumDescriptor.file_descriptor
|
1399
|
+
* ruby-doc: EnumDescriptor#file_descriptor
|
1270
1400
|
*
|
1271
|
-
* Returns the FileDescriptor object this enum belongs to.
|
1401
|
+
* Returns the {FileDescriptor} object this enum belongs to.
|
1402
|
+
*
|
1403
|
+
* @return [FileDescriptor]
|
1272
1404
|
*/
|
1273
1405
|
static VALUE EnumDescriptor_file_descriptor(VALUE _self) {
|
1274
1406
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1277,10 +1409,11 @@ static VALUE EnumDescriptor_file_descriptor(VALUE _self) {
|
|
1277
1409
|
}
|
1278
1410
|
|
1279
1411
|
/*
|
1280
|
-
*
|
1281
|
-
* EnumDescriptor.is_closed? => bool
|
1412
|
+
* ruby-doc: EnumDescriptor#is_closed?
|
1282
1413
|
*
|
1283
1414
|
* Returns whether this enum is open or closed.
|
1415
|
+
*
|
1416
|
+
* @return [Boolean]
|
1284
1417
|
*/
|
1285
1418
|
static VALUE EnumDescriptor_is_closed(VALUE _self) {
|
1286
1419
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1288,10 +1421,11 @@ static VALUE EnumDescriptor_is_closed(VALUE _self) {
|
|
1288
1421
|
}
|
1289
1422
|
|
1290
1423
|
/*
|
1291
|
-
*
|
1292
|
-
* EnumDescriptor.name => name
|
1424
|
+
* ruby-doc: EnumDescriptor#name
|
1293
1425
|
*
|
1294
1426
|
* Returns the name of this enum type.
|
1427
|
+
*
|
1428
|
+
* @return [String]
|
1295
1429
|
*/
|
1296
1430
|
static VALUE EnumDescriptor_name(VALUE _self) {
|
1297
1431
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1299,11 +1433,13 @@ static VALUE EnumDescriptor_name(VALUE _self) {
|
|
1299
1433
|
}
|
1300
1434
|
|
1301
1435
|
/*
|
1302
|
-
*
|
1303
|
-
* EnumDescriptor.lookup_name(name) => value
|
1436
|
+
* ruby-doc: EnumDescriptor#lookup_name
|
1304
1437
|
*
|
1305
1438
|
* Returns the numeric value corresponding to the given key name (as a Ruby
|
1306
1439
|
* symbol), or nil if none.
|
1440
|
+
*
|
1441
|
+
* @param name [Symbol]
|
1442
|
+
* @return [Integer,nil]
|
1307
1443
|
*/
|
1308
1444
|
static VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name) {
|
1309
1445
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1318,11 +1454,13 @@ static VALUE EnumDescriptor_lookup_name(VALUE _self, VALUE name) {
|
|
1318
1454
|
}
|
1319
1455
|
|
1320
1456
|
/*
|
1321
|
-
*
|
1322
|
-
* EnumDescriptor.lookup_value(name) => value
|
1457
|
+
* ruby-doc: EnumDescriptor#lookup_value
|
1323
1458
|
*
|
1324
1459
|
* Returns the key name (as a Ruby symbol) corresponding to the integer value,
|
1325
1460
|
* or nil if none.
|
1461
|
+
*
|
1462
|
+
* @param name [Integer]
|
1463
|
+
* @return [Symbol,nil]
|
1326
1464
|
*/
|
1327
1465
|
static VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number) {
|
1328
1466
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1337,11 +1475,13 @@ static VALUE EnumDescriptor_lookup_value(VALUE _self, VALUE number) {
|
|
1337
1475
|
}
|
1338
1476
|
|
1339
1477
|
/*
|
1340
|
-
*
|
1341
|
-
* EnumDescriptor.each(&block)
|
1478
|
+
* ruby-doc: EnumDescriptor#each
|
1342
1479
|
*
|
1343
1480
|
* Iterates over key => value mappings in this enum's definition, yielding to
|
1344
1481
|
* the block with (key, value) arguments for each one.
|
1482
|
+
*
|
1483
|
+
* @yield [Symbol, Integer]
|
1484
|
+
* @return [nil]
|
1345
1485
|
*/
|
1346
1486
|
static VALUE EnumDescriptor_each(VALUE _self) {
|
1347
1487
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1358,10 +1498,11 @@ static VALUE EnumDescriptor_each(VALUE _self) {
|
|
1358
1498
|
}
|
1359
1499
|
|
1360
1500
|
/*
|
1361
|
-
*
|
1362
|
-
* EnumDescriptor.enummodule => module
|
1501
|
+
* ruby-doc: EnumDescriptor#enummodule
|
1363
1502
|
*
|
1364
1503
|
* Returns the Ruby module corresponding to this enum type.
|
1504
|
+
*
|
1505
|
+
* @return [Module]
|
1365
1506
|
*/
|
1366
1507
|
static VALUE EnumDescriptor_enummodule(VALUE _self) {
|
1367
1508
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1372,10 +1513,13 @@ static VALUE EnumDescriptor_enummodule(VALUE _self) {
|
|
1372
1513
|
}
|
1373
1514
|
|
1374
1515
|
/*
|
1375
|
-
*
|
1376
|
-
* EnumDescriptor.options => options
|
1516
|
+
* ruby-doc: EnumDescriptor#options
|
1377
1517
|
*
|
1378
|
-
* Returns the
|
1518
|
+
* Returns the
|
1519
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L838
|
1520
|
+
* EnumOptions} for this {EnumDescriptor}.
|
1521
|
+
*
|
1522
|
+
* @return [EnumOptions]
|
1379
1523
|
*/
|
1380
1524
|
static VALUE EnumDescriptor_options(VALUE _self) {
|
1381
1525
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1390,10 +1534,12 @@ static VALUE EnumDescriptor_options(VALUE _self) {
|
|
1390
1534
|
}
|
1391
1535
|
|
1392
1536
|
/*
|
1393
|
-
*
|
1394
|
-
* EnumDescriptor.to_proto => EnumDescriptorProto
|
1537
|
+
* ruby-doc: EnumDescriptor#to_proto
|
1395
1538
|
*
|
1396
|
-
* Returns the
|
1539
|
+
* Returns the
|
1540
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L349
|
1541
|
+
* EnumDescriptorProto} of this {EnumDescriptor}.
|
1542
|
+
* @return [EnumDescriptorProto]
|
1397
1543
|
*/
|
1398
1544
|
static VALUE EnumDescriptor_to_proto(VALUE _self) {
|
1399
1545
|
EnumDescriptor* self = ruby_to_EnumDescriptor(_self);
|
@@ -1471,6 +1617,13 @@ static VALUE ServiceDescriptor_alloc(VALUE klass) {
|
|
1471
1617
|
return ret;
|
1472
1618
|
}
|
1473
1619
|
|
1620
|
+
/**
|
1621
|
+
* ruby-doc: ServiceDescriptor
|
1622
|
+
*
|
1623
|
+
* A ServiceDescriptor provides information about the Protobuf definition of an
|
1624
|
+
* RPC service.
|
1625
|
+
*/
|
1626
|
+
|
1474
1627
|
/*
|
1475
1628
|
* call-seq:
|
1476
1629
|
* ServiceDescriptor.new(c_only_cookie, ptr) => ServiceDescriptor
|
@@ -1493,10 +1646,11 @@ static VALUE ServiceDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
1493
1646
|
}
|
1494
1647
|
|
1495
1648
|
/*
|
1496
|
-
*
|
1497
|
-
* ServiceDescriptor.name => name
|
1649
|
+
* ruby-doc: ServiceDescriptor#name
|
1498
1650
|
*
|
1499
1651
|
* Returns the name of this service.
|
1652
|
+
*
|
1653
|
+
* @return [String]
|
1500
1654
|
*/
|
1501
1655
|
static VALUE ServiceDescriptor_name(VALUE _self) {
|
1502
1656
|
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
|
@@ -1504,10 +1658,10 @@ static VALUE ServiceDescriptor_name(VALUE _self) {
|
|
1504
1658
|
}
|
1505
1659
|
|
1506
1660
|
/*
|
1507
|
-
*
|
1508
|
-
* ServiceDescriptor.file_descriptor
|
1661
|
+
* ruby-doc: ServiceDescriptor#file_descriptor
|
1509
1662
|
*
|
1510
|
-
* Returns the FileDescriptor object this service belongs to.
|
1663
|
+
* Returns the {FileDescriptor} object this service belongs to.
|
1664
|
+
* @return [FileDescriptor]
|
1511
1665
|
*/
|
1512
1666
|
static VALUE ServiceDescriptor_file_descriptor(VALUE _self) {
|
1513
1667
|
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
|
@@ -1516,10 +1670,12 @@ static VALUE ServiceDescriptor_file_descriptor(VALUE _self) {
|
|
1516
1670
|
}
|
1517
1671
|
|
1518
1672
|
/*
|
1519
|
-
*
|
1520
|
-
* ServiceDescriptor.each(&block)
|
1673
|
+
* ruby-doc: ServiceDescriptor#each
|
1521
1674
|
*
|
1522
1675
|
* Iterates over methods in this service, yielding to the block on each one.
|
1676
|
+
*
|
1677
|
+
* @yield [MethodDescriptor]
|
1678
|
+
* @return [nil]
|
1523
1679
|
*/
|
1524
1680
|
static VALUE ServiceDescriptor_each(VALUE _self) {
|
1525
1681
|
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
|
@@ -1534,10 +1690,13 @@ static VALUE ServiceDescriptor_each(VALUE _self) {
|
|
1534
1690
|
}
|
1535
1691
|
|
1536
1692
|
/*
|
1537
|
-
*
|
1538
|
-
*
|
1693
|
+
* ruby-doc: ServiceDescriptor#options
|
1694
|
+
*
|
1695
|
+
* Returns the
|
1696
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L901
|
1697
|
+
* ServiceOptions} for this {ServiceDescriptor}.
|
1539
1698
|
*
|
1540
|
-
*
|
1699
|
+
* @return [ServiceOptions]
|
1541
1700
|
*/
|
1542
1701
|
static VALUE ServiceDescriptor_options(VALUE _self) {
|
1543
1702
|
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
|
@@ -1554,10 +1713,13 @@ static VALUE ServiceDescriptor_options(VALUE _self) {
|
|
1554
1713
|
}
|
1555
1714
|
|
1556
1715
|
/*
|
1557
|
-
*
|
1558
|
-
*
|
1716
|
+
* ruby-doc: ServiceDescriptor#to_proto
|
1717
|
+
*
|
1718
|
+
* Returns the
|
1719
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L386
|
1720
|
+
* ServiceDescriptorProto} of this {ServiceDescriptor}.
|
1559
1721
|
*
|
1560
|
-
*
|
1722
|
+
* @return [ServiceDescriptorProto]
|
1561
1723
|
*/
|
1562
1724
|
static VALUE ServiceDescriptor_to_proto(VALUE _self) {
|
1563
1725
|
ServiceDescriptor* self = ruby_to_ServiceDescriptor(_self);
|
@@ -1630,6 +1792,13 @@ static VALUE MethodDescriptor_alloc(VALUE klass) {
|
|
1630
1792
|
return ret;
|
1631
1793
|
}
|
1632
1794
|
|
1795
|
+
/**
|
1796
|
+
* ruby-doc: MethodDescriptor
|
1797
|
+
*
|
1798
|
+
* A MethodDescriptor provides information about the Protobuf definition of a
|
1799
|
+
* method inside an RPC service.
|
1800
|
+
*/
|
1801
|
+
|
1633
1802
|
/*
|
1634
1803
|
* call-seq:
|
1635
1804
|
* MethodDescriptor.new(c_only_cookie, ptr) => MethodDescriptor
|
@@ -1652,10 +1821,11 @@ static VALUE MethodDescriptor_initialize(VALUE _self, VALUE cookie,
|
|
1652
1821
|
}
|
1653
1822
|
|
1654
1823
|
/*
|
1655
|
-
*
|
1656
|
-
* MethodDescriptor.name => name
|
1824
|
+
* ruby-doc: MethodDescriptor#name
|
1657
1825
|
*
|
1658
1826
|
* Returns the name of this method
|
1827
|
+
*
|
1828
|
+
* @return [String]
|
1659
1829
|
*/
|
1660
1830
|
static VALUE MethodDescriptor_name(VALUE _self) {
|
1661
1831
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|
@@ -1663,10 +1833,13 @@ static VALUE MethodDescriptor_name(VALUE _self) {
|
|
1663
1833
|
}
|
1664
1834
|
|
1665
1835
|
/*
|
1666
|
-
*
|
1667
|
-
* MethodDescriptor.options => options
|
1836
|
+
* ruby-doc: MethodDescriptor#options
|
1668
1837
|
*
|
1669
|
-
* Returns the
|
1838
|
+
* Returns the
|
1839
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L927
|
1840
|
+
* MethodOptions} for this {MethodDescriptor}.
|
1841
|
+
*
|
1842
|
+
* @return [MethodOptions]
|
1670
1843
|
*/
|
1671
1844
|
static VALUE MethodDescriptor_options(VALUE _self) {
|
1672
1845
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|
@@ -1683,10 +1856,11 @@ static VALUE MethodDescriptor_options(VALUE _self) {
|
|
1683
1856
|
}
|
1684
1857
|
|
1685
1858
|
/*
|
1686
|
-
*
|
1687
|
-
* MethodDescriptor.input_type => Descriptor
|
1859
|
+
* ruby-doc: MethodDescriptor#input_type
|
1688
1860
|
*
|
1689
|
-
* Returns the
|
1861
|
+
* Returns the {Descriptor} for the request message type of this method
|
1862
|
+
*
|
1863
|
+
* @return [Descriptor]
|
1690
1864
|
*/
|
1691
1865
|
static VALUE MethodDescriptor_input_type(VALUE _self) {
|
1692
1866
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|
@@ -1695,10 +1869,11 @@ static VALUE MethodDescriptor_input_type(VALUE _self) {
|
|
1695
1869
|
}
|
1696
1870
|
|
1697
1871
|
/*
|
1698
|
-
*
|
1699
|
-
*
|
1872
|
+
* ruby-doc: MethodDescriptor#output_type
|
1873
|
+
*
|
1874
|
+
* Returns the {Descriptor} for the response message type of this method
|
1700
1875
|
*
|
1701
|
-
*
|
1876
|
+
* @return [Descriptor]
|
1702
1877
|
*/
|
1703
1878
|
static VALUE MethodDescriptor_output_type(VALUE _self) {
|
1704
1879
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|
@@ -1707,10 +1882,11 @@ static VALUE MethodDescriptor_output_type(VALUE _self) {
|
|
1707
1882
|
}
|
1708
1883
|
|
1709
1884
|
/*
|
1710
|
-
*
|
1711
|
-
* MethodDescriptor.client_streaming => bool
|
1885
|
+
* ruby-doc: MethodDescriptor#client_streaming
|
1712
1886
|
*
|
1713
1887
|
* Returns whether or not this is a streaming request method
|
1888
|
+
*
|
1889
|
+
* @return [Boolean]
|
1714
1890
|
*/
|
1715
1891
|
static VALUE MethodDescriptor_client_streaming(VALUE _self) {
|
1716
1892
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|
@@ -1718,10 +1894,13 @@ static VALUE MethodDescriptor_client_streaming(VALUE _self) {
|
|
1718
1894
|
}
|
1719
1895
|
|
1720
1896
|
/*
|
1721
|
-
*
|
1722
|
-
*
|
1897
|
+
* ruby-doc: MethodDescriptor#to_proto
|
1898
|
+
*
|
1899
|
+
* Returns the
|
1900
|
+
* {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L394
|
1901
|
+
* MethodDescriptorProto} of this {MethodDescriptor}.
|
1723
1902
|
*
|
1724
|
-
*
|
1903
|
+
* @return [MethodDescriptorProto]
|
1725
1904
|
*/
|
1726
1905
|
static VALUE MethodDescriptor_to_proto(VALUE _self) {
|
1727
1906
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|
@@ -1739,10 +1918,11 @@ static VALUE MethodDescriptor_to_proto(VALUE _self) {
|
|
1739
1918
|
}
|
1740
1919
|
|
1741
1920
|
/*
|
1742
|
-
*
|
1743
|
-
* MethodDescriptor.server_streaming => bool
|
1921
|
+
* ruby-doc: MethodDescriptor#server_streaming
|
1744
1922
|
*
|
1745
1923
|
* Returns whether or not this is a streaming response method
|
1924
|
+
*
|
1925
|
+
* @return [Boolean]
|
1746
1926
|
*/
|
1747
1927
|
static VALUE MethodDescriptor_server_streaming(VALUE _self) {
|
1748
1928
|
MethodDescriptor* self = ruby_to_MethodDescriptor(_self);
|