rfc:tagged_unions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:tagged_unions [2023/01/18 18:40] – crell | rfc:tagged_unions [2024/07/16 14:12] (current) – crell | ||
---|---|---|---|
Line 118: | Line 118: | ||
(I really have had to do something like that before.) | (I really have had to do something like that before.) | ||
+ | |||
+ | === MongoDB Driver === | ||
+ | |||
+ | The MongoDB team has reached out to us with another example of what they would like to be able to do in their driver. | ||
+ | |||
+ | Their planned code is below, for reference. | ||
+ | |||
+ | <code php> | ||
+ | enum ReadPreference | ||
+ | { | ||
+ | case Primary; | ||
+ | case Secondary(? | ||
+ | case PrimaryPreferred(? | ||
+ | case SecondaryPreferred(? | ||
+ | case Nearest(? | ||
+ | | ||
+ | static function withTagSets(? | ||
+ | static function withMaxStaleness(? | ||
+ | } | ||
+ | |||
+ | enum ReadConcern | ||
+ | { | ||
+ | case Available; | ||
+ | case Linearizable; | ||
+ | case Local; | ||
+ | case Majority; | ||
+ | case Snapshot(? | ||
+ | } | ||
+ | |||
+ | enum WriteConcern | ||
+ | { | ||
+ | case Majority(? | ||
+ | case Unacknowledged; | ||
+ | case Acknowledged(int $servers = 1, ?int $timeout = null); | ||
+ | | ||
+ | static function withTimeout(? | ||
+ | } | ||
+ | </ | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== |
rfc/tagged_unions.1674067257.txt.gz · Last modified: 2023/01/18 18:40 by crell