Module wire

Source
Expand description

Low-level helpers for the nix-daemon wire format.

Structs§

FramedReader
Reader compatible with CppNix’ FramedSource/FramedSink protocol.

Enums§

Op
Opcodes.
StderrKind

Constants§

WORKER_MAGIC_1
Magic number sent by the client.
WORKER_MAGIC_2
Magic number sent by the daemon.

Functions§

copy_to_framed
read_bool
Read a boolean from the stream, encoded as u64 (>0 is true).
read_build_mode
Read a build mode from the stream.
read_build_result
read_build_result_status
Read a build result status from the stream.
read_client_settings
Read a ClientSettings structure from the stream.
read_datetime
Read a DateTime (CppNix: time_t) from the stream, encoded as a unix timestamp.
read_error
Read a NixError struct from the stream.
read_op
Read an opcode from the stream.
read_pathinfo
Read a PathInfo structure from the stream.
read_proto
Read a protocol version from the stream.
read_stderr
read_stderr_fields
read_stderr_result
read_stderr_start_activity
read_string
Read a string from the stream. Strings are prefixed with a u64 length, but the data is padded to the next 8-byte boundary, eg. a 1-byte string becomes 16 bytes on the wire: 8 for the length, 1 for the data, then 7 bytes of discarded 0x00s.
read_strings
Read a list (or set) of strings from the stream - a u64 count, followed by that many strings using the normal read_string() encoding.
read_u64
Read a u64 from the stream (little endian).
read_verbosity
Read a verbosity level from the stream.
write_bool
Write a boolean to the stream, encoded as u64 (>0 is true).
write_build_mode
Write a build mode to the stream.
write_build_result
write_build_result_status
Write a build result status to the stream.
write_client_settings
Writes a ClientSettings structure to the stream.
write_datetime
Write a DateTime (CppNix: time_t) from the stream, encoded as a unix timestamp.
write_error
Write a NixError struct to the stream.
write_op
Write an opcode to the stream.
write_pathinfo
Write a PathInfo structure to the stream.
write_proto
Write a protocol version to the stream.
write_stderr
write_stderr_fields
write_stderr_result
write_stderr_start_activity
write_string
Write a string to the stream. See: NixReader::read_string.
write_strings
Write a list of strings to the stream.
write_u64
Write a u64 from the stream (little endian).
write_verbosity
Write a verbosity level to the stream.