You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to implement the version of the DateTime FFI described in #5940 (comment), I need to add a field set getter on DateTimeFormatter.
Most of the information required to implement this getter is already retained in the DateTimeFormatter: there is a RawOptions field in most of the variants of DateTimeZonePatternSelectionData.
However, we don't currently retain the FSet itself. This is primarily an issue for dynamic field sets; for example, one cannot reconstruct a DateFieldSet::YMD from a DateTimeFormatter<DateFieldSet> that was constructed with a YMD field set.
A couple of directions here:
(probably what I will end up doing) Save the date fields in the DateTimeFormatter data model somewhere, maybe adding them to the RawOptions struct. I will cross my fingers that there are enough niches that maybe this doesn't have any cost.
(theoretically possible) Infer the date fields from the pattern data payload.
(seems unnecessarily complex and has side-effects) Add the date fields to the body of the data struct, costing ~1 byte per payload.
I think the easiest would be for the function to return a CompositeFieldSet. I could also work to make it return FSet.
This issue might also include doing something I've wanted to do for a while: flatten the internal DateTimeZonePatternSelectionData enum into a struct, which will reduce code complexity without adversely affecting anything I can think of.
The text was updated successfully, but these errors were encountered:
In order to implement the version of the DateTime FFI described in #5940 (comment), I need to add a field set getter on DateTimeFormatter.
Most of the information required to implement this getter is already retained in the DateTimeFormatter: there is a
RawOptions
field in most of the variants ofDateTimeZonePatternSelectionData
.However, we don't currently retain the
FSet
itself. This is primarily an issue for dynamic field sets; for example, one cannot reconstruct aDateFieldSet::YMD
from aDateTimeFormatter<DateFieldSet>
that was constructed with aYMD
field set.A couple of directions here:
RawOptions
struct. I will cross my fingers that there are enough niches that maybe this doesn't have any cost.I think the easiest would be for the function to return a
CompositeFieldSet
. I could also work to make it returnFSet
.This issue might also include doing something I've wanted to do for a while: flatten the internal
DateTimeZonePatternSelectionData
enum into a struct, which will reduce code complexity without adversely affecting anything I can think of.The text was updated successfully, but these errors were encountered: