Skip to main content

Module wire

Module wire 

Source
Expand description

Nix worker protocol wire format.

Clean-room implementation. All integers are 64-bit unsigned, little-endian. Byte buffers are length-prefixed (u64 LE) with zero-padding to 8-byte alignment.

Enums§

StderrMsg
Stderr message types sent by the daemon during operation processing.
WireError
WorkerOp
Worker protocol operation codes.

Constants§

PROTOCOL_VERSION
Current protocol version (major.minor packed as u64).
WORKER_MAGIC_1
Worker protocol magic: client sends this.
WORKER_MAGIC_2
Worker protocol magic: server responds with this.

Functions§

read_bool
Read a bool (from u64: 0 or 1).
read_bytes
Read a length-prefixed, 8-byte-aligned byte buffer.
read_string
Read a UTF-8 string.
read_string_list
Read a list of strings.
read_u64
Read a u64 in little-endian.
write_bool
Write a bool (as u64: 0 or 1).
write_bytes
Write a length-prefixed, 8-byte-aligned byte buffer.
write_string
Write a UTF-8 string (as length-prefixed bytes).
write_string_list
Write a list of strings.
write_u64
Write a u64 in little-endian.