Crate zksync_protobuf

source ·
Expand description

Code generated from protobuf schema files and utilities for serialization.

Re-exports§

Modules§

  • Trait for defining proto conversion for external types.
  • Implementation of serde traits for structs implementing ProtoFmt. This serde implementation is compatible with protobuf json mapping, therefore it is suitable for version control. WARNING: Currently this serde implementation uses reflection, so it is not very efficient.
  • Testonly utilities.

Macros§

Constants§

  • Megabyte.
  • Kilobyte.

Traits§

  • Trait defining a proto representation for a type.

Functions§

  • Encodes a proto message of known schema (no unknown fields) into a canonical form.
  • Converts an encoded protobuf message to its canonical form, given the descriptor of the message type. Returns an error if:
  • Decodes a proto message.
  • Encodes a proto message. Currently it outputs a canonical encoding, but decode accepts non-canonical encoding as well. It would simplify invariants if we required all messages to be canonical, but we will see whether it is feasible once we have an RPC framework in place.
  • Parses a repeated proto struct into a map.
  • Parses an optional proto field.
  • Parses a required proto field.
  • Extracts a required field.