Skip to content

0.7.0 Sendable structs

Compare
Choose a tag to compare
@swhitty swhitty released this 17 Apr 22:45
· 8 commits to main since this release

Convert the top level types KeyValueEncoder and KeyValueDecoder from class to struct so they can easily become Sendable without adding a lock. #11

UserInfo now requires any Sendable values preventing any non sendable values from crossing currency domains:

var userInfo: [CodingUserInfoKey: any Sendable]

While these are API breaking changes the fixit is easy to convert let decoder to var decoder where required. Fixing the userInfo is possible with an @unchecked Sendable box, but this API is rarely used anyway.