Proto::Wire::Writer
Writer wraps an IO and provides typed protobuf wire-format write primitives.
Typical message encode pattern: writer.write_tag(1, WireType::VARINT) writer.write_int32(value)
For embedded messages use write_embedded which buffers the sub-message, then writes the length prefix followed by the bytes.
Constants
Constructors
Instance methods
Write a bool field only if value is true.
Write a bytes field only if value is not empty.
Write a length-delimited field by buffering the block's output. Yields the underlying IO::Memory; the accumulated bytes are length-prefixed and written.
int32: sign-extends to 64 bits (negative values become 10-byte varints)
Write an int32 field only if value != 0.
Write a packed repeated field using the block to write each element into the buffer. Skips writing the field entirely if the array is empty.
Write a string field only if value is not empty.
Write a uint64 field only if value != 0.