On this page:
9.0
top
up

3EncodingπŸ”— i

(require (lib"protobuf/encoding")) package: protobuf
Low-level functions dealing with the binary wire format of protocol buffers.

procedure

( read-uint* [inmax-size])

(or/cexact-nonnegative-integer?eof-object?)
in:input-port?=(current-input-port)
max-size:(or/cexact-positive-integer?#f)=10

procedure

( write-uint* n[outmax-size])void?

n:exact-nonnegative-integer?
out:output-port?=(current-output-port)
max-size:(or/cexact-positive-integer?#f)=10
Read/write a variable length unsigned integer. If max-size is not false, it defines the maximum number of bytes that the encoded number may use.

procedure

( read-sint* [inmax-size])(or/cexact-integer?eof-object?)

in:input-port?=(current-input-port)
max-size:(or/cexact-positive-integer?#f)=10

procedure

( write-sint* i[outmax-size])void?

i:exact-integer?
out:output-port?=(current-output-port)
max-size:(or/cexact-positive-integer?#f)=10
Read/write a variable length signed integer in zigzag encoding. If max-size is not false, it defines the maximum number of bytes that the encoded number may use.

procedure

( read-int* [in])(or/cexact-integer?eof-object?)

in:input-port?=(current-input-port)

procedure

( write-int* i[out])void?

i:exact-integer?
out:output-port?=(current-output-port)
Read/write a variable length signed integer in tows-complement encoding. The maximum number of bytes used by the encoded number is 10, the maximum bit length of the number is 64.

procedure

( read-bool [in])(or/cbool?eof-object?)

in:input-port?=(current-input-port)

procedure

( write-bool v[out])void?

v:any/c
out:output-port?=(current-output-port)
Read/write a boolean as a one byte integer.

procedure

( read-fixed32 [in])

(or/cexact-nonnegative-integer?eof-object?)
in:input-port?=(current-input-port)

procedure

( read-fixed64 [in])

(or/cexact-nonnegative-integer?eof-object?)
in:input-port?=(current-input-port)

procedure

( write-fixed32 n[out])void?

n:exact-nonnegative-integer?
out:output-port?=(current-output-port)

procedure

( write-fixed64 n[out])void?

n:exact-nonnegative-integer?
out:output-port?=(current-output-port)
Read/write unsigned integers as fixed length 32/64-bit values with little endian byte order.

procedure

( read-sfixed32 [in])(or/cexact-integer?eof-object?)

in:input-port?=(current-input-port)

procedure

( read-sfixed64 [in])(or/cexact-integer?eof-object?)

in:input-port?=(current-input-port)

procedure

( write-sfixed32 i[out])void?

i:exact-integer?
out:output-port?=(current-output-port)

procedure

( write-sfixed64 i[out])void?

i:exact-integer?
out:output-port?=(current-output-port)
Read/write signed integers as fixed length 32/64-bit values in twos-complement encoding with little endian byte order.

procedure

( read-float [in])(or/creal?eof-object?)

in:input-port?=(current-input-port)

procedure

( read-double [in])(or/creal?eof-object?)

in:input-port?=(current-input-port)

procedure

( write-float x[out])void?

x:real?
out:output-port?=(current-output-port)

procedure

( write-double x[out])void?

x:real?
out:output-port?=(current-output-port)
Read/write real numbers as fixed length 32/64-bit IEEE floating point values with little endian byte order.

procedure

( read-sized-bytes [in])(or/cbytes?eof-object?)

in:input-port?=(current-input-port)

procedure

( write-sized-bytes bstr[out])void?

bstr:bytes?
out:output-port?=(current-output-port)
Read/write a byte string with size prefix. The size is read and written using read-uint* and write-uint* .

procedure

( read-sized-string [in])(or/cstring?eof-object?)

in:input-port?=(current-input-port)

procedure

( write-sized-string str[out])void?

str:string?
out:output-port?=(current-output-port)
Read/write a UTF-8 encoded string with size prefix. The size in bytes is read and written using read-uint* and write-uint* .

procedure

( read-sized read[in])any/c

read:(->input-port?any/c)
in:input-port?=(current-input-port)

procedure

( write-sized writev[out])any

write:(->any/coutput-port?any)
v:any/c
out:output-port?=(current-output-port)
Read/write any object with size prefix. The size in bytes is read and written using read-uint* and write-uint* .

On input, read is called on an input port limited according to the size prefix. On output, write is called on v and a byte string output port; the buffered output’s length is then written to the actual output port.

procedure

( read-tag/type [in])

(or/ctag/ceof-object?)
(or/cexact-nonnegative-integer?eof-object?)
in:input-port?=(current-input-port)

procedure

( write-tag/type tagtype[out])void?

tag:tag/c
type:exact-nonnegative-integer?
out:output-port?=(current-output-port)
Read/write the tag and type of a protocol buffer message field.

value

type/c :flat-contract?

Contract matching any of the protocol buffer message field wire type enumeration items:
  • 'int*: The field value is encoded as a variable length integer.

  • '64bit: The field value is always encoded in 64 bits.

  • '32bit: The field value is always encoded in 32 bits.

  • 'sized: The field value is encoded with a byte size prefix.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /