4 Thrift Protocol Support
Support for Thrift protocol encodings
4.1 Protocol Common
(require thrift/protocol/common) | package: thrift |
struct
(struct protocol-id (string numeric version))
string : string? numeric : number? version : number?
struct
(struct message-header (name type sequence-id))
name : string? type : type? sequence-id : integer?
struct
(struct field-header (name type id))
name : string? type : type? id : exact-nonnegative-integer?
struct
(struct map-header (key-type element-type length))
key-type : type? element-type : type? length : exact-nonnegative-integer?
struct
(struct list-or-set (element-type length))
element-type : type? length : exact-nonnegative-integer?
struct
(struct encoder ( name message-begin message-end struct-begin struct-end field-begin field-end field-stop map-begin map-end list-begin list-end set-begin set-end boolean byte bytes int16 int32 int64 double string)) name : string? message-begin : (-> message-header? any/c) message-end : (-> any/c) struct-begin : (-> string? any/c) struct-end : (-> any/c) field-begin : (-> field-header any/c) field-end : (-> any/c) field-stop : (-> any/c) map-begin : (-> map-header? any/c) map-end : (-> any/c) list-begin : (-> list-or-set? any/c) list-end : (-> any/c) set-begin : (-> list-or-set? any/c) set-end : (-> any/c) boolean : (-> boolean? any/c) byte : (-> byte? any/c) bytes : (-> bytes? any/c) int16 : (-> integer? any/c) int32 : (-> integer? any/c) int64 : (-> integer? any/c) double : (-> flonum? any/c) string : (-> string? any/c)
struct
(struct decoder ( name message-begin message-end struct-begin struct-end field-begin field-end field-stop map-begin map-end list-begin list-end set-begin set-end boolean byte bytes int16 int32 int64 double string)) name : string? message-begin : (-> message-header?) message-end : (-> void?) struct-begin : (-> string?) struct-end : (-> void?) field-begin : (-> field-header?) field-end : (-> void?) field-stop : (-> any/c) map-begin : (-> map-header?) map-end : (-> void?) list-begin : (-> list-or-set?) list-end : (-> void?) set-begin : (-> list-or-set?) set-end : (-> void?) boolean : (-> boolean?) byte : (-> byte?) bytes : (-> bytes?) int16 : (-> integer?) int32 : (-> integer?) int64 : (-> integer?) double : (-> flonum?) string : (-> string?)
4.2 Binary Protocol
(require thrift/protocol/binary) | package: thrift |
This protocol is described by the Binary Protocol specification.
procedure
t : transport?
procedure
t : transport?
4.3 Compact Protocol
(require thrift/protocol/compact) | package: thrift |
This protocol is described by the Compact Protocol specification.
procedure
t : transport?
procedure
t : transport?
4.4 JSON Protocol
(require thrift/protocol/json) | package: thrift |
procedure
t : transport?
procedure
t : transport?
4.5 Multiplexed Protocol
(require thrift/protocol/multiplexed) | package: thrift |
This protocol wraps an existing protocol with the ability to support the calling of multiple services over the same protocol/transport pair. It is described by the THRIFT-563 issue.
struct
(struct mux-message-header message-header (service-name))
service-name : string?
procedure
(register-service mux service-name processor) → void? mux : decoder? service-name : string? processor : protocol-processor/c
4.6 S-Expression Protocol
(require thrift/protocol/sexpression) | package: thrift |
This protocol is intended as a more Racket friendly debug protocol.
procedure
t : transport?
procedure
t : transport?
4.7 Encoding Support
(require thrift/protocol/encoding) | package: thrift |
procedure
(encode-exn e exn reply-to) → void?
e : encoder? exn : exn:thrift? reply-to : (or/c message-header? #f)
4.8 Decoding Support
(require thrift/protocol/decoding) | package: thrift |
procedure
(type-bool/decode d) → boolean?
d : decoder?
procedure
(type-byte/decode d) → byte?
d : decoder?
procedure
(type-int16/decode d) → integer?
d : decoder?
procedure
(type-int32/decode d) → integer?
d : decoder?
procedure
(type-int64/decode d) → integer?
d : decoder?
procedure
(type-double/decode d) → flonum?
d : decoder?
procedure
(type-string/decode d) → string?
d : decoder?
procedure
(type-binary/decode d) → bytes?
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
d : decoder?
procedure
(decode-a-list d element-decoder) → list?
d : decoder? element-decoder : procedure?
procedure
(decode-a-union d constructor struct-schema) → struct?
d : decoder? constructor : procedure? struct-schema : (hash/c exact-nonnegative-integer? thrift-field?)
procedure
(decode-a-struct d struct-schema) → struct?
d : decoder? struct-schema : (hash/c exact-nonnegative-integer? thrift-field?)