headers icon indicating copy to clipboard operation
headers copied to clipboard

Request expanded documentation on implementing `trait Header`

Open coriolinus opened this issue 2 years ago • 0 comments

The impl Header for Dnt example is a good start, but it doesn't explain the actual semantics of the iterator-based design.

Example questions which would be nice to have answered in the documentation:

  • Under what circumstances will the iterator provided to fn decode contain more than one value?
  • If a decode implementation does not consume the provided iterator entirely, what happens to the remaining values?
    • Are they re-used to produce a new instance?
    • Are they just discarded?
  • Under what circumstances is it reasonable to emit more than one value in fn encode?
  • Are the encode and decode circumstances symmetrical?

coriolinus avatar Aug 17 '23 08:08 coriolinus