1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use crate::provider::calendar::*;
use icu_calendar::any_calendar::AnyCalendarKind;
use icu_calendar::chinese::Chinese;
use icu_calendar::roc::Roc;
use icu_calendar::AnyCalendar;
use icu_calendar::{
    buddhist::Buddhist, coptic::Coptic, dangi::Dangi, ethiopian::Ethiopian, hebrew::Hebrew,
    indian::Indian, islamic::IslamicCivil, islamic::IslamicObservational, islamic::IslamicTabular,
    islamic::IslamicUmmAlQura, japanese::Japanese, japanese::JapaneseExtended, persian::Persian,
    Gregorian,
};
use icu_locid::extensions::unicode::{value, Value};
use icu_provider::prelude::*;
use tinystr::{tinystr, TinyAsciiStr};

#[cfg(any(feature = "datagen", feature = "experimental"))]
use crate::provider::neo::*;
#[cfg(feature = "experimental")]
use core::marker::PhantomData;
#[cfg(any(feature = "datagen", feature = "experimental"))]
use icu_provider::NeverMarker;

/// The `CldrCalendar` trait is sealed except when the `"experimental"` Cargo
/// feature is enabled. If implementing `CldrCalendar`, you must also
/// implement `UnstableCldrCalendar` and acknowledge the stability policy.
///
/// <div class="stab unstable">
/// 🚧 This trait is considered unstable; it may change at any time, in breaking or non-breaking ways,
/// including in SemVer minor releases. Do not implement this trait in userland.
/// </div>
// Exported as `#[cfg(feature = "experimental")]` in lib.rs
// TODO(#4338): Decide what to do with this when we retire this crate's "experimental" feature.
pub trait InternalCldrCalendar {}

/// A calendar that can be found in CLDR
///
/// New implementors of this trait will likely also wish to modify `get_era_code_map()`
/// in the CLDR transformer to support any new era maps.
///
/// <div class="stab unstable">
/// 🚧 This trait is considered unstable; it may change at any time, in breaking or non-breaking ways,
/// including in SemVer minor releases. Do not implement this trait in userland.
/// </div>
pub trait CldrCalendar: InternalCldrCalendar {
    /// The Unicode BCP 47 identifier for the calendar's skeleton
    /// If multiple BCP 47 identifiers work, this should be
    /// the default one when no others are provided
    ///
    /// If `is_identifier_allowed_for_calendar()` is set, this only is used for loading skeletons data
    const DEFAULT_BCP_47_IDENTIFIER: Value;

    /// The data marker for loading symbols for this calendar.
    type DateSymbolsV1Marker: KeyedDataMarker<Yokeable = DateSymbolsV1<'static>>;

    /// The data marker for loading length-patterns for this calendar.
    type DateLengthsV1Marker: KeyedDataMarker<Yokeable = DateLengthsV1<'static>>;

    #[cfg(any(feature = "datagen", feature = "experimental"))]
    /// The data marker for loading year symbols for this calendar.
    type YearNamesV1Marker: KeyedDataMarker<Yokeable = YearNamesV1<'static>>;

    #[cfg(any(feature = "datagen", feature = "experimental"))]
    /// The data marker for loading month symbols for this calendar.
    type MonthNamesV1Marker: KeyedDataMarker<Yokeable = MonthNamesV1<'static>>;

    #[cfg(any(feature = "datagen", feature = "experimental"))]
    /// The data marker for loading a single date pattern for this calendar.
    type DatePatternV1Marker: KeyedDataMarker<Yokeable = DatePatternV1<'static>>;

    #[cfg(any(feature = "datagen", feature = "experimental"))]
    /// The data marker for loading skeleton patterns for this calendar.
    type SkeletaV1Marker: KeyedDataMarker<Yokeable = PackedSkeletonDataV1<'static>>;

