Question about `bincode`: variable-length types?

If I use bincode's Encode and Decode traits on a struct, will I be able to put (for example) a String in it, and forget about the length? I'm making a network protocol, and it would be so nice if I didn't have to keep track of the length of that field manually.

That's the whole point of bincode: You don't have to take care of the format.
Length is encoded first using the configured IntEncoding.

1 Like