Currently we generate separate funcs instead of having a single encode/decode per message, theoretically it could generate one:
func CodeUser[C picobuf.Coder](c C, u *User) {
c.String(1, &u.First)
c.String(2, &u.Last)
c.Int(3, &u.Age)
CodeAddress(c, 4, &u.Address)
}
However, there's a slight problem that this would require knowing CodeAddress at generation time, rather than being a method on the Address type itself. Nevertheless, this approach does look enticing. Especially, if you want to skip using proto files entirely.
Currently we generate separate funcs instead of having a single encode/decode per message, theoretically it could generate one:
However, there's a slight problem that this would require knowing
CodeAddressat generation time, rather than being a method on theAddresstype itself. Nevertheless, this approach does look enticing. Especially, if you want to skip usingprotofiles entirely.