    /// Checks if a given BCP 47 identifier is allowed to be used with this calendar
    ///
    /// By default, just checks against DEFAULT_BCP_47_IDENTIFIER
    fn is_identifier_allowed_for_calendar(value: &Value) -> bool {
        *value == Self::DEFAULT_BCP_47_IDENTIFIER
    }
}

/// Check if the provided value is of the form `islamic-{subcal}`
fn is_islamic_subcal(value: &Value, subcal: TinyAsciiStr<8>) -> bool {
    if let &[first, second] = value.as_tinystr_slice() {
        first == "islamic" && second == subcal
    } else {
        false
    }
}

/// A calendar that can never exist.
///
/// Used as a substitute for calendar parameters when a calendar is not needed,
/// such as in a time formatter.
#[derive(Debug)]
#[allow(clippy::exhaustive_enums)] // empty enum
#[cfg(any(feature = "datagen", feature = "experimental"))]
pub enum NeverCalendar {}

#[cfg(any(feature = "datagen", feature = "experimental"))]
impl CldrCalendar for NeverCalendar {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("never");
    type DateSymbolsV1Marker = NeverMarker<DateSymbolsV1<'static>>;
    type DateLengthsV1Marker = NeverMarker<DateLengthsV1<'static>>;
    type YearNamesV1Marker = NeverMarker<YearNamesV1<'static>>;
    type MonthNamesV1Marker = NeverMarker<MonthNamesV1<'static>>;
    type DatePatternV1Marker = NeverMarker<DatePatternV1<'static>>;
    type SkeletaV1Marker = NeverMarker<PackedSkeletonDataV1<'static>>;
}

