A protocol buffer is a binary serialization format used to encode messages, including data exchanged through remote procedure calls. Serialization converts in-memory values into a transport or storage representation; deserialization reverses that transformation. section 7.3
Protocol buffers matter when latency is important because serialization consumes CPU cycles and can require costly memory copies. The surrounding workflow includes in-memory structures, network APIs, RPC boundaries, and data-store formats. section 7.3
Order message across an API
An online-store client can serialize an order containing an order ID and quantity, send it to an API or RPC service, and have the receiver deserialize it for processing. The same order may be serialized again for storage. section 7.3
Figure 7.2 Serialization transforms the in-memory representation of data (shown on the left as a Rust struct) to a serialized format such as JSON (shown on the right). Deserialization performs the opposite transformation from a serialized format to an in-memory representation.
Trace the transformation between a Rust in-memory order structure and its serialized representation, then reverse it through deserialization. section 7.3









