1 Reflection
struct
(struct primitive-info type-info (type reader writer))
type : type/c reader : (-> input-port? any/c) writer : (-> any/c output-port? any)
The reader and writer are responsible for (de-)serialization of values of this type.
struct
integer->enum : (-> exact-integer? any/c) enum->integer : (-> any/c exact-integer?)
The integer->enum and enum->integer conversions are responsible to make the Racket representation of the enumeration compatible with (de-)serialization using read-int* and write-int*.
The define-enum-type syntax can be used to synthesize conversion procedures between symbols and integers as well as an instance of this structure type.
value
prop:protobuf : struct-type-property?
procedure
(protobuf? v) → boolean?
v : any/c
procedure
(protobuf-ref v [default]) → any/c
v : any/c default : any/c = ...
The procedure protobuf? checks for the presence of the property on a structure type or instance; protobuf-ref extracts the value of the property.
struct
(struct message-info type-info (constructor fields required))
constructor : (-> any/c) fields : (hash/c exact-nonnegative-integer? field?) required : (set/c exact-nonnegative-integer?)
The constructor is used to obtain fresh instances of the structure type representing the message type which have all fields initialized to the default value (void) for missing fields.
The hash fields maps wire tags to field descriptors, the set required indicates which wire tags must be present in a valid message.
The define-message-type syntax can be used to synthesize a structure type and an instance of this descriptor type.
struct
(struct field-info (type repeated? packed? accessor mutator))
type : (or/c primitive-info? enum-info? struct-type?) repeated? : any/c packed? : any/c accessor : (->* (any/c) (any/c) any/c) mutator : (-> any/c any/c any)
Iff the field can be present any number of times, repeated? should be true; packed? may be true for repeated fields of non-length-delimited primitive types to specify a more efficient wire format.
The accessor and mutator are used to extract and modify the values of the field in instances of the message structure.
struct
(struct message (extensions unknown) #:mutable #:transparent) extensions : (hash/c exact-nonnegative-integer? any/c) unknown : bytes?