3 Commits
Author SHA1 Message Date
Cory Benfield 246d886cf7 Use a higher-level protocol for encoding/decoding.
Motivation:

Right now we disambiguate the multiple top-level SH types by using three
separate entry points on the encoder/decoder. This isn't great: it
forces that information to be known statically at compile time, making
it much harder to write generic APIs that use structured header fields.

Modifications:

- Provide a new protocol, `StructuredHeaderField`, that must be used for
  the top-level `Codable` object.
- Provide `StructuredHeaderFieldType` to communicate the types of
  structured header fields.
- Remove the multiple entry points.
- Update the tests.

Result:

Types will encode what kind of structured header field they are.
2020-07-27 08:07:46 +01:00
Cory Benfield e12def54da Add docs and license 2020-07-16 16:34:38 +01:00
Cory Benfield fa8c1e771c Initial commit 2020-06-19 17:17:12 +01:00