Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · protodesc

Docs

std/protodesc

On this page

Index

Constants

LABEL_OPTIONAL

const LABEL_OPTIONAL: Int = 1

FieldDescriptorProto.Label.

Source: std/protodesc.xo:12

LABEL_REQUIRED

const LABEL_REQUIRED: Int = 2

Source: std/protodesc.xo:13

LABEL_REPEATED

const LABEL_REPEATED: Int = 3

Source: std/protodesc.xo:14

TYPE_DOUBLE

const TYPE_DOUBLE: Int = 1

FieldDescriptorProto.Type.

Source: std/protodesc.xo:17

TYPE_FLOAT

const TYPE_FLOAT: Int = 2

Source: std/protodesc.xo:18

TYPE_INT64

const TYPE_INT64: Int = 3

Source: std/protodesc.xo:19

TYPE_UINT64

const TYPE_UINT64: Int = 4

Source: std/protodesc.xo:20

TYPE_INT32

const TYPE_INT32: Int = 5

Source: std/protodesc.xo:21

TYPE_FIXED64

const TYPE_FIXED64: Int = 6

Source: std/protodesc.xo:22

TYPE_FIXED32

const TYPE_FIXED32: Int = 7

Source: std/protodesc.xo:23

TYPE_BOOL

const TYPE_BOOL: Int = 8

Source: std/protodesc.xo:24

TYPE_STRING

const TYPE_STRING: Int = 9

Source: std/protodesc.xo:25

TYPE_GROUP

const TYPE_GROUP: Int = 10

Source: std/protodesc.xo:26

TYPE_MESSAGE

const TYPE_MESSAGE: Int = 11

Source: std/protodesc.xo:27

TYPE_BYTES

const TYPE_BYTES: Int = 12

Source: std/protodesc.xo:28

TYPE_UINT32

const TYPE_UINT32: Int = 13

Source: std/protodesc.xo:29

TYPE_ENUM

const TYPE_ENUM: Int = 14

Source: std/protodesc.xo:30

TYPE_SFIXED32

const TYPE_SFIXED32: Int = 15

Source: std/protodesc.xo:31

TYPE_SFIXED64

const TYPE_SFIXED64: Int = 16

Source: std/protodesc.xo:32

TYPE_SINT32

const TYPE_SINT32: Int = 17

Source: std/protodesc.xo:33

TYPE_SINT64

const TYPE_SINT64: Int = 18

Source: std/protodesc.xo:34

Types

ReservedRange

struct ReservedRange {
  start: Int
  end: Int
} derive Eq

A start to end range (DescriptorProto.ReservedRange and EnumReservedRange; end is exclusive for messages and inclusive for enums, as in descriptor.proto).

Source: std/protodesc.xo:38

ExtensionRange

struct ExtensionRange {
  start: Int
  end: Int
  options: Bytes = b""
  options_set: Bool = false
} derive Eq

Source: std/protodesc.xo:43

OneofDesc

struct OneofDesc {
  name: Str
  options: Bytes = b""
  options_set: Bool = false
} derive Eq

Source: std/protodesc.xo:51

FieldDesc

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 Eq

FieldDescriptorProto. kind is the proto type (TYPE_*), type_name the fully qualified name with its leading dot (.pkg.Msg) for a message or enum field.

Source: std/protodesc.xo:60

EnumValueDesc

struct EnumValueDesc {
  name: Str
  number: Int
  options: Bytes = b""
  options_set: Bool = false
} derive Eq

Source: std/protodesc.xo:77

EnumDesc

struct EnumDesc {
  name: Str
  value: List[EnumValueDesc] = []
  options: Bytes = b""
  options_set: Bool = false
  reserved_range: List[ReservedRange] = []
  reserved_name: List[Str] = []
} derive Eq

Source: std/protodesc.xo:85

MessageDesc

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 Eq

Source: std/protodesc.xo:95

MethodDesc

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 Eq

Source: std/protodesc.xo:110

ServiceDesc

struct ServiceDesc {
  name: Str
  method: List[MethodDesc] = []
  options: Bytes = b""
  options_set: Bool = false
} derive Eq

Source: std/protodesc.xo:124

FileDesc

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 Eq

FileDescriptorProto. syntax is proto2 (written as empty), proto3 or editions.

Source: std/protodesc.xo:133

Functions

encode

fn encode(f: FileDesc) -> Bytes

The wire bytes of f (a serialized FileDescriptorProto), fields in field number order.

Source: std/protodesc.xo:152

decode

fn decode(data: Bytes) -> FileDesc ! protobuf.ProtoErr

The FileDescriptorProto of data; the wire reader’s errors, and Utf8 for a name that is not text.

Source: std/protodesc.xo:154

↑ index