Closed robertbastian closed 3 weeks ago
Hmm, how do I load all AnyCalendar
data upfront?
Just put in the bounds like usual:
We do this in the DateTimeFormatter constructors, too (they are at the end of the list):
Oh, since it is cross-crate, you will also need the AnyCalendarLoader
thing.
Oh, but you don't know the calendar until parsing time. Hmm.
Easy way out is to pass the AnyCalendar provider into the parse function, but that's annoying.
Maybe you can save a closure that calls the AnyCalendar constructor as a field of the parser? You'd need to put a lifetime on the parser object, I think.
Or you could eagerly load all the markers into payloads and then make your own internal DataProvider that reads those payloads when calling AnyCalendar::try_new_unstable
. Hmm. Maybe we want that to be a type in the icu_calendar
crate, since it seems kind-of silly that AnyCalendar::new
might need to load the same payload over and over, and you can't save it between loads.
Based on #5735