std/protodesc
On this page
Index
- const
LABEL_OPTIONAL - const
LABEL_REQUIRED - const
LABEL_REPEATED - const
TYPE_DOUBLE - const
TYPE_FLOAT - const
TYPE_INT64 - const
TYPE_UINT64 - const
TYPE_INT32 - const
TYPE_FIXED64 - const
TYPE_FIXED32 - const
TYPE_BOOL - const
TYPE_STRING - const
TYPE_GROUP - const
TYPE_MESSAGE - const
TYPE_BYTES - const
TYPE_UINT32 - const
TYPE_ENUM - const
TYPE_SFIXED32 - const
TYPE_SFIXED64 - const
TYPE_SINT32 - const
TYPE_SINT64 - type
ReservedRange - type
ExtensionRange - type
OneofDesc - type
FieldDesc - type
EnumValueDesc - type
EnumDesc - type
MessageDesc - type
MethodDesc - type
ServiceDesc - type
FileDesc - fn
encode - fn
decode
Constants
LABEL_OPTIONAL
const LABEL_OPTIONAL: Int = 1FieldDescriptorProto.Label.
LABEL_REQUIRED
const LABEL_REQUIRED: Int = 2LABEL_REPEATED
const LABEL_REPEATED: Int = 3TYPE_DOUBLE
const TYPE_DOUBLE: Int = 1FieldDescriptorProto.Type.
TYPE_FLOAT
const TYPE_FLOAT: Int = 2TYPE_INT64
const TYPE_INT64: Int = 3TYPE_UINT64
const TYPE_UINT64: Int = 4TYPE_INT32
const TYPE_INT32: Int = 5TYPE_FIXED64
const TYPE_FIXED64: Int = 6TYPE_FIXED32
const TYPE_FIXED32: Int = 7TYPE_BOOL
const TYPE_BOOL: Int = 8TYPE_STRING
const TYPE_STRING: Int = 9TYPE_GROUP
const TYPE_GROUP: Int = 10TYPE_MESSAGE
const TYPE_MESSAGE: Int = 11TYPE_BYTES
const TYPE_BYTES: Int = 12TYPE_UINT32
const TYPE_UINT32: Int = 13TYPE_ENUM
const TYPE_ENUM: Int = 14TYPE_SFIXED32
const TYPE_SFIXED32: Int = 15TYPE_SFIXED64
const TYPE_SFIXED64: Int = 16TYPE_SINT32
const TYPE_SINT32: Int = 17TYPE_SINT64
const TYPE_SINT64: Int = 18Types
ReservedRange
struct ReservedRange {
start: Int
end: Int
} derive EqA start to end range (DescriptorProto.ReservedRange and EnumReservedRange; end is exclusive for
messages and inclusive for enums, as in descriptor.proto).
ExtensionRange
struct ExtensionRange {
start: Int
end: Int
options: Bytes = b""
options_set: Bool = false
} derive EqOneofDesc
struct OneofDesc {
name: Str
options: Bytes = b""
options_set: Bool = false
} derive EqFieldDesc
struct FieldDesc {
name: Str
extendee: Str = ""
number: Int
label: Int = 0
kind: Int = 0
type_name: Str = ""
default_value: Str = ""
options: Bytes = b""
options_set: Bool = false
oneof_index: Int? = None
json_name: Str = ""
proto3_optional: Bool = false
unknown: Bytes = b""
} derive EqFieldDescriptorProto. kind is the proto type (TYPE_*), type_name the fully qualified name with
its leading dot (.pkg.Msg) for a message or enum field.
EnumValueDesc
struct EnumValueDesc {
name: Str
number: Int
options: Bytes = b""
options_set: Bool = false
} derive EqEnumDesc
struct EnumDesc {
name: Str
value: List[EnumValueDesc] = []
options: Bytes = b""
options_set: Bool = false
reserved_range: List[ReservedRange] = []
reserved_name: List[Str] = []
} derive EqMessageDesc
struct MessageDesc {
name: Str
field: List[FieldDesc] = []
extension: List[FieldDesc] = []
nested_type: List[MessageDesc] = []
enum_type: List[EnumDesc] = []
extension_range: List[ExtensionRange] = []
oneof_decl: List[OneofDesc] = []
options: Bytes = b""
options_set: Bool = false
reserved_range: List[ReservedRange] = []
reserved_name: List[Str] = []
} derive EqMethodDesc
struct MethodDesc {
name: Str
input_type: Str
output_type: Str
options: Bytes = b""
options_set: Bool = false
client_streaming: Bool = false
server_streaming: Bool = false
streaming_set: Int = 0
} derive EqServiceDesc
struct ServiceDesc {
name: Str
method: List[MethodDesc] = []
options: Bytes = b""
options_set: Bool = false
} derive EqFileDesc
struct FileDesc {
name: Str
package: Str = ""
dependency: List[Str] = []
public_dependency: List[Int] = []
weak_dependency: List[Int] = []
message_type: List[MessageDesc] = []
enum_type: List[EnumDesc] = []
service: List[ServiceDesc] = []
extension: List[FieldDesc] = []
options: Bytes = b""
options_set: Bool = false
source_code_info: Bytes = b""
syntax: Str = ""
edition: Int = 0
} derive EqFileDescriptorProto. syntax is proto2 (written as empty), proto3 or editions.
Functions
encode
fn encode(f: FileDesc) -> BytesThe wire bytes of f (a serialized FileDescriptorProto), fields in field number order.
decode
fn decode(data: Bytes) -> FileDesc ! protobuf.ProtoErrThe FileDescriptorProto of data; the wire reader’s errors, and Utf8 for a name that is not text.