Module binary

Module binary 

Source
Expand description

Binary protocol for Unix Domain Socket transport.

This module provides a binary framing format for efficient communication over UDS, eliminating JSON overhead and base64 encoding for body data.

§Wire Format

+----------------+---------------+-------------------+
| Length (4 BE)  | Type (1 byte) | Payload (N bytes) |
+----------------+---------------+-------------------+
  • Length: 4-byte big-endian u32, total length of type + payload
  • Type: 1-byte message type discriminator
  • Payload: Variable-length payload (format depends on type)

§Performance Benefits

  • No JSON parsing overhead (~10x faster for small messages)
  • No base64 encoding for body data (saves 33% bandwidth)
  • Zero-copy with bytes::Bytes where possible

Structs§

BinaryAgentResponse
Binary agent response.
BinaryBodyChunk
Binary body chunk event (zero-copy).
BinaryFrame
Binary frame with header and payload.
BinaryRequestHeaders
Binary request headers event.

Enums§

MessageType
Binary message types

Constants§

MAX_BINARY_MESSAGE_SIZE
Maximum binary message size (10 MB)