protozoa/wire

Protocol Buffer Wire Format Module

This module defines the low-level wire format types and utilities for Protocol Buffer binary encoding and decoding. It provides the foundational types and functions needed to work with the Protocol Buffer binary wire format specification.

Wire Format Fundamentals

Protocol Buffers use a binary wire format for efficient serialization. Each field is encoded with a specific wire type that determines how the data is represented:

Capabilities

Usage in Protozoa

This module is primarily used by the encode and decode modules to:

Public API

The main public component is the WireType type which is used throughout the encode/decode pipeline. Internal utility functions are marked with @internal as they are implementation details.

Types

WireType represents the encoding format used for Protocol Buffer fields. Each wire type determines how the field value is encoded on the wire.

pub type WireType {
  Varint
  Fixed64
  LengthDelimited
  StartGroup
  EndGroup
  Fixed32
}

Constructors

  • Varint

    Variable-length encoding for integers (int32, int64, uint32, uint64, sint32, sint64, bool, enum)

  • Fixed64

    Fixed 64-bit value (fixed64, sfixed64, double)

  • LengthDelimited

    Length-prefixed data (string, bytes, embedded messages, packed repeated fields)

  • StartGroup

    Deprecated: Start of a group (no longer used in proto3)

  • EndGroup

    Deprecated: End of a group (no longer used in proto3)

  • Fixed32

    Fixed 32-bit value (fixed32, sfixed32, float)

Search Document