Bin_prot rules and Bin_prot.Shape.t

What is the correspondence between the rules for Bin_prot serialization, as given in the “Specification of the Binary Protocol” here:

GitHub - janestreet/bin_prot: Binary protocol generator

and the shapes, of type Bin_prot.Shape.t, given by the bin_shape_t generated for a type t?

I’d think there’s an explicit connection, but it doesn’t seem to be mentioned. If there isn’t, why not?

1 Like