impl CldrCalendar for Buddhist {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("buddhist");
    type DateSymbolsV1Marker = BuddhistDateSymbolsV1Marker;
    type DateLengthsV1Marker = BuddhistDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = BuddhistYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = BuddhistMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = BuddhistDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = BuddhistDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Chinese {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("chinese");
    type DateSymbolsV1Marker = ChineseDateSymbolsV1Marker;
    type DateLengthsV1Marker = ChineseDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = ChineseYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = ChineseMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = ChineseDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = ChineseDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Coptic {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("coptic");
    type DateSymbolsV1Marker = CopticDateSymbolsV1Marker;
    type DateLengthsV1Marker = CopticDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = CopticYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = CopticMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = CopticDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = CopticDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Dangi {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("dangi");
    type DateSymbolsV1Marker = DangiDateSymbolsV1Marker;
    type DateLengthsV1Marker = DangiDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = DangiYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = DangiMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = DangiDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = DangiDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Ethiopian {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("ethiopic");
    type DateSymbolsV1Marker = EthiopianDateSymbolsV1Marker;
    type DateLengthsV1Marker = EthiopianDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = EthiopianYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = EthiopianMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = EthiopianDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = EthiopianDateNeoSkeletonPatternsV1Marker;
    fn is_identifier_allowed_for_calendar(value: &Value) -> bool {
        *value == value!("ethiopic") || *value == value!("ethioaa")
    }
}

impl CldrCalendar for Gregorian {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("gregory");
    type DateSymbolsV1Marker = GregorianDateSymbolsV1Marker;
    type DateLengthsV1Marker = GregorianDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = GregorianYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = GregorianMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = GregorianDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = GregorianDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Hebrew {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("hebrew");
    type DateSymbolsV1Marker = HebrewDateSymbolsV1Marker;
    type DateLengthsV1Marker = HebrewDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = HebrewYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = HebrewMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = HebrewDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = HebrewDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Indian {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("indian");
    type DateSymbolsV1Marker = IndianDateSymbolsV1Marker;
    type DateLengthsV1Marker = IndianDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = IndianYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = IndianMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = IndianDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = IndianDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for IslamicCivil {
    // this value is not actually a valid identifier for this calendar,
    // however since we are overriding is_identifier_allowed_for_calendar we are using
    // this solely for its effects on skeleton data loading
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("islamic");
    type DateSymbolsV1Marker = IslamicDateSymbolsV1Marker;
    type DateLengthsV1Marker = IslamicDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = IslamicYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = IslamicMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = IslamicDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = IslamicDateNeoSkeletonPatternsV1Marker;
    fn is_identifier_allowed_for_calendar(value: &Value) -> bool {
        *value == value!("islamicc") || is_islamic_subcal(value, tinystr!(8, "civil"))
    }
}

impl CldrCalendar for IslamicObservational {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("islamic");
    type DateSymbolsV1Marker = IslamicDateSymbolsV1Marker;
    type DateLengthsV1Marker = IslamicDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = IslamicYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = IslamicMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = IslamicDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = IslamicDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for IslamicTabular {
    // this value is not actually a valid identifier for this calendar,
    // however since we are overriding is_identifier_allowed_for_calendar we are using
    // this solely for its effects on skeleton data loading
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("islamic");
    type DateSymbolsV1Marker = IslamicDateSymbolsV1Marker;
    type DateLengthsV1Marker = IslamicDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = IslamicYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = IslamicMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = IslamicDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = IslamicDateNeoSkeletonPatternsV1Marker;
    fn is_identifier_allowed_for_calendar(value: &Value) -> bool {
        is_islamic_subcal(value, tinystr!(8, "tbla"))
    }
}

impl CldrCalendar for IslamicUmmAlQura {
    // this value is not actually a valid identifier for this calendar,
    // however since we are overriding is_identifier_allowed_for_calendar we are using
    // this solely for its effects on skeleton data loading
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("islamic");
    type DateSymbolsV1Marker = IslamicDateSymbolsV1Marker;
    type DateLengthsV1Marker = IslamicDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = IslamicYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = IslamicMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = IslamicDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = IslamicDateNeoSkeletonPatternsV1Marker;
    fn is_identifier_allowed_for_calendar(value: &Value) -> bool {
        is_islamic_subcal(value, tinystr!(8, "umalqura"))
    }
}

impl CldrCalendar for Japanese {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("japanese");
    type DateSymbolsV1Marker = JapaneseDateSymbolsV1Marker;
    type DateLengthsV1Marker = JapaneseDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = JapaneseYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = JapaneseMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = JapaneseDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = JapaneseDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for JapaneseExtended {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("japanext");
    type DateSymbolsV1Marker = JapaneseExtendedDateSymbolsV1Marker;
    type DateLengthsV1Marker = JapaneseExtendedDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = JapaneseExtendedYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = JapaneseExtendedMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = JapaneseExtendedDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = JapaneseExtendedDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Persian {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("persian");
    type DateSymbolsV1Marker = PersianDateSymbolsV1Marker;
    type DateLengthsV1Marker = PersianDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = PersianYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = PersianMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = PersianDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = PersianDateNeoSkeletonPatternsV1Marker;
}

impl CldrCalendar for Roc {
    const DEFAULT_BCP_47_IDENTIFIER: Value = value!("roc");
    type DateSymbolsV1Marker = RocDateSymbolsV1Marker;
    type DateLengthsV1Marker = RocDateLengthsV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type YearNamesV1Marker = RocYearNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type MonthNamesV1Marker = RocMonthNamesV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type DatePatternV1Marker = RocDatePatternV1Marker;
    #[cfg(any(feature = "datagen", feature = "experimental"))]
    type SkeletaV1Marker = RocDateNeoSkeletonPatternsV1Marker;
}

#[cfg(any(feature = "datagen", feature = "experimental"))]
impl InternalCldrCalendar for NeverCalendar {}
impl InternalCldrCalendar for Buddhist {}
impl InternalCldrCalendar for Chinese {}
impl InternalCldrCalendar for Coptic {}
impl InternalCldrCalendar for Dangi {}
impl InternalCldrCalendar for Ethiopian {}
impl InternalCldrCalendar for Gregorian {}
impl InternalCldrCalendar for Hebrew {}
impl InternalCldrCalendar for Indian {}
impl InternalCldrCalendar for IslamicCivil {}
impl InternalCldrCalendar for IslamicObservational {}
impl InternalCldrCalendar for IslamicTabular {}
impl InternalCldrCalendar for IslamicUmmAlQura {}
impl InternalCldrCalendar for Japanese {}
impl InternalCldrCalendar for JapaneseExtended {}
impl InternalCldrCalendar for Persian {}
impl InternalCldrCalendar for Roc {}

pub(crate) fn load_lengths_for_cldr_calendar<C, P>(
    provider: &P,
    locale: &DataLocale,
) -> Result<DataPayload<ErasedDateLengthsV1Marker>, DataError>
where
    C: CldrCalendar,
    P: DataProvider<<C as CldrCalendar>::DateLengthsV1Marker> + ?Sized,
{
    let payload = provider
        .load(DataRequest {
            locale,
            metadata: Default::default(),
        })?
        .take_payload()?;
    Ok(payload.cast())
}

pub(crate) fn load_symbols_for_cldr_calendar<C, P>(
    provider: &P,
    locale: &DataLocale,
) -> Result<DataPayload<ErasedDateSymbolsV1Marker>, DataError>
where
    C: CldrCalendar,
    P: DataProvider<<C as CldrCalendar>::DateSymbolsV1Marker> + ?Sized,
{
    let payload = provider
        .load(DataRequest {
            locale,
            metadata: Default::default(),
        })?
        .take_payload()?;
    Ok(payload.cast())
}

pub(crate) fn load_lengths_for_any_calendar_kind<P>(
    provider: &P,
    locale: &DataLocale,
    kind: AnyCalendarKind,
) -> Result<DataPayload<ErasedDateLengthsV1Marker>, DataError>
where
    P: DataProvider<BuddhistDateLengthsV1Marker>
        + DataProvider<ChineseDateLengthsV1Marker>
        + DataProvider<CopticDateLengthsV1Marker>
        + DataProvider<DangiDateLengthsV1Marker>
        + DataProvider<EthiopianDateLengthsV1Marker>
        + DataProvider<GregorianDateLengthsV1Marker>
        + DataProvider<HebrewDateLengthsV1Marker>
        + DataProvider<IndianDateLengthsV1Marker>
        + DataProvider<IslamicDateLengthsV1Marker>
        + DataProvider<JapaneseDateLengthsV1Marker>
        + DataProvider<JapaneseExtendedDateLengthsV1Marker>
        + DataProvider<PersianDateLengthsV1Marker>
        + DataProvider<RocDateLengthsV1Marker>
        + ?Sized,
{
    let req = DataRequest {
        locale,
        metadata: Default::default(),
    };
    let payload = match kind {
        AnyCalendarKind::Buddhist => {
            DataProvider::<<Buddhist as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Chinese => {
            DataProvider::<<Chinese as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Coptic => {
            DataProvider::<<Coptic as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Dangi => {
            DataProvider::<<Dangi as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Ethiopian => {
            DataProvider::<<Ethiopian as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::EthiopianAmeteAlem => {
            DataProvider::<<Ethiopian as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Gregorian => {
            DataProvider::<<Gregorian as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Hebrew => {
            DataProvider::<<Hebrew as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Indian => {
            DataProvider::<<Indian as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::IslamicCivil => DataProvider::<
            <IslamicCivil as CldrCalendar>::DateLengthsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::IslamicObservational => DataProvider::<
            <IslamicObservational as CldrCalendar>::DateLengthsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::IslamicTabular => DataProvider::<
            <IslamicTabular as CldrCalendar>::DateLengthsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::IslamicUmmAlQura => DataProvider::<
            <IslamicUmmAlQura as CldrCalendar>::DateLengthsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::Japanese => {
            DataProvider::<<Japanese as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::JapaneseExtended => DataProvider::<
            <JapaneseExtended as CldrCalendar>::DateLengthsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::Persian => {
            DataProvider::<<Persian as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Roc => {
            DataProvider::<<Roc as CldrCalendar>::DateLengthsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        _ => {
            return Err(
                DataError::custom("Don't know how to load data for specified calendar")
                    .with_debug_context(&kind),
            )
        }
    };
    Ok(payload)
}

pub(crate) fn load_symbols_for_any_calendar_kind<P>(
    provider: &P,
    locale: &DataLocale,
    kind: AnyCalendarKind,
) -> Result<DataPayload<ErasedDateSymbolsV1Marker>, DataError>
where
    P: DataProvider<BuddhistDateSymbolsV1Marker>
        + DataProvider<ChineseDateSymbolsV1Marker>
        + DataProvider<CopticDateSymbolsV1Marker>
        + DataProvider<DangiDateSymbolsV1Marker>
        + DataProvider<EthiopianDateSymbolsV1Marker>
        + DataProvider<GregorianDateSymbolsV1Marker>
        + DataProvider<HebrewDateSymbolsV1Marker>
        + DataProvider<IndianDateSymbolsV1Marker>
        + DataProvider<IslamicDateSymbolsV1Marker>
        + DataProvider<JapaneseDateSymbolsV1Marker>
        + DataProvider<JapaneseExtendedDateSymbolsV1Marker>
        + DataProvider<PersianDateSymbolsV1Marker>
        + DataProvider<RocDateSymbolsV1Marker>
        + ?Sized,
{
    let req = DataRequest {
        locale,
        metadata: Default::default(),
    };
    let payload = match kind {
        AnyCalendarKind::Buddhist => {
            DataProvider::<<Buddhist as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Chinese => {
            DataProvider::<<Chinese as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Coptic => {
            DataProvider::<<Coptic as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Dangi => {
            DataProvider::<<Dangi as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Ethiopian => {
            DataProvider::<<Ethiopian as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::EthiopianAmeteAlem => {
            DataProvider::<<Ethiopian as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Gregorian => {
            DataProvider::<<Gregorian as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Hebrew => {
            DataProvider::<<Hebrew as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Indian => {
            DataProvider::<<Indian as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::IslamicCivil => DataProvider::<
            <IslamicCivil as CldrCalendar>::DateSymbolsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::IslamicObservational => DataProvider::<
            <IslamicObservational as CldrCalendar>::DateSymbolsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::IslamicTabular => DataProvider::<
            <IslamicTabular as CldrCalendar>::DateSymbolsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::IslamicUmmAlQura => DataProvider::<
            <IslamicUmmAlQura as CldrCalendar>::DateSymbolsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::Japanese => {
            DataProvider::<<Japanese as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::JapaneseExtended => DataProvider::<
            <JapaneseExtended as CldrCalendar>::DateSymbolsV1Marker,
        >::load(provider, req)?
        .take_payload()?
        .cast(),
        AnyCalendarKind::Persian => {
            DataProvider::<<Persian as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        AnyCalendarKind::Roc => {
            DataProvider::<<Roc as CldrCalendar>::DateSymbolsV1Marker>::load(provider, req)?
                .take_payload()?
                .cast()
        }
        _ => {
            return Err(
                DataError::custom("Don't know how to load data for specified calendar")
                    .with_debug_context(&kind),
            )
        }
    };
    Ok(payload)
}

#[cfg(any(feature = "datagen", feature = "experimental"))]
mod private {
    pub trait Sealed {}
}

/// A collection of marker types associated with all calendars.
///
/// This is used to group together the calendar-specific marker types that produce a common
/// [`DataMarker`]. For example, this trait can be implemented for [`YearNamesV1Marker`].
///
/// This trait serves as a building block for a cross-calendar [`BoundDataProvider`].
#[cfg(any(feature = "datagen", feature = "experimental"))]
pub trait CalMarkers<M>: private::Sealed
where
    M: DataMarker,
{
    /// The type for a [`Buddhist`] calendar
    type Buddhist: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Chinese`] calendar
    type Chinese: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Coptic`] calendar
    type Coptic: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Dangi`] calendar
    type Dangi: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for an [`Ethiopian`] calendar, with Amete Mihret era
    type Ethiopian: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for an [`Ethiopian`] calendar, with Amete Alem era
    type EthiopianAmeteAlem: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Gregorian`] calendar
    type Gregorian: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Hebrew`] calendar
    type Hebrew: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Indian`] calendar
    type Indian: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for an [`IslamicCivil`] calendar
    type IslamicCivil: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for an [`IslamicObservational`] calendar
    type IslamicObservational: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for an [`IslamicTabular`] calendar
    type IslamicTabular: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for an [`IslamicUmmAlQura`] calendar
    type IslamicUmmAlQura: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Japanese`] calendar
    type Japanese: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`JapaneseExtended`] calendar
    type JapaneseExtended: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Persian`] calendar
    type Persian: KeyedDataMarker<Yokeable = M::Yokeable>;
    /// The type for a [`Roc`] calendar
    type Roc: KeyedDataMarker<Yokeable = M::Yokeable>;
}

/// Implementation of [`CalMarkers`] that includes data for all calendars.
#[derive(Debug)]
#[cfg(any(feature = "datagen", feature = "experimental"))]
#[allow(clippy::exhaustive_enums)] // empty enum
pub enum FullDataCalMarkers {}

#[cfg(any(feature = "datagen", feature = "experimental"))]
impl private::Sealed for FullDataCalMarkers {}

/// Implementation of [`CalMarkers`] that includes data for no calendars.
#[derive(Debug)]
#[cfg(any(feature = "datagen", feature = "experimental"))]
#[allow(clippy::exhaustive_enums)] // empty enum
pub enum NoDataCalMarkers {}

#[cfg(any(feature = "datagen", feature = "experimental"))]
impl private::Sealed for NoDataCalMarkers {}

#[cfg(any(feature = "datagen", feature = "experimental"))]
impl<M> CalMarkers<M> for NoDataCalMarkers
where
    M: DataMarker,
{
    type Buddhist = NeverMarker<M::Yokeable>;
    type Chinese = NeverMarker<M::Yokeable>;
    type Coptic = NeverMarker<M::Yokeable>;
    type Dangi = NeverMarker<M::Yokeable>;
    type Ethiopian = NeverMarker<M::Yokeable>;
    type EthiopianAmeteAlem = NeverMarker<M::Yokeable>;
    type Gregorian = NeverMarker<M::Yokeable>;
    type Hebrew = NeverMarker<M::Yokeable>;
    type Indian = NeverMarker<M::Yokeable>;
    type IslamicCivil = NeverMarker<M::Yokeable>;
    type IslamicObservational = NeverMarker<M::Yokeable>;
    type IslamicTabular = NeverMarker<M::Yokeable>;
    type IslamicUmmAlQura = NeverMarker<M::Yokeable>;
    type Japanese = NeverMarker<M::Yokeable>;
    type JapaneseExtended = NeverMarker<M::Yokeable>;
    type Persian = NeverMarker<M::Yokeable>;
    type Roc = NeverMarker<M::Yokeable>;
}

#[cfg(feature = "experimental")]
pub(crate) struct AnyCalendarProvider<H, P> {
    provider: P,
    kind: AnyCalendarKind,
    _helper: PhantomData<H>,
}

#[cfg(feature = "experimental")]
impl<H, P> AnyCalendarProvider<H, P> {
    pub(crate) fn new(provider: P, kind: AnyCalendarKind) -> Self {
        Self {
            provider,
            kind,
            _helper: PhantomData,
        }
    }
}

#[cfg(feature = "experimental")]
impl<M, H, P> BoundDataProvider<M> for AnyCalendarProvider<H, P>
where
    M: DataMarker,
    H: CalMarkers<M>,
    P: Sized
        + DataProvider<H::Buddhist>
        + DataProvider<H::Chinese>
        + DataProvider<H::Coptic>
        + DataProvider<H::Dangi>
        + DataProvider<H::Ethiopian>
        + DataProvider<H::EthiopianAmeteAlem>
        + DataProvider<H::Gregorian>
        + DataProvider<H::Hebrew>
        + DataProvider<H::Indian>
        + DataProvider<H::IslamicCivil>
        + DataProvider<H::IslamicObservational>
        + DataProvider<H::IslamicTabular>
        + DataProvider<H::IslamicUmmAlQura>
        + DataProvider<H::Japanese>
        + DataProvider<H::JapaneseExtended>
        + DataProvider<H::Persian>
        + DataProvider<H::Roc>,
{
    fn load_bound(&self, req: DataRequest) -> Result<DataResponse<M>, DataError> {
        use AnyCalendarKind::*;
        let p = &self.provider;
        match self.kind {
            Buddhist => H::Buddhist::bind(p).load_bound(req),
            Chinese => H::Chinese::bind(p).load_bound(req),
            Coptic => H::Coptic::bind(p).load_bound(req),
            Dangi => H::Dangi::bind(p).load_bound(req),
            Ethiopian => H::Ethiopian::bind(p).load_bound(req),
            EthiopianAmeteAlem => H::EthiopianAmeteAlem::bind(p).load_bound(req),
            Gregorian => H::Gregorian::bind(p).load_bound(req),
            Hebrew => H::Hebrew::bind(p).load_bound(req),
            Indian => H::Indian::bind(p).load_bound(req),
            IslamicCivil => H::IslamicCivil::bind(p).load_bound(req),
            IslamicObservational => H::IslamicObservational::bind(p).load_bound(req),
            IslamicTabular => H::IslamicTabular::bind(p).load_bound(req),
            IslamicUmmAlQura => H::IslamicUmmAlQura::bind(p).load_bound(req),
            Japanese => H::Japanese::bind(p).load_bound(req),
            JapaneseExtended => H::JapaneseExtended::bind(p).load_bound(req),
            Persian => H::Persian::bind(p).load_bound(req),
            Roc => H::Roc::bind(p).load_bound(req),
            _ => Err(
                DataError::custom("Don't know how to load data for specified calendar")
                    .with_debug_context(&self.kind),
            ),
        }
    }
    fn bound_key(&self) -> DataKey {
        use AnyCalendarKind::*;
        match self.kind {
            Buddhist => H::Buddhist::KEY,
            Chinese => H::Chinese::KEY,
            Coptic => H::Coptic::KEY,
            Dangi => H::Dangi::KEY,
            Ethiopian => H::Ethiopian::KEY,
            EthiopianAmeteAlem => H::EthiopianAmeteAlem::KEY,
            Gregorian => H::Gregorian::KEY,
            Hebrew => H::Hebrew::KEY,
            Indian => H::Indian::KEY,
            IslamicCivil => H::IslamicCivil::KEY,
            IslamicObservational => H::IslamicObservational::KEY,
            IslamicTabular => H::IslamicTabular::KEY,
            IslamicUmmAlQura => H::IslamicUmmAlQura::KEY,
            Japanese => H::Japanese::KEY,
            JapaneseExtended => H::JapaneseExtended::KEY,
            Persian => H::Persian::KEY,
            Roc => H::Roc::KEY,
            _ => NeverMarker::<M::Yokeable>::KEY,
        }
    }
}

#[cfg(any(feature = "datagen", feature = "experimental"))]
macro_rules! impl_load_any_calendar {
    ([$(($erased:ident, $marker:ident)),+], [$($kind_cal:ident),+], [$($kind:ident => $cal:ident),+]) => {
        impl_load_any_calendar!(@expand [$(($erased, $marker)),+], [$($kind_cal),+], [$($kind => $cal),+]);
    };
    (@expand [$(($erased:ident, $marker:ident)),+], $tail1:tt, $tail2:tt) => {
        $(impl_load_any_calendar!(@single_impl $erased, $marker, $tail1, $tail2);)+
    };
    (@single_impl $erased:ident, $marker:ident, [$($kind_cal:ident),+], [$($kind:ident => $cal:ident),+]) => {
        impl CalMarkers<$erased> for FullDataCalMarkers {
            $(
                type $kind_cal = <$kind_cal as CldrCalendar>::$marker;
            )+
            $(
                type $kind = <$cal as CldrCalendar>::$marker;
            )+
        }
    };
}

#[cfg(any(feature = "datagen", feature = "experimental"))]
impl_load_any_calendar!([
    (DatePatternV1Marker, DatePatternV1Marker),
    (YearNamesV1Marker, YearNamesV1Marker),
    (MonthNamesV1Marker, MonthNamesV1Marker),
    (SkeletaV1Marker, SkeletaV1Marker)
], [
    Buddhist,
    Chinese,
    Coptic,
    Dangi,
    Ethiopian,
    Gregorian,
    Hebrew,
    Indian,
    IslamicCivil,
    IslamicObservational,
    IslamicTabular,
    IslamicUmmAlQura,
    Japanese,
    JapaneseExtended,
    Persian,
    Roc
], [
    EthiopianAmeteAlem => Ethiopian
]);

/// Converts a date to the correct calendar if necessary
///
/// Returns `Err` if the date is not ISO or compatible with the current calendar, returns `Ok(None)`
/// if the date is compatible with the current calendar and doesn't need conversion
pub(crate) fn convert_if_necessary<'a>(
    any_calendar: &'a AnyCalendar,
    value: &impl crate::input::DateInput<Calendar = AnyCalendar>,
) -> Result<
    Option<icu_calendar::Date<icu_calendar::Ref<'a, AnyCalendar>>>,
    crate::MismatchedCalendarError,
> {
    let this_kind = any_calendar.kind();
    let date_kind = value.any_calendar_kind();

    if Some(this_kind) != date_kind {
        if date_kind != Some(AnyCalendarKind::Iso) {
            return Err(crate::MismatchedCalendarError {
                this_kind,
                date_kind,
            });
        }
        let date = value.to_iso().to_any();
        let converted = any_calendar.convert_any_date(&date);
        Ok(Some(converted))
    } else {
        Ok(None)
    }
}

/// Converts a date to the correct calendar if necessary
///
/// Returns `Err` if the date is not ISO or compatible with the current calendar, returns `Ok(None)`
/// if the date is compatible with the current calendar and doesn't need conversion
pub(crate) fn convert_datetime_if_necessary<'a>(
    any_calendar: &'a AnyCalendar,
    value: &impl crate::input::DateTimeInput<Calendar = AnyCalendar>,
) -> Result<
    Option<icu_calendar::DateTime<icu_calendar::Ref<'a, AnyCalendar>>>,
    crate::MismatchedCalendarError,
> {
    let this_kind = any_calendar.kind();
    let date_kind = value.any_calendar_kind();

    if Some(this_kind) != date_kind {
        if date_kind != Some(AnyCalendarKind::Iso) {
            return Err(crate::MismatchedCalendarError {
                this_kind,
                date_kind,
            });
        }
        let date = value.to_iso();
        let time = icu_calendar::Time::new(
            value.hour().unwrap_or_default(),
            value.minute().unwrap_or_default(),
            value.second().unwrap_or_default(),
            value.nanosecond().unwrap_or_default(),
        );
        let datetime = icu_calendar::DateTime::new(date, time).to_any();
        let converted = any_calendar.convert_any_datetime(&datetime);
        Ok(Some(converted))
    } else {
        Ok(None)
    }
}