Commit Graph
6 Commits
Author SHA1 Message Date
Cory Benfield 101dec0a99 Introduce StructuredHeaderField protocol.
Motivation:

We had a proliferation of decode/encode methods that required users to
tell us how to encode their structured header field. This is a bit
annoying for two reasons: firstly, it requires users to encode this
piece of information separately from their header field; secondly, it
makes it very hard to offer a generic interface to load something as a
structured header field!

Modifications:

- Add a new StructuredHeaderField protocol that refines Codable and
  expresses what type of header field is used.
- Remove the fancy encode/decode methods.

Result:

Simpler interfaces.
2020-07-24 17:44:06 +01:00
Cory Benfield 3f73125a0d Apply formatting 2020-07-17 10:06:44 +01:00
Cory Benfield 141f102bd0 Support Decimal as well 2020-07-16 17:28:47 +01:00
Cory Benfield e12def54da Add docs and license 2020-07-16 16:34:38 +01:00
Cory Benfield b797a6ff50 Add support for encoding/decoding binary data 2020-07-16 13:16:20 +01:00
Cory Benfield 5aaca631da Split Codable to its own module 2020-07-16 11:22:30 +01:00