From c323a9e60f1f07f565bf1e8567056cebff730d62 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 12:04:36 -0700 Subject: [PATCH 01/21] wip --- components/datetime/benches/datetime.rs | 4 +- components/datetime/src/neo_marker.rs | 22 +- components/datetime/tests/datetime.rs | 22 +- components/datetime/tests/simple_test.rs | 4 +- components/icu/examples/tui.rs | 4 +- components/timezone/README.md | 15 +- components/timezone/src/ixdtf.rs | 131 +++++----- components/timezone/src/lib.rs | 25 +- components/timezone/src/time_zone.rs | 233 ++---------------- components/timezone/src/zoned_datetime.rs | 4 +- ffi/capi/bindings/c/CustomTimeZone.h | 14 -- .../bindings/cpp/icu4x/CustomTimeZone.d.hpp | 16 -- .../bindings/cpp/icu4x/CustomTimeZone.hpp | 44 ---- ffi/capi/bindings/dart/CustomTimeZone.g.dart | 82 +----- .../bindings/demo_gen/CustomTimeZone.d.ts | 5 +- ffi/capi/bindings/demo_gen/CustomTimeZone.mjs | 20 +- .../GregorianZonedDateTimeFormatter.d.ts | 2 +- .../GregorianZonedDateTimeFormatter.mjs | 3 +- .../demo_gen/ZonedDateTimeFormatter.d.ts | 4 +- .../demo_gen/ZonedDateTimeFormatter.mjs | 6 +- ffi/capi/bindings/demo_gen/index.mjs | 39 --- ffi/capi/bindings/js/CustomTimeZone.d.ts | 13 - ffi/capi/bindings/js/CustomTimeZone.mjs | 60 ----- ffi/capi/src/timezone.rs | 92 +------ tutorials/cpp/datetime.cpp | 24 +- 25 files changed, 146 insertions(+), 742 deletions(-) diff --git a/components/datetime/benches/datetime.rs b/components/datetime/benches/datetime.rs index febe3daf03d..b4c3515cde2 100644 --- a/components/datetime/benches/datetime.rs +++ b/components/datetime/benches/datetime.rs @@ -9,7 +9,7 @@ use icu_datetime::neo::TypedNeoFormatter; use icu_calendar::{DateTime, Gregorian}; use icu_locale_core::Locale; -use icu_timezone::{CustomTimeZone, CustomZonedDateTime}; +use icu_timezone::{CustomZonedDateTime, TimeZoneInfo}; use writeable::TryWriteable; #[path = "../tests/mock.rs"] @@ -35,7 +35,7 @@ fn datetime_benches(c: &mut Criterion) { date, time, // zone is unused but we need to make the types match - zone: CustomTimeZone::utc(), + zone: TimeZoneInfo::utc(), } } }) diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 1fb3c6b9062..c98778f43f5 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -353,7 +353,7 @@ use icu_calendar::{ }; use icu_provider::{marker::NeverMarker, prelude::*}; use icu_timezone::{ - CustomTimeZone, CustomZonedDateTime, MetazoneId, TimeZoneBcp47Id, UtcOffset, ZoneVariant, + CustomZonedDateTime, MetazoneId, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant, }; // TODO: Figure out where to export these traits @@ -413,8 +413,8 @@ impl> ConvertCalendar for Custom } } -impl ConvertCalendar for CustomTimeZone { - type Converted<'a> = CustomTimeZone; +impl ConvertCalendar for TimeZoneInfo { + type Converted<'a> = TimeZoneInfo; #[inline] fn to_calendar<'a>(&self, _: &'a AnyCalendar) -> Self::Converted<'a> { *self @@ -466,7 +466,7 @@ impl> IsInCalendar for DateTime { impl> IsInCalendar for CustomZonedDateTime {} -impl IsInCalendar for CustomTimeZone {} +impl IsInCalendar for TimeZoneInfo {} /// A type that can return a certain field `T`. pub trait GetField { @@ -758,7 +758,7 @@ impl> GetField Option> { - self.zone.metazone_id + None } } @@ -771,28 +771,28 @@ impl> GetField> } } -impl GetField> for CustomTimeZone { +impl GetField> for TimeZoneInfo { #[inline] fn get_field(&self) -> Option { self.offset } } -impl GetField> for CustomTimeZone { +impl GetField> for TimeZoneInfo { #[inline] fn get_field(&self) -> Option { Some(self.time_zone_id) } } -impl GetField>> for CustomTimeZone { +impl GetField>> for TimeZoneInfo { #[inline] fn get_field(&self) -> Option> { - self.metazone_id + None } } -impl GetField> for CustomTimeZone { +impl GetField> for TimeZoneInfo { #[inline] fn get_field(&self) -> Option { self.zone_variant @@ -832,7 +832,7 @@ impl> GetField for CustomZo } } -impl GetField for CustomTimeZone { +impl GetField for TimeZoneInfo { #[inline] fn get_field(&self) -> NeverField { NeverField diff --git a/components/datetime/tests/datetime.rs b/components/datetime/tests/datetime.rs index 42b5df3f3f2..2abe71be122 100644 --- a/components/datetime/tests/datetime.rs +++ b/components/datetime/tests/datetime.rs @@ -38,7 +38,7 @@ use icu_locale_core::{ locale, LanguageIdentifier, Locale, }; use icu_provider::prelude::*; -use icu_timezone::{CustomTimeZone, CustomZonedDateTime, UtcOffset}; +use icu_timezone::{CustomZonedDateTime, TimeZoneIdMapper, TimeZoneInfo, UtcOffset}; use patterns::{ dayperiods::{DayPeriodExpectation, DayPeriodTests}, time_zones::{TimeZoneExpectation, TimeZoneFormatterConfig, TimeZoneTests}, @@ -281,23 +281,23 @@ fn assert_fixture_element( let input_value = CustomZonedDateTime { date: input_value.date.clone(), time: input_value.time, - zone: CustomTimeZone::utc(), + zone: TimeZoneInfo::utc(), }; let input_iso = CustomZonedDateTime { date: input_iso.date, time: input_iso.time, - zone: CustomTimeZone::utc(), + zone: TimeZoneInfo::utc(), }; let any_input = CustomZonedDateTime { date: input_value.date.to_any(), time: input_value.time, - zone: CustomTimeZone::utc(), + zone: TimeZoneInfo::utc(), }; let iso_any_input = CustomZonedDateTime { date: input_iso.date.to_any(), time: input_iso.time, - zone: CustomTimeZone::utc(), + zone: TimeZoneInfo::utc(), }; let dtf = @@ -473,7 +473,10 @@ fn test_time_zone_format_configs() { fn test_time_zone_format_offset_seconds() { use icu_datetime::{neo_marker::NeoTimeZoneOffsetMarker, neo_skeleton::NeoSkeletonLength}; - let time_zone = CustomTimeZone::new_with_offset(UtcOffset::try_from_seconds(12).unwrap()); + let time_zone = TimeZoneInfo { + offset: UtcOffset::try_from_seconds(12).ok(), + ..TimeZoneInfo::unknown() + }; let tzf = TypedNeoFormatter::<(), _>::try_new( &locale!("en").into(), NeoTimeZoneOffsetMarker::with_length(NeoSkeletonLength::Medium), @@ -488,7 +491,12 @@ fn test_time_zone_format_offset_not_set_debug_assert_panic() { neo_marker::NeoTimeZoneOffsetMarker, neo_skeleton::NeoSkeletonLength, DateTimeWriteError, }; - let time_zone = CustomTimeZone::from_str("America/Los_Angeles"); + let time_zone = TimeZoneInfo { + time_zone_id: TimeZoneIdMapper::new() + .as_borrowed() + .iana_to_bcp47("America/Los_Angeles"), + ..TimeZoneInfo::unknown() + }; let tzf = TypedNeoFormatter::<(), _>::try_new( &locale!("en").into(), NeoTimeZoneOffsetMarker::with_length(NeoSkeletonLength::Medium), diff --git a/components/datetime/tests/simple_test.rs b/components/datetime/tests/simple_test.rs index 5a6ffaa3ffa..c1da8c7c13f 100644 --- a/components/datetime/tests/simple_test.rs +++ b/components/datetime/tests/simple_test.rs @@ -12,7 +12,7 @@ use icu_datetime::neo_skeleton::{ }; use icu_datetime::options::length; use icu_locale_core::{locale, Locale}; -use icu_timezone::{CustomTimeZone, CustomZonedDateTime}; +use icu_timezone::{CustomZonedDateTime, TimeZoneInfo}; use writeable::assert_try_writeable_eq; const EXPECTED_DATETIME: &[&str] = &[ @@ -140,7 +140,7 @@ fn overlap_patterns() { let datetime = CustomZonedDateTime { date: Date::try_new_gregorian_date(2024, 8, 9).unwrap(), time: Time::try_new(20, 40, 7, 250).unwrap(), - zone: CustomTimeZone::utc(), + zone: TimeZoneInfo::utc(), }; struct TestCase { locale: Locale, diff --git a/components/icu/examples/tui.rs b/components/icu/examples/tui.rs index bca8278ca6a..a2547bfdcd5 100644 --- a/components/icu/examples/tui.rs +++ b/components/icu/examples/tui.rs @@ -8,7 +8,7 @@ use icu::calendar::{Date, Gregorian, Time}; use icu::locale::locale; use icu::plurals::{PluralCategory, PluralRules}; -use icu::timezone::CustomTimeZone; +use icu::timezone::TimeZoneInfo; use icu_collections::codepointinvlist::CodePointInversionListBuilder; use icu_datetime::neo::TypedNeoFormatter; use icu_datetime::neo_marker::NeoYearMonthDayHourMinuteSecondTimeZoneGenericShortMarker; @@ -52,7 +52,7 @@ fn main() { .expect("Failed to create zoned datetime formatter."); let date = Date::try_new_gregorian_date(2020, 10, 10).unwrap(); let time = Time::try_new(18, 56, 0, 0).unwrap(); - let zone = CustomTimeZone::utc(); + let zone = TimeZoneInfo::utc(); let formatted_dt = dtf.format(&CustomZonedDateTime { date, time, zone }); diff --git a/components/timezone/README.md b/components/timezone/README.md index 322ad9a8617..d88d38563b7 100644 --- a/components/timezone/README.md +++ b/components/timezone/README.md @@ -6,7 +6,7 @@ Types for resolving and manipulating time zones. ## Fields -In ICU4X, a [formattable time zone](CustomTimeZone) consists of four different fields: +In ICU4X, a [formattable time zone](TimeZoneInfo) consists of four different fields: 1. The offset from UTC 2. The time zone ID @@ -66,7 +66,7 @@ variants to specific observed offsets varies from time zone to time zone, and th consistently represent winter versus summer time. Note: It is optional (not required) to set the zone variant when constructing a -[`CustomTimeZone`]. Therefore, the list of possible variants does not include a generic variant +[`TimeZoneInfo`]. Therefore, the list of possible variants does not include a generic variant to represent the lack of a preference. ## Calculations @@ -86,7 +86,7 @@ the metazone based on a certain local datetime: ```rust use icu::calendar::DateTime; -use icu::timezone::CustomTimeZone; +use icu::timezone::TimeZoneInfo; use icu::timezone::UtcOffset; use icu::timezone::MetazoneCalculator; use icu::timezone::TimeZoneBcp47Id; @@ -94,20 +94,13 @@ use icu::timezone::TimeZoneIdMapper; use tinystr::{tinystr, TinyAsciiStr}; // Create a time zone for America/Chicago at UTC-6: -let mut time_zone = CustomTimeZone::new_with_offset("-0600".parse().unwrap()); +let mut time_zone = TimeZoneInfo::new_with_offset("-0600".parse().unwrap()); let mapper = TimeZoneIdMapper::new(); time_zone.time_zone_id = mapper.as_borrowed().iana_to_bcp47("America/Chicago"); // Alternatively, set it directly from the BCP-47 ID assert_eq!(time_zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); - -// Compute the metazone at January 1, 2022: -let mzc = MetazoneCalculator::new(); -let datetime = DateTime::try_new_iso_datetime(2022, 1, 1, 0, 0, 0).unwrap(); -time_zone.maybe_calculate_metazone(&mzc, &datetime); - -assert_eq!("amce", time_zone.metazone_id.unwrap().unwrap().0.as_str()); ``` diff --git a/components/timezone/src/ixdtf.rs b/components/timezone/src/ixdtf.rs index 9fd2f150e61..a1d08f1fdad 100644 --- a/components/timezone/src/ixdtf.rs +++ b/components/timezone/src/ixdtf.rs @@ -2,12 +2,9 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -use crate::{ - CustomTimeZone, CustomZonedDateTime, InvalidOffsetError, MetazoneCalculator, TimeZoneIdMapper, - UtcOffset, ZoneOffsetCalculator, -}; +use crate::{CustomZonedDateTime, InvalidOffsetError, TimeZoneIdMapper, TimeZoneInfo, UtcOffset}; use alloc::str::FromStr; -use icu_calendar::{AnyCalendar, Date, DateError, DateTime, Iso, RangeError, Time}; +use icu_calendar::{AnyCalendar, Date, DateError, Iso, RangeError, Time}; use ixdtf::{ parsers::{ records::{DateRecord, IxdtfParseRecord, TimeRecord, TimeZoneRecord, UTCOffsetRecord}, @@ -76,9 +73,9 @@ impl UtcOffset { } } -// ==== CustomTimeZone methods and traits ==== +// ==== TimeZoneInfo methods and traits ==== -impl CustomTimeZone { +impl TimeZoneInfo { fn try_from_ixdtf_record(ixdtf_record: &IxdtfParseRecord) -> Result { match ixdtf_record { IxdtfParseRecord { @@ -113,9 +110,12 @@ impl CustomTimeZone { } fn try_from_utc_offset_record(record: &UTCOffsetRecord) -> Result { - Ok(Self::new_with_offset( - UtcOffset::try_from_utc_offset_record(record)?, - )) + Ok(Self { + time_zone_id: crate::TimeZoneBcp47Id::unknown(), + offset: Some(UtcOffset::try_from_utc_offset_record(record)?), + zone_variant: None, + local_time: None, + }) } fn try_from_time_zone_record( @@ -129,26 +129,23 @@ impl CustomTimeZone { let mapper = TimeZoneIdMapper::new(); let time_zone_id = mapper.as_borrowed().iana_bytes_to_bcp47(iana_identifier); - let mut tz = Self { + Ok(Self { time_zone_id, offset, - metazone_id: None, zone_variant: None, - }; - - if let (Some(date), Some(time)) = (date, time) { - let iso = DateTime::::try_new_iso_datetime( - date.year, - date.month, - date.day, - time.hour, - time.minute, - time.second, - )?; - tz.maybe_calculate_metazone(&MetazoneCalculator::new(), &iso); - tz.maybe_calculate_zone_variant(&ZoneOffsetCalculator::new(), &iso); - }; - Ok(tz) + local_time: if let Some(date) = date { + if let Some(time) = time { + Some(( + Date::::try_new_iso_date(date.year, date.month, date.day)?, + Time::try_new(time.hour, time.minute, time.second, 0)?, + )) + } else { + None + } + } else { + None + }, + }) } TimeZoneRecord::Offset(offset_record) => { let tz = Self::try_from_utc_offset_record(offset_record)?; @@ -170,7 +167,7 @@ impl CustomZonedDateTime { /// ✨ *Enabled with the `compiled_data` and `ixdtf` Cargo features.* /// /// ``` - /// use icu_timezone::{CustomZonedDateTime, CustomTimeZone, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; + /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id}; /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// @@ -187,13 +184,10 @@ impl CustomZonedDateTime { /// assert_eq!(zoneddatetime.time.minute.number(), 8); /// assert_eq!(zoneddatetime.time.second.number(), 19); /// assert_eq!(zoneddatetime.time.nanosecond.number(), 0); - /// assert_eq!(zoneddatetime.zone, CustomTimeZone { - /// offset: Some(UtcOffset::try_from_seconds(-18000).unwrap()), - /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), - /// metazone_id: Some(Some(MetazoneId(tinystr!(4, "amce")))), - /// zone_variant: Some(ZoneVariant::daylight()), - /// }); - /// + /// assert_eq!(zoneddatetime.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); + /// assert_eq!(zoneddatetime.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(zoneddatetime.zone.zone_variant, None); + /// assert!(zoneddatetime.zone.local_time.is_some()); /// ``` /// /// For more information on date, time, and time zone parsing, @@ -222,7 +216,7 @@ impl CustomZonedDateTime { time_record.second, time_record.nanosecond, )?; - let time_zone = CustomTimeZone::try_from_ixdtf_record(ixdtf_record)?; + let time_zone = TimeZoneInfo::try_from_ixdtf_record(ixdtf_record)?; Ok(Self { date, @@ -256,7 +250,7 @@ impl CustomZonedDateTime { /// Basic usage: /// /// ``` - /// use icu_timezone::{CustomZonedDateTime, CustomTimeZone, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; + /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id}; /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// @@ -273,12 +267,10 @@ impl CustomZonedDateTime { /// assert_eq!(zoneddatetime.time.minute.number(), 8); /// assert_eq!(zoneddatetime.time.second.number(), 19); /// assert_eq!(zoneddatetime.time.nanosecond.number(), 0); - /// assert_eq!(zoneddatetime.zone, CustomTimeZone { - /// offset: Some(UtcOffset::try_from_seconds(-18000).unwrap()), - /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), - /// metazone_id: Some(Some(MetazoneId(tinystr!(4, "amce")))), - /// zone_variant: Some(ZoneVariant::daylight()), - /// }); + /// assert_eq!(zoneddatetime.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); + /// assert_eq!(zoneddatetime.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(zoneddatetime.zone.zone_variant, None); + /// assert!(zoneddatetime.zone.local_time.is_some()); /// ``` /// /// An IXDTF string can provide a time zone in two parts: the DateTime UTC Offset or the Time Zone @@ -292,11 +284,11 @@ impl CustomZonedDateTime { /// DateTime string. /// /// ``` - /// use icu_timezone::{CustomTimeZone, CustomZonedDateTime, UtcOffset}; + /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset}; /// /// let tz_from_offset = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00").unwrap(); /// - /// assert_eq!(tz_from_offset.zone, CustomTimeZone::new_with_offset(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(tz_from_offset.zone.offset, UtcOffset::try_from_seconds(-18000).ok()); /// ``` /// /// ## Time Zone Annotations @@ -304,21 +296,19 @@ impl CustomZonedDateTime { /// Below is an example of a time zone being provided by a time zone annotation. /// /// ``` - /// use icu_timezone::{CustomTimeZone, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; + /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// /// let tz_from_offset_annotation = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19[-05:00]").unwrap(); /// let tz_from_iana_annotation = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19[America/Chicago]").unwrap(); /// - /// assert_eq!(tz_from_offset_annotation.zone, CustomTimeZone::new_with_offset(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(tz_from_offset_annotation.zone.offset, UtcOffset::try_from_seconds(-18000).ok()); /// - /// assert_eq!(tz_from_iana_annotation.zone, CustomTimeZone { - /// offset: None, - /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), - /// metazone_id: Some(Some(MetazoneId(tinystr!(4, "amce")))), - /// zone_variant: None, - /// }); + /// assert_eq!(tz_from_iana_annotation.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); + /// assert_eq!(tz_from_iana_annotation.zone.offset, None); + /// assert_eq!(tz_from_iana_annotation.zone.zone_variant, None); + /// assert!(tz_from_iana_annotation.zone.local_time.is_some()); /// ``` /// /// ## DateTime UTC Offset and Time Zone Annotations. @@ -332,27 +322,24 @@ impl CustomZonedDateTime { /// verifying internal consistency. /// /// ``` - /// use icu_timezone::{CustomTimeZone, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; + /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// /// let consistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Chicago]").unwrap(); /// - /// assert_eq!(consistent_tz_from_both.zone, CustomTimeZone { - /// offset: Some(UtcOffset::try_from_seconds(-18000).unwrap()), - /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), - /// metazone_id: Some(Some(MetazoneId(tinystr!(4, "amce")))), - /// zone_variant: Some(ZoneVariant::daylight()), - /// }); + /// + /// assert_eq!(consistent_tz_from_both.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); + /// assert_eq!(consistent_tz_from_both.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(consistent_tz_from_both.zone.zone_variant, None); + /// assert!(consistent_tz_from_both.zone.local_time.is_some()); /// /// let inconsistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Los_Angeles]").unwrap(); /// - /// assert_eq!(inconsistent_tz_from_both.zone, CustomTimeZone { - /// offset: Some(UtcOffset::try_from_seconds(-18000).unwrap()), - /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uslax")), - /// metazone_id: Some(Some(MetazoneId(tinystr!(4, "ampa")))), - /// zone_variant: None, - /// }); + /// assert_eq!(inconsistent_tz_from_both.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uslax"))); + /// assert_eq!(inconsistent_tz_from_both.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(inconsistent_tz_from_both.zone.zone_variant, None); + /// assert!(inconsistent_tz_from_both.zone.local_time.is_some()); /// ``` /// /// ### DateTime UTC offset with UTC Offset annotation. @@ -360,12 +347,12 @@ impl CustomZonedDateTime { /// These annotations must always be consistent as they should be either the same value or are inconsistent. /// /// ``` - /// use icu_timezone::{ParseError, CustomTimeZone, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; + /// use icu_timezone::{ParseError, TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; /// use tinystr::tinystr; /// /// let consistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[-05:00]").unwrap(); /// - /// assert_eq!(consistent_tz_from_both.zone, CustomTimeZone::new_with_offset(UtcOffset::try_from_seconds(-18000).unwrap())); + /// assert_eq!(consistent_tz_from_both.zone.offset, UtcOffset::try_from_seconds(-18000).ok()); /// /// /// let inconsistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[+05:00]"); @@ -416,7 +403,7 @@ impl FromStr for CustomZonedDateTime { mod test { use ixdtf::parsers::IxdtfParser; - use crate::{CustomTimeZone, ParseError, UtcOffset}; + use crate::{ParseError, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset}; #[test] fn max_possible_ixdtf_utc_offset() { @@ -433,7 +420,9 @@ mod test { let ixdtf_record = IxdtfParser::from_utf8("2024-08-08T12:08:19[Future/Zone]".as_bytes()) .parse() .unwrap(); - let result = CustomTimeZone::try_from_ixdtf_record(&ixdtf_record).unwrap(); - assert_eq!(result, CustomTimeZone::unknown()); + let result = TimeZoneInfo::try_from_ixdtf_record(&ixdtf_record).unwrap(); + assert_eq!(result.time_zone_id, TimeZoneBcp47Id::unknown()); + assert_eq!(result.offset, None); + assert_eq!(result.zone_variant, None); } } diff --git a/components/timezone/src/lib.rs b/components/timezone/src/lib.rs index d3795b237d5..8985ceb8e3f 100644 --- a/components/timezone/src/lib.rs +++ b/components/timezone/src/lib.rs @@ -6,7 +6,7 @@ //! //! # Fields //! -//! In ICU4X, a [formattable time zone](CustomTimeZone) consists of four different fields: +//! In ICU4X, a [formattable time zone](TimeZoneInfo) consists of four different fields: //! //! 1. The offset from UTC //! 2. The time zone ID @@ -66,7 +66,7 @@ //! consistently represent winter versus summer time. //! //! Note: It is optional (not required) to set the zone variant when constructing a -//! [`CustomTimeZone`]. Therefore, the list of possible variants does not include a generic variant +//! [`TimeZoneInfo`]. Therefore, the list of possible variants does not include a generic variant //! to represent the lack of a preference. //! //! # Calculations @@ -86,28 +86,23 @@ //! //! ``` //! use icu::calendar::DateTime; -//! use icu::timezone::CustomTimeZone; +//! use icu::timezone::TimeZoneInfo; //! use icu::timezone::UtcOffset; //! use icu::timezone::MetazoneCalculator; //! use icu::timezone::TimeZoneBcp47Id; //! use icu::timezone::TimeZoneIdMapper; //! use tinystr::{tinystr, TinyAsciiStr}; //! -//! // Create a time zone for America/Chicago at UTC-6: -//! let mut time_zone = CustomTimeZone::new_with_offset("-0600".parse().unwrap()); //! let mapper = TimeZoneIdMapper::new(); -//! time_zone.time_zone_id = -//! mapper.as_borrowed().iana_to_bcp47("America/Chicago"); +//! // Create a time zone for America/Chicago at UTC-6: +//! let mut time_zone = TimeZoneInfo { +//! time_zone_id: mapper.as_borrowed().iana_to_bcp47("America/Chicago"), +//! offset: Some("-0600".parse().unwrap()), +//! ..TimeZoneInfo::unknown() +//! }; //! //! // Alternatively, set it directly from the BCP-47 ID //! assert_eq!(time_zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); -//! -//! // Compute the metazone at January 1, 2022: -//! let mzc = MetazoneCalculator::new(); -//! let datetime = DateTime::try_new_iso_datetime(2022, 1, 1, 0, 0, 0).unwrap(); -//! time_zone.maybe_calculate_metazone(&mzc, &datetime); -//! -//! assert_eq!("amce", time_zone.metazone_id.unwrap().unwrap().0.as_str()); //! ``` // https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations @@ -148,7 +143,7 @@ pub use ids::{ }; pub use metazone::MetazoneCalculator; pub use provider::{MetazoneId, TimeZoneBcp47Id}; -pub use time_zone::CustomTimeZone; +pub use time_zone::TimeZoneInfo; pub use types::{UtcOffset, ZoneVariant}; pub use windows_tz::{WindowsTimeZoneMapper, WindowsTimeZoneMapperBorrowed}; pub use zone_offset::ZoneOffsetCalculator; diff --git a/components/timezone/src/time_zone.rs b/components/timezone/src/time_zone.rs index 4324e83a863..a975725db8a 100644 --- a/components/timezone/src/time_zone.rs +++ b/components/timezone/src/time_zone.rs @@ -2,243 +2,46 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -#[cfg(feature = "compiled_data")] -use crate::TimeZoneIdMapper; -use crate::{ - MetazoneCalculator, MetazoneId, TimeZoneBcp47Id, UtcOffset, ZoneOffsetCalculator, ZoneVariant, -}; -use icu_calendar::{DateTime, Iso}; -use tinystr::TinyAsciiStr; +use crate::{TimeZoneBcp47Id, UtcOffset, ZoneVariant}; +use icu_calendar::{Date, Iso, Time}; /// A utility type that can hold time zone information. -/// -/// The UTC offset is used as a final fallback for formatting. The other three fields are used -/// for more human-friendly rendering of the time zone. -/// -/// This type does not enforce that the four fields are consistent with each other. If they do not -/// represent a real time zone, unexpected results when formatting may occur. -/// -/// # Examples -/// -/// ``` -/// use icu::timezone::CustomTimeZone; -/// -/// let tz1 = CustomTimeZone::utc(); -/// -/// let tz2: CustomTimeZone = -/// "+05:00".parse().expect("Failed to parse a time zone."); -/// ``` #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[allow(clippy::exhaustive_structs)] // these four fields fully cover the needs of UTS 35 -pub struct CustomTimeZone { - /// The UTC offset. - pub offset: Option, - /// The BCP47 time-zone identifier +pub struct TimeZoneInfo { + /// The BCP47 time-zone identifier. pub time_zone_id: TimeZoneBcp47Id, - /// The CLDR metazone identifier + /// The UTC offset, if known. /// - /// This is `Some(None)` if the metazone has been resolved, but the time zone does not - /// have a metazone. - pub metazone_id: Option>, - /// The time variant e.g. daylight or standard + /// This field is not enforced to be consistent with the time zone id. + pub offset: Option, + /// The time variant e.g. daylight or standard, if known. pub zone_variant: Option, + /// The time at which to interpret the time zone. + /// + /// This can be set in order to get correct historical time zone names. + /// If it's not set, the most recent data for the time zone will be used. + pub local_time: Option<(Date, Time)>, } -impl CustomTimeZone { - /// Creates a new [`CustomTimeZone`] with the given UTC offset. - pub const fn new_with_offset(offset: UtcOffset) -> Self { - Self { - offset: Some(offset), - time_zone_id: TimeZoneBcp47Id::unknown(), - metazone_id: None, - zone_variant: None, - } - } - - /// Creates a new [`CustomTimeZone`] with a given BCP47 time zone identifier. - pub const fn new_with_bcp47_id(time_zone_id: TimeZoneBcp47Id) -> Self { - Self { - offset: None, - time_zone_id, - metazone_id: None, - zone_variant: None, - } - } - - /// Creates a time zone with no information. - /// - /// One or more fields must be specified before this time zone is usable. +impl TimeZoneInfo { + /// Creates a time zone info with no information. pub const fn unknown() -> Self { Self { offset: None, time_zone_id: TimeZoneBcp47Id::unknown(), - metazone_id: Some(None), zone_variant: None, + local_time: None, } } - /// Creates a time zone infallibly from raw parts. - pub const fn from_parts( - offset_eighths_of_hour: i8, - time_zone_id: TinyAsciiStr<8>, - metazone_id: TinyAsciiStr<4>, - zone_variant: TinyAsciiStr<2>, - ) -> Self { - Self { - offset: Some(UtcOffset::from_eighths_of_hour(offset_eighths_of_hour)), - time_zone_id: TimeZoneBcp47Id(time_zone_id), - metazone_id: Some(Some(MetazoneId(metazone_id))), - zone_variant: Some(ZoneVariant(zone_variant)), - } - } - - /// Creates a new [`CustomTimeZone`] for the UTC time zone. + /// Creates a new [`TimeZoneInfo`] for the UTC time zone. pub const fn utc() -> Self { Self { offset: Some(UtcOffset::zero()), time_zone_id: TimeZoneBcp47Id(tinystr::tinystr!(8, "utc")), - metazone_id: Some(Some(MetazoneId(tinystr::tinystr!(4, "utc")))), zone_variant: Some(ZoneVariant::standard()), + local_time: None, } } - - /// Parse a [`CustomTimeZone`] from a UTF-8 string representing a UTC offset - /// or an IANA time zone identifier. - /// - /// This is a convenience constructor that uses compiled data. For a custom data provider, - /// use [`UtcOffset`] or [`TimeZoneIdMapper`] directly. - /// - /// To parse from an IXDTF string, use [`CustomZonedDateTime::try_iso_from_str`]. - /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* - /// - /// # Examples - /// - /// ``` - /// use icu::timezone::CustomTimeZone; - /// use icu::timezone::UtcOffset; - /// - /// let tz0: CustomTimeZone = CustomTimeZone::from_str("Z"); - /// let tz1: CustomTimeZone = CustomTimeZone::from_str("+02"); - /// let tz2: CustomTimeZone = CustomTimeZone::from_str("-0230"); - /// let tz3: CustomTimeZone = CustomTimeZone::from_str("+02:30"); - /// - /// assert_eq!(tz0.offset.map(UtcOffset::to_seconds), Some(0)); - /// assert_eq!(tz1.offset.map(UtcOffset::to_seconds), Some(7200)); - /// assert_eq!(tz2.offset.map(UtcOffset::to_seconds), Some(-9000)); - /// assert_eq!(tz3.offset.map(UtcOffset::to_seconds), Some(9000)); - /// ``` - /// - /// [`CustomZonedDateTime::try_iso_from_str`]: crate::CustomZonedDateTime::try_iso_from_str - #[cfg(feature = "compiled_data")] - #[inline] - #[allow(clippy::should_implement_trait)] // does implement trait - pub fn from_str(s: &str) -> Self { - Self::from_utf8(s.as_bytes()) - } - - /// See [`Self::from_str`] - #[cfg(feature = "compiled_data")] - pub fn from_utf8(code_units: &[u8]) -> Self { - if let Ok(offset) = UtcOffset::try_from_utf8(code_units) { - return Self { - offset: Some(offset), - time_zone_id: TimeZoneBcp47Id::unknown(), - metazone_id: None, - zone_variant: None, - }; - } - let mapper = TimeZoneIdMapper::new(); - Self { - offset: None, - time_zone_id: mapper.as_borrowed().iana_bytes_to_bcp47(code_units), - metazone_id: None, - zone_variant: None, - } - } - - /// Infer the metazone ID. - /// - /// # Examples - /// - /// ``` - /// use icu::calendar::DateTime; - /// use icu::timezone::MetazoneId; - /// use icu::timezone::TimeZoneBcp47Id; - /// use icu::timezone::CustomTimeZone; - /// use icu::timezone::MetazoneCalculator; - /// use tinystr::tinystr; - /// - /// let mzc = MetazoneCalculator::new(); - /// let mut tz = CustomTimeZone::new_with_bcp47_id(TimeZoneBcp47Id(tinystr!(8, "gugum"))); - /// tz.maybe_calculate_metazone( - /// &mzc, - /// &DateTime::try_new_iso_datetime(1971, 10, 31, 2, 0, 0).unwrap(), - /// ); - /// assert_eq!(tz.metazone_id.unwrap(), Some(MetazoneId(tinystr!(4, "guam")))); - /// ``` - pub fn maybe_calculate_metazone( - &mut self, - metazone_calculator: &MetazoneCalculator, - local_datetime: &DateTime, - ) -> &mut Self { - self.metazone_id = Some( - metazone_calculator.compute_metazone_from_time_zone(self.time_zone_id, local_datetime), - ); - self - } - - /// Infer the zone variant. - /// - /// # Examples - /// - /// ``` - /// use icu::calendar::DateTime; - /// use icu::timezone::ZoneVariant; - /// use icu::timezone::TimeZoneBcp47Id; - /// use icu::timezone::CustomTimeZone; - /// use icu::timezone::ZoneOffsetCalculator; - /// use tinystr::tinystr; - /// - /// let zoc = ZoneOffsetCalculator::new(); - /// let mut tz = CustomTimeZone { - /// offset: Some("+10".parse().expect("Failed to parse a UTC offset.")), - /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "gugum")), - /// metazone_id: None, - /// zone_variant: None, - /// }; - /// tz.maybe_calculate_zone_variant( - /// &zoc, - /// &DateTime::try_new_iso_datetime(1971, 10, 31, 2, 0, 0).unwrap(), - /// ); - /// assert_eq!(tz.zone_variant, Some(ZoneVariant::standard())); - /// ``` - pub fn maybe_calculate_zone_variant( - &mut self, - zone_offset_calculator: &ZoneOffsetCalculator, - local_datetime: &DateTime, - ) -> &mut Self { - if let Some(offset) = self.offset { - if let Some((std, dst)) = zone_offset_calculator - .compute_offsets_from_time_zone(self.time_zone_id, local_datetime) - { - if offset == std { - self.zone_variant = Some(ZoneVariant::standard()); - } else if Some(offset) == dst { - self.zone_variant = Some(ZoneVariant::daylight()); - } - } - } - self - } -} - -#[cfg(feature = "compiled_data")] -impl core::str::FromStr for CustomTimeZone { - type Err = core::convert::Infallible; - - #[inline] - fn from_str(s: &str) -> Result { - Ok(Self::from_str(s)) - } } diff --git a/components/timezone/src/zoned_datetime.rs b/components/timezone/src/zoned_datetime.rs index 136e0de364e..b96518398c6 100644 --- a/components/timezone/src/zoned_datetime.rs +++ b/components/timezone/src/zoned_datetime.rs @@ -4,7 +4,7 @@ use icu_calendar::{AsCalendar, Date, Iso, Time}; -use crate::CustomTimeZone; +use crate::TimeZoneInfo; /// A date and time local to a specified custom time zone. #[derive(Debug)] @@ -15,7 +15,7 @@ pub struct CustomZonedDateTime { /// The time, local to the time zone pub time: Time, /// The time zone - pub zone: CustomTimeZone, + pub zone: TimeZoneInfo, } impl CustomZonedDateTime { diff --git a/ffi/capi/bindings/c/CustomTimeZone.h b/ffi/capi/bindings/c/CustomTimeZone.h index 8f8476b2e6f..da3a164e24a 100644 --- a/ffi/capi/bindings/c/CustomTimeZone.h +++ b/ffi/capi/bindings/c/CustomTimeZone.h @@ -7,10 +7,7 @@ #include #include "diplomat_runtime.h" -#include "IsoDateTime.d.h" -#include "MetazoneCalculator.d.h" #include "TimeZoneIdMapper.d.h" -#include "ZoneOffsetCalculator.d.h" #include "CustomTimeZone.d.h" @@ -19,8 +16,6 @@ -CustomTimeZone* icu4x_CustomTimeZone_from_string_mv1(DiplomatStringView s); - CustomTimeZone* icu4x_CustomTimeZone_unknown_mv1(void); CustomTimeZone* icu4x_CustomTimeZone_utc_mv1(void); @@ -59,11 +54,6 @@ void icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(CustomTimeZone* self, const void icu4x_CustomTimeZone_time_zone_id_mv1(const CustomTimeZone* self, DiplomatWrite* write); -void icu4x_CustomTimeZone_set_metazone_id_mv1(CustomTimeZone* self, DiplomatStringView id); - -typedef struct icu4x_CustomTimeZone_metazone_id_mv1_result { bool is_ok;} icu4x_CustomTimeZone_metazone_id_mv1_result; -icu4x_CustomTimeZone_metazone_id_mv1_result icu4x_CustomTimeZone_metazone_id_mv1(const CustomTimeZone* self, DiplomatWrite* write); - typedef struct icu4x_CustomTimeZone_try_set_zone_variant_mv1_result { bool is_ok;} icu4x_CustomTimeZone_try_set_zone_variant_mv1_result; icu4x_CustomTimeZone_try_set_zone_variant_mv1_result icu4x_CustomTimeZone_try_set_zone_variant_mv1(CustomTimeZone* self, DiplomatStringView id); @@ -82,10 +72,6 @@ icu4x_CustomTimeZone_is_standard_time_mv1_result icu4x_CustomTimeZone_is_standar typedef struct icu4x_CustomTimeZone_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_daylight_time_mv1_result; icu4x_CustomTimeZone_is_daylight_time_mv1_result icu4x_CustomTimeZone_is_daylight_time_mv1(const CustomTimeZone* self); -void icu4x_CustomTimeZone_maybe_calculate_metazone_mv1(CustomTimeZone* self, const MetazoneCalculator* metazone_calculator, const IsoDateTime* local_datetime); - -void icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1(CustomTimeZone* self, const ZoneOffsetCalculator* zone_offset_calculator, const IsoDateTime* local_datetime); - void icu4x_CustomTimeZone_destroy_mv1(CustomTimeZone* self); diff --git a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp b/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp index 58100214db0..014f7e80792 100644 --- a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp +++ b/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp @@ -12,14 +12,8 @@ namespace icu4x { namespace capi { struct CustomTimeZone; } class CustomTimeZone; -namespace capi { struct IsoDateTime; } -class IsoDateTime; -namespace capi { struct MetazoneCalculator; } -class MetazoneCalculator; namespace capi { struct TimeZoneIdMapper; } class TimeZoneIdMapper; -namespace capi { struct ZoneOffsetCalculator; } -class ZoneOffsetCalculator; struct TimeZoneInvalidOffsetError; } @@ -34,8 +28,6 @@ namespace icu4x { class CustomTimeZone { public: - inline static std::unique_ptr from_string(std::string_view s); - inline static std::unique_ptr unknown(); inline static std::unique_ptr utc(); @@ -66,10 +58,6 @@ class CustomTimeZone { inline std::string time_zone_id() const; - inline void set_metazone_id(std::string_view id); - - inline std::optional metazone_id() const; - inline std::optional try_set_zone_variant(std::string_view id); inline void clear_zone_variant(); @@ -84,10 +72,6 @@ class CustomTimeZone { inline std::optional is_daylight_time() const; - inline void maybe_calculate_metazone(const icu4x::MetazoneCalculator& metazone_calculator, const icu4x::IsoDateTime& local_datetime); - - inline void maybe_calculate_zone_variant(const icu4x::ZoneOffsetCalculator& zone_offset_calculator, const icu4x::IsoDateTime& local_datetime); - inline const icu4x::capi::CustomTimeZone* AsFFI() const; inline icu4x::capi::CustomTimeZone* AsFFI(); inline static const icu4x::CustomTimeZone* FromFFI(const icu4x::capi::CustomTimeZone* ptr); diff --git a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp b/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp index 39fb4c8e701..2b65ee886b2 100644 --- a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp +++ b/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp @@ -10,19 +10,14 @@ #include #include #include "../diplomat_runtime.hpp" -#include "IsoDateTime.hpp" -#include "MetazoneCalculator.hpp" #include "TimeZoneIdMapper.hpp" #include "TimeZoneInvalidOffsetError.hpp" -#include "ZoneOffsetCalculator.hpp" namespace icu4x { namespace capi { extern "C" { - icu4x::capi::CustomTimeZone* icu4x_CustomTimeZone_from_string_mv1(diplomat::capi::DiplomatStringView s); - icu4x::capi::CustomTimeZone* icu4x_CustomTimeZone_unknown_mv1(void); icu4x::capi::CustomTimeZone* icu4x_CustomTimeZone_utc_mv1(void); @@ -61,11 +56,6 @@ namespace capi { void icu4x_CustomTimeZone_time_zone_id_mv1(const icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatWrite* write); - void icu4x_CustomTimeZone_set_metazone_id_mv1(icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatStringView id); - - typedef struct icu4x_CustomTimeZone_metazone_id_mv1_result { bool is_ok;} icu4x_CustomTimeZone_metazone_id_mv1_result; - icu4x_CustomTimeZone_metazone_id_mv1_result icu4x_CustomTimeZone_metazone_id_mv1(const icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatWrite* write); - typedef struct icu4x_CustomTimeZone_try_set_zone_variant_mv1_result { bool is_ok;} icu4x_CustomTimeZone_try_set_zone_variant_mv1_result; icu4x_CustomTimeZone_try_set_zone_variant_mv1_result icu4x_CustomTimeZone_try_set_zone_variant_mv1(icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatStringView id); @@ -84,10 +74,6 @@ namespace capi { typedef struct icu4x_CustomTimeZone_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_daylight_time_mv1_result; icu4x_CustomTimeZone_is_daylight_time_mv1_result icu4x_CustomTimeZone_is_daylight_time_mv1(const icu4x::capi::CustomTimeZone* self); - void icu4x_CustomTimeZone_maybe_calculate_metazone_mv1(icu4x::capi::CustomTimeZone* self, const icu4x::capi::MetazoneCalculator* metazone_calculator, const icu4x::capi::IsoDateTime* local_datetime); - - void icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1(icu4x::capi::CustomTimeZone* self, const icu4x::capi::ZoneOffsetCalculator* zone_offset_calculator, const icu4x::capi::IsoDateTime* local_datetime); - void icu4x_CustomTimeZone_destroy_mv1(CustomTimeZone* self); @@ -95,11 +81,6 @@ namespace capi { } // namespace capi } // namespace -inline std::unique_ptr icu4x::CustomTimeZone::from_string(std::string_view s) { - auto result = icu4x::capi::icu4x_CustomTimeZone_from_string_mv1({s.data(), s.size()}); - return std::unique_ptr(icu4x::CustomTimeZone::FromFFI(result)); -} - inline std::unique_ptr icu4x::CustomTimeZone::unknown() { auto result = icu4x::capi::icu4x_CustomTimeZone_unknown_mv1(); return std::unique_ptr(icu4x::CustomTimeZone::FromFFI(result)); @@ -179,19 +160,6 @@ inline std::string icu4x::CustomTimeZone::time_zone_id() const { return output; } -inline void icu4x::CustomTimeZone::set_metazone_id(std::string_view id) { - icu4x::capi::icu4x_CustomTimeZone_set_metazone_id_mv1(this->AsFFI(), - {id.data(), id.size()}); -} - -inline std::optional icu4x::CustomTimeZone::metazone_id() const { - std::string output; - diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); - auto result = icu4x::capi::icu4x_CustomTimeZone_metazone_id_mv1(this->AsFFI(), - &write); - return result.is_ok ? std::optional(std::move(output)) : std::nullopt; -} - inline std::optional icu4x::CustomTimeZone::try_set_zone_variant(std::string_view id) { auto result = icu4x::capi::icu4x_CustomTimeZone_try_set_zone_variant_mv1(this->AsFFI(), {id.data(), id.size()}); @@ -228,18 +196,6 @@ inline std::optional icu4x::CustomTimeZone::is_daylight_time() const { return result.is_ok ? std::optional(result.ok) : std::nullopt; } -inline void icu4x::CustomTimeZone::maybe_calculate_metazone(const icu4x::MetazoneCalculator& metazone_calculator, const icu4x::IsoDateTime& local_datetime) { - icu4x::capi::icu4x_CustomTimeZone_maybe_calculate_metazone_mv1(this->AsFFI(), - metazone_calculator.AsFFI(), - local_datetime.AsFFI()); -} - -inline void icu4x::CustomTimeZone::maybe_calculate_zone_variant(const icu4x::ZoneOffsetCalculator& zone_offset_calculator, const icu4x::IsoDateTime& local_datetime) { - icu4x::capi::icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1(this->AsFFI(), - zone_offset_calculator.AsFFI(), - local_datetime.AsFFI()); -} - inline const icu4x::capi::CustomTimeZone* icu4x::CustomTimeZone::AsFFI() const { return reinterpret_cast(this); } diff --git a/ffi/capi/bindings/dart/CustomTimeZone.g.dart b/ffi/capi/bindings/dart/CustomTimeZone.g.dart index 967766c58ed..7d88f813149 100644 --- a/ffi/capi/bindings/dart/CustomTimeZone.g.dart +++ b/ffi/capi/bindings/dart/CustomTimeZone.g.dart @@ -22,19 +22,10 @@ final class CustomTimeZone implements ffi.Finalizable { static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CustomTimeZone_destroy_mv1)); - /// Creates a time zone from an offset string. - /// - /// See the [Rust documentation for `from_str`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.from_str) for more information. - factory CustomTimeZone.fromString(String s) { - final temp = _FinalizedArena(); - final result = _icu4x_CustomTimeZone_from_string_mv1(s._utf8AllocIn(temp.arena)); - return CustomTimeZone._fromFfi(result, []); - } - /// Creates a time zone with no information. /// /// See the [Rust documentation for `unknown`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.unknown) for more information. - factory CustomTimeZone.unknown() { + factory CustomTimeZone() { final result = _icu4x_CustomTimeZone_unknown_mv1(); return CustomTimeZone._fromFfi(result, []); } @@ -203,34 +194,6 @@ final class CustomTimeZone implements ffi.Finalizable { return write.finalize(); } - /// Sets the `metazone_id` field from a string. - /// - /// Returns null if the string is not a valid BCP-47 metazone ID. - /// - /// See the [Rust documentation for `metazone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id) for more information. - /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html) - void setMetazoneId(String id) { - final temp = _FinalizedArena(); - _icu4x_CustomTimeZone_set_metazone_id_mv1(_ffi, id._utf8AllocIn(temp.arena)); - } - - /// Writes the value of the `metazone_id` field as a string. - /// - /// Returns null if the `metazone_id` field is empty or unresolved. - /// - /// See the [Rust documentation for `metazone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id) for more information. - /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html) - String? get metazoneId { - final write = _Write(); - final result = _icu4x_CustomTimeZone_metazone_id_mv1(_ffi, write._ffi); - if (!result.isOk) { - return null; - } - return write.finalize(); - } - /// Sets the `zone_variant` field from a string. /// /// Returns null if the string is not a valid zone variant. @@ -318,24 +281,6 @@ final class CustomTimeZone implements ffi.Finalizable { } return result.union.ok; } - - /// Sets the metazone based on the time zone and the local timestamp. - /// - /// See the [Rust documentation for `maybe_calculate_metazone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.maybe_calculate_metazone) for more information. - /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.compute_metazone_from_time_zone) - void maybeCalculateMetazone(MetazoneCalculator metazoneCalculator, IsoDateTime localDatetime) { - _icu4x_CustomTimeZone_maybe_calculate_metazone_mv1(_ffi, metazoneCalculator._ffi, localDatetime._ffi); - } - - /// Sets the zone variant based on the time zone and the local timestamp. - /// - /// See the [Rust documentation for `maybe_calculate_zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.maybe_calculate_zone_variant) for more information. - /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneOffsetCalculator.html#method.compute_offsets_from_time_zone) - void maybeCalculateZoneVariant(ZoneOffsetCalculator zoneOffsetCalculator, IsoDateTime localDatetime) { - _icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1(_ffi, zoneOffsetCalculator._ffi, localDatetime._ffi); - } } @meta.RecordUse() @@ -343,11 +288,6 @@ final class CustomTimeZone implements ffi.Finalizable { // ignore: non_constant_identifier_names external void _icu4x_CustomTimeZone_destroy_mv1(ffi.Pointer self); -@meta.RecordUse() -@ffi.Native Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_from_string_mv1') -// ignore: non_constant_identifier_names -external ffi.Pointer _icu4x_CustomTimeZone_from_string_mv1(_SliceUtf8 s); - @meta.RecordUse() @ffi.Native Function()>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_unknown_mv1') // ignore: non_constant_identifier_names @@ -423,16 +363,6 @@ external void _icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(ffi.Pointer self, ffi.Pointer write); -@meta.RecordUse() -@ffi.Native, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_set_metazone_id_mv1') -// ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_set_metazone_id_mv1(ffi.Pointer self, _SliceUtf8 id); - -@meta.RecordUse() -@ffi.Native<_ResultVoidVoid Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_metazone_id_mv1') -// ignore: non_constant_identifier_names -external _ResultVoidVoid _icu4x_CustomTimeZone_metazone_id_mv1(ffi.Pointer self, ffi.Pointer write); - @meta.RecordUse() @ffi.Native<_ResultVoidVoid Function(ffi.Pointer, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_try_set_zone_variant_mv1') // ignore: non_constant_identifier_names @@ -467,13 +397,3 @@ external _ResultBoolVoid _icu4x_CustomTimeZone_is_standard_time_mv1(ffi.Pointer< @ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_is_daylight_time_mv1') // ignore: non_constant_identifier_names external _ResultBoolVoid _icu4x_CustomTimeZone_is_daylight_time_mv1(ffi.Pointer self); - -@meta.RecordUse() -@ffi.Native, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_maybe_calculate_metazone_mv1') -// ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_maybe_calculate_metazone_mv1(ffi.Pointer self, ffi.Pointer metazoneCalculator, ffi.Pointer localDatetime); - -@meta.RecordUse() -@ffi.Native, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1') -// ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1(ffi.Pointer self, ffi.Pointer zoneOffsetCalculator, ffi.Pointer localDatetime); diff --git a/ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts b/ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts index b8b8b23f7a7..29124e8a6f3 100644 --- a/ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts +++ b/ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts @@ -1,4 +1,3 @@ import { CustomTimeZone } from "icu4x" -export function timeZoneId(s: string); -export function metazoneId(s: string); -export function zoneVariant(s: string); +export function timeZoneId(); +export function zoneVariant(); diff --git a/ffi/capi/bindings/demo_gen/CustomTimeZone.mjs b/ffi/capi/bindings/demo_gen/CustomTimeZone.mjs index 2da8a07ab95..84c717c1ea2 100644 --- a/ffi/capi/bindings/demo_gen/CustomTimeZone.mjs +++ b/ffi/capi/bindings/demo_gen/CustomTimeZone.mjs @@ -4,24 +4,9 @@ export function timeZoneId() { return (function (...args) { return args[0].timeZoneId }).apply( null, [ - CustomTimeZone.fromString.apply( + CustomTimeZone.unknown.apply( null, [ - terminusArgs[0] - ] - ) - ] - ); -} -export function metazoneId() { - var terminusArgs = arguments; - return (function (...args) { return args[0].metazoneId }).apply( - null, - [ - CustomTimeZone.fromString.apply( - null, - [ - terminusArgs[0] ] ) ] @@ -32,10 +17,9 @@ export function zoneVariant() { return (function (...args) { return args[0].zoneVariant }).apply( null, [ - CustomTimeZone.fromString.apply( + CustomTimeZone.unknown.apply( null, [ - terminusArgs[0] ] ) ] diff --git a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts index 05087016505..86490f83f82 100644 --- a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts +++ b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts @@ -3,4 +3,4 @@ import { DataProvider } from "icu4x" import { GregorianZonedDateTimeFormatter } from "icu4x" import { IsoDateTime } from "icu4x" import { Locale } from "icu4x" -export function formatIsoDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number, s: string); +export function formatIsoDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number); diff --git a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs index 9994158cf9d..58c584a1978 100644 --- a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs +++ b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs @@ -37,10 +37,9 @@ export function formatIsoDatetimeWithCustomTimeZone() { terminusArgs[8] ] ), - CustomTimeZone.fromString.apply( + CustomTimeZone.unknown.apply( null, [ - terminusArgs[9] ] ) ] diff --git a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts index fcfdebf0046..1701acd896b 100644 --- a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts +++ b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts @@ -5,5 +5,5 @@ import { DateTime } from "icu4x" import { IsoDateTime } from "icu4x" import { Locale } from "icu4x" import { ZonedDateTimeFormatter } from "icu4x" -export function formatDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number, name: string, s: string); -export function formatIsoDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number, s: string); +export function formatDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number, name: string); +export function formatIsoDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number); diff --git a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs index 1a0fa56a68e..007819eac61 100644 --- a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs +++ b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs @@ -55,10 +55,9 @@ export function formatDatetimeWithCustomTimeZone() { ) ] ), - CustomTimeZone.fromString.apply( + CustomTimeZone.unknown.apply( null, [ - terminusArgs[10] ] ) ] @@ -98,10 +97,9 @@ export function formatIsoDatetimeWithCustomTimeZone() { terminusArgs[8] ] ), - CustomTimeZone.fromString.apply( + CustomTimeZone.unknown.apply( null, [ - terminusArgs[9] ] ) ] diff --git a/ffi/capi/bindings/demo_gen/index.mjs b/ffi/capi/bindings/demo_gen/index.mjs index 439f06d6836..20fdb1d8f27 100644 --- a/ffi/capi/bindings/demo_gen/index.mjs +++ b/ffi/capi/bindings/demo_gen/index.mjs @@ -1128,25 +1128,6 @@ let termini = Object.assign({ funcName: "CustomTimeZone.timeZoneId", parameters: [ - { - name: "S", - type: "string" - } - - ] - }, - - "CustomTimeZone.metazoneId": { - func: CustomTimeZoneDemo.metazoneId, - // For avoiding webpacking minifying issues: - funcName: "CustomTimeZone.metazoneId", - parameters: [ - - { - name: "S", - type: "string" - } - ] }, @@ -1156,11 +1137,6 @@ let termini = Object.assign({ funcName: "CustomTimeZone.zoneVariant", parameters: [ - { - name: "S", - type: "string" - } - ] }, @@ -1297,11 +1273,6 @@ let termini = Object.assign({ { name: "Nanosecond", type: "number" - }, - - { - name: "S", - type: "string" } ] @@ -1361,11 +1332,6 @@ let termini = Object.assign({ { name: "Name", type: "string" - }, - - { - name: "S", - type: "string" } ] @@ -1420,11 +1386,6 @@ let termini = Object.assign({ { name: "Nanosecond", type: "number" - }, - - { - name: "S", - type: "string" } ] diff --git a/ffi/capi/bindings/js/CustomTimeZone.d.ts b/ffi/capi/bindings/js/CustomTimeZone.d.ts index 6b670400e34..73f1e2558e1 100644 --- a/ffi/capi/bindings/js/CustomTimeZone.d.ts +++ b/ffi/capi/bindings/js/CustomTimeZone.d.ts @@ -1,9 +1,6 @@ // generated by diplomat-tool -import type { IsoDateTime } from "./IsoDateTime" -import type { MetazoneCalculator } from "./MetazoneCalculator" import type { TimeZoneIdMapper } from "./TimeZoneIdMapper" import type { TimeZoneInvalidOffsetError } from "./TimeZoneInvalidOffsetError" -import type { ZoneOffsetCalculator } from "./ZoneOffsetCalculator" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; @@ -14,8 +11,6 @@ export class CustomTimeZone { get ffiValue(): pointer; - static fromString(s: string): CustomTimeZone; - static unknown(): CustomTimeZone; static utc(): CustomTimeZone; @@ -46,10 +41,6 @@ export class CustomTimeZone { get timeZoneId(): string; - setMetazoneId(id: string): void; - - get metazoneId(): string | null; - trySetZoneVariant(id: string): boolean; clearZoneVariant(): void; @@ -63,8 +54,4 @@ export class CustomTimeZone { get isStandardTime(): boolean | null; get isDaylightTime(): boolean | null; - - maybeCalculateMetazone(metazoneCalculator: MetazoneCalculator, localDatetime: IsoDateTime): void; - - maybeCalculateZoneVariant(zoneOffsetCalculator: ZoneOffsetCalculator, localDatetime: IsoDateTime): void; } \ No newline at end of file diff --git a/ffi/capi/bindings/js/CustomTimeZone.mjs b/ffi/capi/bindings/js/CustomTimeZone.mjs index f9457e07961..4b8cd75c087 100644 --- a/ffi/capi/bindings/js/CustomTimeZone.mjs +++ b/ffi/capi/bindings/js/CustomTimeZone.mjs @@ -1,9 +1,6 @@ // generated by diplomat-tool -import { IsoDateTime } from "./IsoDateTime.mjs" -import { MetazoneCalculator } from "./MetazoneCalculator.mjs" import { TimeZoneIdMapper } from "./TimeZoneIdMapper.mjs" import { TimeZoneInvalidOffsetError } from "./TimeZoneInvalidOffsetError.mjs" -import { ZoneOffsetCalculator } from "./ZoneOffsetCalculator.mjs" import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; @@ -41,22 +38,6 @@ export class CustomTimeZone { return this.#ptr; } - static fromString(s) { - let functionCleanupArena = new diplomatRuntime.CleanupArena(); - - const sSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, s)); - - const result = wasm.icu4x_CustomTimeZone_from_string_mv1(...sSlice.splat()); - - try { - return new CustomTimeZone(diplomatRuntime.internalConstructor, result, []); - } - - finally { - functionCleanupArena.free(); - } - } - static unknown() { const result = wasm.icu4x_CustomTimeZone_unknown_mv1(); @@ -263,33 +244,6 @@ export class CustomTimeZone { } } - setMetazoneId(id) { - let functionCleanupArena = new diplomatRuntime.CleanupArena(); - - const idSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, id)); - wasm.icu4x_CustomTimeZone_set_metazone_id_mv1(this.ffiValue, ...idSlice.splat()); - - try {} - - finally { - functionCleanupArena.free(); - } - } - - get metazoneId() { - const write = new diplomatRuntime.DiplomatWriteBuf(wasm); - - const result = wasm.icu4x_CustomTimeZone_metazone_id_mv1(this.ffiValue, write.buffer); - - try { - return result === 0 ? null : write.readString8(); - } - - finally { - write.free(); - } - } - trySetZoneVariant(id) { let functionCleanupArena = new diplomatRuntime.CleanupArena(); @@ -374,18 +328,4 @@ export class CustomTimeZone { diplomatReceive.free(); } } - - maybeCalculateMetazone(metazoneCalculator, localDatetime) {wasm.icu4x_CustomTimeZone_maybe_calculate_metazone_mv1(this.ffiValue, metazoneCalculator.ffiValue, localDatetime.ffiValue); - - try {} - - finally {} - } - - maybeCalculateZoneVariant(zoneOffsetCalculator, localDatetime) {wasm.icu4x_CustomTimeZone_maybe_calculate_zone_variant_mv1(this.ffiValue, zoneOffsetCalculator.ffiValue, localDatetime.ffiValue); - - try {} - - finally {} - } } \ No newline at end of file diff --git a/ffi/capi/src/timezone.rs b/ffi/capi/src/timezone.rs index 59a7752cc34..e69a43dc151 100644 --- a/ffi/capi/src/timezone.rs +++ b/ffi/capi/src/timezone.rs @@ -14,31 +14,15 @@ pub mod ffi { #[diplomat::opaque] #[diplomat::rust_link(icu::timezone::CustomTimeZone, Struct)] - pub struct CustomTimeZone(pub icu_timezone::CustomTimeZone); + pub struct CustomTimeZone(pub icu_timezone::TimeZoneInfo); impl CustomTimeZone { - /// Creates a time zone from an offset string. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::from_str, FnInStruct)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::from_utf8, FnInStruct, hidden)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::from_parts, FnInStruct, hidden)] - #[diplomat::rust_link(icu::timezone::UtcOffset::try_from_str, FnInStruct, hidden)] - #[diplomat::rust_link(icu::timezone::UtcOffset::try_from_utf8, FnInStruct, hidden)] - #[diplomat::rust_link(icu::timezone::UtcOffset::from_str, FnInStruct, hidden)] - #[diplomat::attr(supports = fallible_constructors, named_constructor)] - #[diplomat::demo(default_constructor)] - #[cfg(feature = "compiled_data")] - pub fn from_string(s: &DiplomatStr) -> Box { - Box::new(CustomTimeZone::from( - icu_timezone::CustomTimeZone::from_utf8(s), - )) - } - /// Creates a time zone with no information. #[diplomat::rust_link(icu::timezone::CustomTimeZone::unknown, FnInStruct)] #[diplomat::rust_link(icu::timezone::TimeZoneBcp47Id::unknown, FnInStruct, hidden)] - #[diplomat::attr(supports = fallible_constructors, named_constructor)] + #[diplomat::attr(supports = fallible_constructors, constructor)] pub fn unknown() -> Box { - Box::new(icu_timezone::CustomTimeZone::unknown().into()) + Box::new(icu_timezone::TimeZoneInfo::unknown().into()) } /// Creates a time zone for UTC (Coordinated Universal Time). @@ -46,7 +30,7 @@ pub mod ffi { #[diplomat::rust_link(icu::timezone::UtcOffset::zero, FnInStruct, hidden)] #[diplomat::attr(supports = fallible_constructors, named_constructor)] pub fn utc() -> Box { - Box::new(icu_timezone::CustomTimeZone::utc().into()) + Box::new(icu_timezone::TimeZoneInfo::utc().into()) } /// Sets the `offset` field from offset seconds. @@ -180,31 +164,6 @@ pub mod ffi { let _infallible = write.write_str(self.0.time_zone_id.0.as_str()); } - /// Sets the `metazone_id` field from a string. - /// - /// Returns null if the string is not a valid BCP-47 metazone ID. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::metazone_id, StructField)] - #[diplomat::rust_link(icu::timezone::MetazoneId, Struct, compact)] - #[diplomat::rust_link(icu::timezone::MetazoneId::from_str, FnInStruct, hidden)] - pub fn set_metazone_id(&mut self, id: &DiplomatStr) { - self.0.metazone_id = Some( - tinystr::TinyAsciiStr::try_from_utf8(id) - .ok() - .map(icu_timezone::MetazoneId), - ); - } - - /// Writes the value of the `metazone_id` field as a string. - /// - /// Returns null if the `metazone_id` field is empty or unresolved. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::metazone_id, StructField)] - #[diplomat::rust_link(icu::timezone::MetazoneId, Struct, compact)] - #[diplomat::attr(auto, getter)] - pub fn metazone_id(&self, write: &mut diplomat_runtime::DiplomatWrite) -> Option<()> { - let _infallible = write.write_str(self.0.metazone_id??.0.as_str()); - Some(()) - } - /// Sets the `zone_variant` field from a string. /// /// Returns null if the string is not a valid zone variant. @@ -271,53 +230,16 @@ pub mod ffi { pub fn is_daylight_time(&self) -> Option { Some(self.0.zone_variant? == icu_timezone::ZoneVariant::daylight()) } - - /// Sets the metazone based on the time zone and the local timestamp. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::maybe_calculate_metazone, FnInStruct)] - #[diplomat::rust_link( - icu::timezone::MetazoneCalculator::compute_metazone_from_time_zone, - FnInStruct, - compact - )] - #[cfg(feature = "timezone")] - pub fn maybe_calculate_metazone( - &mut self, - metazone_calculator: &crate::metazone_calculator::ffi::MetazoneCalculator, - local_datetime: &crate::datetime::ffi::IsoDateTime, - ) { - self.0 - .maybe_calculate_metazone(&metazone_calculator.0, &local_datetime.0); - } - - /// Sets the zone variant based on the time zone and the local timestamp. - #[diplomat::rust_link( - icu::timezone::CustomTimeZone::maybe_calculate_zone_variant, - FnInStruct - )] - #[diplomat::rust_link( - icu::timezone::ZoneOffsetCalculator::compute_offsets_from_time_zone, - FnInStruct, - compact - )] - #[cfg(feature = "timezone")] - pub fn maybe_calculate_zone_variant( - &mut self, - zone_offset_calculator: &crate::zone_offset_calculator::ffi::ZoneOffsetCalculator, - local_datetime: &crate::datetime::ffi::IsoDateTime, - ) { - self.0 - .maybe_calculate_zone_variant(&zone_offset_calculator.0, &local_datetime.0); - } } } -impl From for ffi::CustomTimeZone { - fn from(other: icu_timezone::CustomTimeZone) -> Self { +impl From for ffi::CustomTimeZone { + fn from(other: icu_timezone::TimeZoneInfo) -> Self { Self(other) } } -impl From for icu_timezone::CustomTimeZone { +impl From for icu_timezone::TimeZoneInfo { fn from(other: ffi::CustomTimeZone) -> Self { other.0 } diff --git a/tutorials/cpp/datetime.cpp b/tutorials/cpp/datetime.cpp index cf4d040991e..64b5db99814 100644 --- a/tutorials/cpp/datetime.cpp +++ b/tutorials/cpp/datetime.cpp @@ -62,14 +62,13 @@ int main() { return 1; } - std::unique_ptr time_zone = CustomTimeZone::from_string("-05:00"); + std::unique_ptr time_zone = CustomTimeZone::unknown(); + time_zone->try_set_offset_seconds(-18000).ok().value(); int32_t offset = time_zone->offset_seconds().value(); if (offset != -18000) { std::cout << "GMT offset doesn't parse" << std::endl; return 1; } - std::unique_ptr mzcalc = MetazoneCalculator::create(*dp.get()).ok().value(); - std::unique_ptr zocalc = ZoneOffsetCalculator::create(*dp.get()).ok().value(); std::unique_ptr mapper = TimeZoneIdMapper::create(*dp.get()).ok().value(); time_zone->set_iana_time_zone_id(*mapper.get(), "america/chicago"); std::string time_zone_id_return = time_zone->time_zone_id(); @@ -98,25 +97,6 @@ int main() { std::cout << "Time zone ID does not roundtrip (fast): " << fast_recovered_iana_id << std::endl; return 1; } - std::unique_ptr local_datetime = IsoDateTime::create(2022, 8, 25, 0, 0, 0, 0).ok().value(); - time_zone->maybe_calculate_metazone(*mzcalc.get(), *local_datetime.get()); - std::string metazone_id_return = time_zone->metazone_id().value(); - if (metazone_id_return != "amce") { - std::cout << "Metazone ID not calculated correctly; got " << metazone_id_return << std::endl; - return 1; - } - time_zone->maybe_calculate_zone_variant(*zocalc.get(), *local_datetime.get()); - if (!time_zone->is_daylight_time()) { - std::cout << "ZoneVariant not calculated correctly" << std::endl; - return 1; - } - // Note: The daylight time switch should normally come from TZDB calculations. - time_zone->set_daylight_time(); - std::string zone_variant_return = time_zone->zone_variant().value(); - if (zone_variant_return != "dt") { - std::cout << "Zone variant not calculated correctly; got " << zone_variant_return << std::endl; - return 1; - } std::unique_ptr gzdtf = GregorianZonedDateTimeFormatter::create_with_length(*dp.get(), *locale.get(), DateTimeLength::Long).ok().value(); out = gzdtf->format_iso_datetime_with_custom_time_zone(*date.get(), *time_zone.get()); From 67e106b05e1c76fb1fdef53850c8b015fe091806 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 13:03:30 -0700 Subject: [PATCH 02/21] check --- components/datetime/src/format/datetime.rs | 50 ++++----- components/datetime/src/format/neo.rs | 4 +- components/datetime/src/input.rs | 21 ++-- components/datetime/src/neo_marker.rs | 106 +++++++++--------- components/datetime/src/time_zone.rs | 65 ++++++++--- .../fixtures/tests/components_with_zones.json | 8 +- .../tests/patterns/tests/time_zones.json | 25 +---- components/timezone/src/metazone.rs | 26 +++-- components/timezone/src/zone_offset.rs | 32 ++++-- 9 files changed, 179 insertions(+), 158 deletions(-) diff --git a/components/datetime/src/format/datetime.rs b/components/datetime/src/format/datetime.rs index 4b52851ba0b..27e6d720ed1 100644 --- a/components/datetime/src/format/datetime.rs +++ b/components/datetime/src/format/datetime.rs @@ -11,8 +11,7 @@ use crate::fields::{self, Day, Field, FieldLength, FieldSymbol, Second, Week, Ye use crate::input::ExtractedInput; use crate::pattern::runtime::PatternMetadata; use crate::pattern::PatternItem; -use crate::time_zone::{FormatTimeZone, FormatTimeZoneError, Iso8601Format}; -use crate::time_zone::{IsoFormat, IsoMinutes, IsoSeconds, ResolvedNeoTimeZoneSkeleton}; +use crate::time_zone::{FormatTimeZone, FormatTimeZoneError, ResolvedNeoTimeZoneSkeleton}; use core::fmt::{self, Write}; use fixed_decimal::FixedDecimal; @@ -471,27 +470,15 @@ where } Some(time_zone) => { let payloads = datetime_names.get_payloads(); - let mut r = Err(DateTimeWriteError::MissingNames(field)); + let mut r = Err(FormatTimeZoneError::Fallback); for formatter in time_zone.units() { match formatter.format(w, input, payloads, fdf)? { - Ok(()) => { - r = Ok(()); - break; - } Err(FormatTimeZoneError::Fallback) => { // Expected common case: the unit needs fall back to the next one continue; } - Err(FormatTimeZoneError::MissingInputField(f)) => { - r = Err(DateTimeWriteError::MissingInputField(f)); - break; - } - Err(FormatTimeZoneError::MissingZoneSymbols) => { - r = Err(DateTimeWriteError::MissingNames(field)); - break; - } - Err(FormatTimeZoneError::MissingFixedDecimalFormatter) => { - r = Err(DateTimeWriteError::MissingFixedDecimalFormatter); + r2 => { + r = r2; break; } } @@ -499,21 +486,26 @@ where match r { Ok(()) => Ok(()), - Err(DateTimeWriteError::MissingInputField(_)) => { + Err(FormatTimeZoneError::MissingInputField(f)) => { write_value_missing(w, field)?; - r + Err(DateTimeWriteError::MissingInputField(f)) } - _ => { - w.with_part(Part::ERROR, |w| match input.offset { - Some(offset) => Iso8601Format { - format: IsoFormat::Basic, - minutes: IsoMinutes::Required, - seconds: IsoSeconds::Optional, - } - .format_infallible(w, offset), - None => "{GMT+?}".write_to(w), + Err(FormatTimeZoneError::MissingFixedDecimalFormatter) => { + // A backup write should have already happened + Err(DateTimeWriteError::MissingFixedDecimalFormatter) + } + Err(FormatTimeZoneError::Fallback) => { + // fell through + w.with_part(Part::ERROR, |w| { + w.write_str("{unsupported:")?; + w.write_char(char::from(field.symbol))?; + w.write_str("}") })?; - r + Err(DateTimeWriteError::UnsupportedField(field)) + } + Err(FormatTimeZoneError::MissingZoneSymbols) => { + // todo write something + Err(DateTimeWriteError::MissingNames(field)) } } } diff --git a/components/datetime/src/format/neo.rs b/components/datetime/src/format/neo.rs index e42a1dbf5c9..b7b28f4c492 100644 --- a/components/datetime/src/format/neo.rs +++ b/components/datetime/src/format/neo.rs @@ -2400,10 +2400,10 @@ where where I: ?Sized + IsInCalendar - + GetField<::TimeZoneOffsetInput> + GetField<::TimeZoneIdInput> - + GetField<::TimeZoneMetazoneInput> + + GetField<::TimeZoneOffsetInput> + GetField<::TimeZoneVariantInput> + + GetField<::TimeZoneLocalTimeInput> + GetField, { FormattedDateTimePattern { diff --git a/components/datetime/src/input.rs b/components/datetime/src/input.rs index 67840ccce02..86a990bd7ad 100644 --- a/components/datetime/src/input.rs +++ b/components/datetime/src/input.rs @@ -6,8 +6,9 @@ //! formatting operations. use crate::neo_marker::{DateInputMarkers, GetField, TimeMarkers, ZoneMarkers}; -use crate::provider::time_zones::{MetazoneId, TimeZoneBcp47Id}; +use crate::provider::time_zones::TimeZoneBcp47Id; use icu_calendar::any_calendar::AnyCalendarKind; +use icu_calendar::{Date, Iso, Time}; use icu_timezone::{UtcOffset, ZoneVariant}; // TODO(#2630) fix up imports to directly import from icu_calendar @@ -15,7 +16,7 @@ pub(crate) use icu_calendar::types::{ DayOfMonth, IsoHour, IsoMinute, IsoSecond, IsoWeekday, MonthInfo, NanoSecond, YearInfo, }; -#[derive(Default, Debug, Copy, Clone)] +#[derive(Debug, Copy, Clone)] pub(crate) struct ExtractedInput { pub(crate) year: Option, pub(crate) month: Option, @@ -26,10 +27,10 @@ pub(crate) struct ExtractedInput { pub(crate) minute: Option, pub(crate) second: Option, pub(crate) nanosecond: Option, - pub(crate) offset: Option, pub(crate) time_zone_id: Option, - pub(crate) metazone_id: Option>, - pub(crate) zone_variant: Option, + pub(crate) offset: Option>, + pub(crate) zone_variant: Option>, + pub(crate) local_time: Option, Time)>>, } impl ExtractedInput { @@ -49,10 +50,10 @@ impl ExtractedInput { + GetField + GetField + GetField - + GetField + GetField - + GetField - + GetField, + + GetField + + GetField + + GetField, { Self { year: GetField::::get_field(input).into(), @@ -64,10 +65,10 @@ impl ExtractedInput { minute: GetField::::get_field(input).into(), second: GetField::::get_field(input).into(), nanosecond: GetField::::get_field(input).into(), - offset: GetField::::get_field(input).into(), time_zone_id: GetField::::get_field(input).into(), - metazone_id: GetField::::get_field(input).into(), + offset: GetField::::get_field(input).into(), zone_variant: GetField::::get_field(input).into(), + local_time: GetField::::get_field(input).into(), } } } diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index c98778f43f5..be6aa441bc1 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -349,12 +349,10 @@ use icu_calendar::{ DayOfMonth, DayOfYearInfo, IsoHour, IsoMinute, IsoSecond, IsoWeekday, MonthInfo, NanoSecond, YearInfo, }, - AnyCalendar, AnyCalendarKind, AsCalendar, Calendar, Date, DateTime, Ref, Time, + AnyCalendar, AnyCalendarKind, AsCalendar, Calendar, Date, DateTime, Iso, Ref, Time, }; use icu_provider::{marker::NeverMarker, prelude::*}; -use icu_timezone::{ - CustomZonedDateTime, MetazoneId, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant, -}; +use icu_timezone::{CustomZonedDateTime, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant}; // TODO: Figure out where to export these traits #[doc(inline)] @@ -735,30 +733,21 @@ impl> GetField for CustomZo } } -impl> GetField> +impl> GetField for CustomZonedDateTime { #[inline] - fn get_field(&self) -> Option { - self.zone.offset + fn get_field(&self) -> TimeZoneBcp47Id { + self.zone.time_zone_id } } -impl> GetField> - for CustomZonedDateTime -{ - #[inline] - fn get_field(&self) -> Option { - Some(self.zone.time_zone_id) - } -} - -impl> GetField>> +impl> GetField> for CustomZonedDateTime { #[inline] - fn get_field(&self) -> Option> { - None + fn get_field(&self) -> Option { + self.zone.offset } } @@ -771,24 +760,26 @@ impl> GetField> } } -impl GetField> for TimeZoneInfo { +impl> GetField, Time)>> + for CustomZonedDateTime +{ #[inline] - fn get_field(&self) -> Option { - self.offset + fn get_field(&self) -> Option<(Date, Time)> { + self.zone.local_time } } -impl GetField> for TimeZoneInfo { +impl GetField for TimeZoneInfo { #[inline] - fn get_field(&self) -> Option { - Some(self.time_zone_id) + fn get_field(&self) -> TimeZoneBcp47Id { + self.time_zone_id } } -impl GetField>> for TimeZoneInfo { +impl GetField> for TimeZoneInfo { #[inline] - fn get_field(&self) -> Option> { - None + fn get_field(&self) -> Option { + self.offset } } @@ -799,6 +790,13 @@ impl GetField> for TimeZoneInfo { } } +impl GetField, Time)>> for TimeZoneInfo { + #[inline] + fn get_field(&self) -> Option<(Date, Time)> { + self.local_time + } +} + /// Struct representing the absence of a datetime formatting field. #[derive(Debug, Copy, Clone, Default)] #[allow(clippy::exhaustive_structs)] // empty marker struct @@ -909,28 +907,28 @@ impl From for Option { } } -impl From for Option { +impl From for Option { #[inline] fn from(_: NeverField) -> Self { None } } -impl From for Option { +impl From for Option> { #[inline] fn from(_: NeverField) -> Self { None } } -impl From for Option> { +impl From for Option> { #[inline] fn from(_: NeverField) -> Self { None } } -impl From for Option { +impl From for Option, Time)>> { #[inline] fn from(_: NeverField) -> Self { None @@ -1052,14 +1050,14 @@ pub trait TimeMarkers: private::Sealed { /// A trait associating types for time zone formatting /// (input types and data markers). pub trait ZoneMarkers: private::Sealed { - /// Marker for resolving the time zone offset input field. - type TimeZoneOffsetInput: Into>; /// Marker for resolving the time zone id input field. type TimeZoneIdInput: Into>; - /// Marker for resolving the time zone metazone input field. - type TimeZoneMetazoneInput: Into>>; + /// Marker for resolving the time zone offset input field. + type TimeZoneOffsetInput: Into>>; /// Marker for resolving the time zone variant input field. - type TimeZoneVariantInput: Into>; + type TimeZoneVariantInput: Into>>; + /// Marker for resolving the time zone metazone input field. + type TimeZoneLocalTimeInput: Into, Time)>>>; /// Marker for loading core time zone data. type EssentialsV1Marker: DataMarker>; /// Marker for loading location names for time zone formatting @@ -1112,10 +1110,10 @@ pub trait AllInputMarkers: + GetField<::MinuteInput> + GetField<::SecondInput> + GetField<::NanoSecondInput> - + GetField<::TimeZoneOffsetInput> + GetField<::TimeZoneIdInput> - + GetField<::TimeZoneMetazoneInput> + + GetField<::TimeZoneOffsetInput> + GetField<::TimeZoneVariantInput> + + GetField<::TimeZoneLocalTimeInput> where R::D: DateInputMarkers, R::T: TimeMarkers, @@ -1138,10 +1136,10 @@ where + GetField<::MinuteInput> + GetField<::SecondInput> + GetField<::NanoSecondInput> - + GetField<::TimeZoneOffsetInput> + GetField<::TimeZoneIdInput> - + GetField<::TimeZoneMetazoneInput> - + GetField<::TimeZoneVariantInput>, + + GetField<::TimeZoneOffsetInput> + + GetField<::TimeZoneVariantInput> + + GetField<::TimeZoneLocalTimeInput>, { } @@ -1184,10 +1182,10 @@ impl TimeMarkers for NeoNeverMarker { } impl ZoneMarkers for NeoNeverMarker { - type TimeZoneOffsetInput = NeverField; type TimeZoneIdInput = NeverField; - type TimeZoneMetazoneInput = NeverField; + type TimeZoneOffsetInput = NeverField; type TimeZoneVariantInput = NeverField; + type TimeZoneLocalTimeInput = NeverField; type EssentialsV1Marker = NeverMarker>; type LocationsV1Marker = NeverMarker>; type GenericLongV1Marker = NeverMarker>; @@ -1538,18 +1536,18 @@ macro_rules! datetime_marker_helper { (@input/nanosecond, yes) => { NanoSecond }; - (@input/timezone/offset, yes) => { - Option - }; (@input/timezone/id, yes) => { - Option + TimeZoneBcp47Id }; - (@input/timezone/metazone, yes) => { - Option> + (@input/timezone/offset, yes) => { + Option }; (@input/timezone/variant, yes) => { Option }; + (@input/timezone/local_time, yes) => { + Option<(Date, Time)> + }; (@input/$any:ident,) => { NeverField }; @@ -2219,10 +2217,10 @@ macro_rules! impl_zone_marker { const COMPONENT: NeoTimeZoneStyle = $components; } impl ZoneMarkers for $type { - type TimeZoneOffsetInput = datetime_marker_helper!(@input/timezone/offset, yes); type TimeZoneIdInput = datetime_marker_helper!(@input/timezone/id, yes); - type TimeZoneMetazoneInput = datetime_marker_helper!(@input/timezone/metazone, yes); + type TimeZoneOffsetInput = datetime_marker_helper!(@input/timezone/offset, yes); type TimeZoneVariantInput = datetime_marker_helper!(@input/timezone/variant, yes); + type TimeZoneLocalTimeInput = datetime_marker_helper!(@input/timezone/local_time, yes); type EssentialsV1Marker = datetime_marker_helper!(@data/zone/essentials, $($zone_essentials_yes)?); type LocationsV1Marker = datetime_marker_helper!(@data/zone/locations, $($zone_locations_yes)?); type GenericLongV1Marker = datetime_marker_helper!(@data/zone/generic_long, $($zone_generic_long_yes)?); @@ -2938,10 +2936,10 @@ impl DateTimeNamesMarker for NeoTimeZoneSkeleton { } impl ZoneMarkers for NeoTimeZoneSkeleton { - type TimeZoneOffsetInput = datetime_marker_helper!(@input/timezone/offset, yes); type TimeZoneIdInput = datetime_marker_helper!(@input/timezone/id, yes); - type TimeZoneMetazoneInput = datetime_marker_helper!(@input/timezone/metazone, yes); + type TimeZoneOffsetInput = datetime_marker_helper!(@input/timezone/offset, yes); type TimeZoneVariantInput = datetime_marker_helper!(@input/timezone/variant, yes); + type TimeZoneLocalTimeInput = datetime_marker_helper!(@input/timezone/local_time, yes); type EssentialsV1Marker = datetime_marker_helper!(@data/zone/essentials, yes); type LocationsV1Marker = datetime_marker_helper!(@data/zone/locations, yes); type GenericLongV1Marker = datetime_marker_helper!(@data/zone/generic_long, yes); diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index 27f771e8c73..6d20ff08eb8 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -12,8 +12,9 @@ use crate::{ use core::fmt; use fixed_decimal::FixedDecimal; use icu_decimal::FixedDecimalFormatter; -use icu_timezone::ZoneVariant; -use icu_timezone::{TimeZoneBcp47Id, UtcOffset}; +use icu_timezone::{ + MetazoneCalculator, TimeZoneBcp47Id, UtcOffset, ZoneOffsetCalculator, ZoneVariant, +}; use writeable::Writeable; /// All time zone styles that this crate can format @@ -340,12 +341,12 @@ impl FormatTimeZone for GenericNonLocationFormat { data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(metazone_id) = input.metazone_id else { - return Ok(Err(FormatTimeZoneError::MissingInputField("metazone"))); - }; let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_generic_long.as_ref(), _ => data_payloads.mz_generic_short.as_ref(), @@ -353,6 +354,9 @@ impl FormatTimeZone for GenericNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let metazone_id = + MetazoneCalculator::new().compute_metazone_from_time_zone(time_zone_id, local_time); + let Some(name) = metazone_id.and_then(|mz| { names .overrides @@ -384,8 +388,8 @@ impl FormatTimeZone for SpecificNonLocationFormat { let Some(zone_variant) = input.zone_variant else { return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); }; - let Some(metazone_id) = input.metazone_id else { - return Ok(Err(FormatTimeZoneError::MissingInputField("metazone"))); + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); }; let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); @@ -397,6 +401,20 @@ impl FormatTimeZone for SpecificNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let metazone_id = + MetazoneCalculator::new().compute_metazone_from_time_zone(time_zone_id, local_time); + + let zone_variant = zone_variant.unwrap_or_else(|| { + let (_, dst) = ZoneOffsetCalculator::new() + .compute_offsets_from_time_zone(time_zone_id, local_time) + .unwrap_or_default(); + if dst.is_some() && input.offset == Some(dst) { + ZoneVariant::daylight() + } else { + ZoneVariant::standard() + } + }); + let Some(name) = metazone_id.and_then(|mz| { names .overrides @@ -429,7 +447,7 @@ impl FormatTimeZone for LocalizedOffsetFormat { data_payloads: TimeZoneDataPayloadsBorrowed, fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(offset) = input.offset else { + let Some(Some(offset)) = input.offset else { return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); }; let Some(essentials) = data_payloads.essentials else { @@ -516,9 +534,9 @@ impl FormatTimeZone for GenericLocationFormat { data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let time_zone_id = input - .time_zone_id - .unwrap_or(TimeZoneBcp47Id(tinystr::tinystr!(8, "unk"))); + let Some(time_zone_id) = input.time_zone_id else { + return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); + }; let Some(locations) = data_payloads.locations else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); @@ -552,7 +570,10 @@ impl FormatTimeZone for SpecificLocationFormat { _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { let Some(zone_variant) = input.zone_variant else { - return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); + return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); + }; + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); }; let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); @@ -561,6 +582,17 @@ impl FormatTimeZone for SpecificLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let zone_variant = zone_variant.unwrap_or_else(|| { + let (_, dst) = ZoneOffsetCalculator::new() + .compute_offsets_from_time_zone(time_zone_id, local_time) + .unwrap_or_default(); + if dst.is_some() && input.offset == Some(dst) { + ZoneVariant::daylight() + } else { + ZoneVariant::standard() + } + }); + if let Some(location) = locations.locations.get(&time_zone_id) { if zone_variant == ZoneVariant::daylight() { &locations.pattern_daylight @@ -595,8 +627,8 @@ impl FormatTimeZone for GenericPartialLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let Some(metazone_id) = input.metazone_id else { - return Ok(Err(FormatTimeZoneError::MissingInputField("metazone"))); + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); }; let Some(locations) = data_payloads.locations else { @@ -609,6 +641,9 @@ impl FormatTimeZone for GenericPartialLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let metazone_id = + MetazoneCalculator::new().compute_metazone_from_time_zone(time_zone_id, local_time); + let Some(location) = locations.locations.get(&time_zone_id) else { return Ok(Err(FormatTimeZoneError::Fallback)); }; @@ -656,7 +691,7 @@ impl FormatTimeZone for Iso8601Format { _data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(offset) = input.offset else { + let Some(Some(offset)) = input.offset else { return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); }; self.format_infallible(sink, offset).map(|()| Ok(())) diff --git a/components/datetime/tests/fixtures/tests/components_with_zones.json b/components/datetime/tests/fixtures/tests/components_with_zones.json index db108da552e..fd5e906aca4 100644 --- a/components/datetime/tests/fixtures/tests/components_with_zones.json +++ b/components/datetime/tests/fixtures/tests/components_with_zones.json @@ -23,7 +23,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 {v}" + "en": "Tuesday, January 21, 2020, 08:25:07 Unknown City Time" } } }, @@ -51,7 +51,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 {v}" + "en": "Tuesday, January 21, 2020, 08:25:07 Unknown City Time" } } }, @@ -79,7 +79,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 {z}" + "en": "Tuesday, January 21, 2020, 08:25:07 GMT+5" } } }, @@ -107,7 +107,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 {z}" + "en": "Tuesday, January 21, 2020, 08:25:07 GMT+5" } } }, diff --git a/components/datetime/tests/patterns/tests/time_zones.json b/components/datetime/tests/patterns/tests/time_zones.json index 7dfeb8ae5e1..601102f0b1f 100644 --- a/components/datetime/tests/patterns/tests/time_zones.json +++ b/components/datetime/tests/patterns/tests/time_zones.json @@ -986,13 +986,7 @@ "patterns": [ "z", "zz", - "zzz" - ], - "configs": [], - "expected": ["{z}"] - }, - { - "patterns": [ + "zzz", "O" ], "configs": [], @@ -1001,6 +995,7 @@ { "patterns": [ "OOOO", + "zzzz", "ZZZZ" ], "configs": [], @@ -1042,13 +1037,6 @@ "z", "zz", "zzz", - "zzzz" - ], - "configs": [], - "expected": ["{z}"] - }, - { - "patterns": [ "O" ], "configs": [], @@ -1057,6 +1045,7 @@ { "patterns": [ "ZZZZ", + "zzzz", "OOOO" ], "configs": [], @@ -1081,13 +1070,7 @@ { "patterns": [ "v", - "vvvv" - ], - "configs": [], - "expected": ["{v}"] - }, - { - "patterns": [ + "vvvv", "VVVV" ], "configs": [], diff --git a/components/timezone/src/metazone.rs b/components/timezone/src/metazone.rs index 9f1be08ddac..3c6de42cbe7 100644 --- a/components/timezone/src/metazone.rs +++ b/components/timezone/src/metazone.rs @@ -5,8 +5,8 @@ use crate::provider::{MetazoneId, TimeZoneBcp47Id}; use crate::provider::MetazonePeriodV1Marker; -use icu_calendar::DateTime; use icu_calendar::Iso; +use icu_calendar::{Date, DateTime, Time}; use icu_provider::prelude::*; use zerovec::ule::AsULE; @@ -106,21 +106,25 @@ impl MetazoneCalculator { pub fn compute_metazone_from_time_zone( &self, time_zone_id: TimeZoneBcp47Id, - local_datetime: &DateTime, + local_time: Option<(Date, Time)>, ) -> Option { match self.metazone_period.get().0.get0(&time_zone_id) { Some(cursor) => { - let mut metazone_id = None; - let minutes_since_local_unix_epoch = - local_datetime.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1() { - if minutes_since_local_unix_epoch >= i32::from_unaligned(*minutes) { - metazone_id = id.get() - } else { - break; + if let Some((date, time)) = local_time { + let mut metazone_id = None; + let minutes_since_local_unix_epoch = + DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1() { + if minutes_since_local_unix_epoch >= i32::from_unaligned(*minutes) { + metazone_id = id.get() + } else { + break; + } } + metazone_id + } else { + cursor.iter1().next_back().and_then(|(_, m)| m.get()) } - metazone_id } None => None, } diff --git a/components/timezone/src/zone_offset.rs b/components/timezone/src/zone_offset.rs index 47a027446b1..f63f04be419 100644 --- a/components/timezone/src/zone_offset.rs +++ b/components/timezone/src/zone_offset.rs @@ -4,8 +4,8 @@ use crate::provider::ZoneOffsetPeriodV1Marker; use crate::{TimeZoneBcp47Id, UtcOffset}; -use icu_calendar::DateTime; use icu_calendar::Iso; +use icu_calendar::{Date, DateTime, Time}; use icu_provider::prelude::*; /// [`ZoneOffsetCalculator`] uses data from the [data provider] to calculate time zone offsets. @@ -93,22 +93,30 @@ impl ZoneOffsetCalculator { pub fn compute_offsets_from_time_zone( &self, time_zone_id: TimeZoneBcp47Id, - local_datetime: &DateTime, + local_time: Option<(Date, Time)>, ) -> Option<(UtcOffset, Option)> { use zerovec::ule::AsULE; match self.offset_period.get().0.get0(&time_zone_id) { Some(cursor) => { - let mut offsets = None; - let minutes_since_local_unix_epoch = - local_datetime.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1_copied().rev() { - if minutes_since_local_unix_epoch <= i32::from_unaligned(*minutes) { - offsets = Some(id); - } else { - break; + let offsets = if let Some((date, time)) = local_time { + let mut offsets = None; + let minutes_since_local_unix_epoch = + DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1_copied().rev() { + if minutes_since_local_unix_epoch <= i32::from_unaligned(*minutes) { + offsets = Some(id); + } else { + break; + } } - } - let offsets = offsets?; + offsets? + } else { + cursor + .iter1() + .map(|(_, v)| <_>::from_unaligned(*v)) + .next_back() + .unwrap_or_default() // shouldn't happen + }; Some(( UtcOffset::from_eighths_of_hour(offsets.0), (offsets.1 != 0) From c570cf6a51499f946b8a4c134b81f99a24d77f49 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 13:19:25 -0700 Subject: [PATCH 03/21] check --- components/datetime/README.md | 4 +- components/datetime/src/format/neo.rs | 6 +- components/datetime/src/lib.rs | 4 +- components/datetime/src/neo_marker.rs | 124 +++++++++++++------------- components/datetime/tests/mock.rs | 2 +- 5 files changed, 70 insertions(+), 70 deletions(-) diff --git a/components/datetime/README.md b/components/datetime/README.md index 5807bdc060e..c7cd246fc9c 100644 --- a/components/datetime/README.md +++ b/components/datetime/README.md @@ -12,7 +12,7 @@ allow it to collect necessary data from the [data provider], and once instantiat used to quickly format any date and time provided. There are variants of these types that can format greater or fewer components. These formatters work with types from the [`calendar`] module, like [`Date`], [`DateTime`], and [`Time`], -and [`timezone::CustomTimeZone`], however other types may be used provided they implement the traits from the [`input`] module. +and [`timezone::TimeZoneInfo`], however other types may be used provided they implement the traits from the [`input`] module. Each instance of a date-related formatter is associated with a particular [`Calendar`]. The "Typed" vs untyped formatter distinction is to help with this. For example, if you know at compile time that you @@ -69,7 +69,7 @@ assert_try_writeable_eq!(typed_formatted_date, "Sep 12, 2020, 12:34 PM"); [`Time`]: calendar::types::{Time} [`Calendar`]: calendar::{Calendar} [`AnyCalendar`]: calendar::any_calendar::{AnyCalendar} -[`timezone::CustomTimeZone`]: icu::timezone::{CustomTimeZone} +[`timezone::TimeZoneInfo`]: icu::timezone::{TimeZoneInfo} diff --git a/components/datetime/src/format/neo.rs b/components/datetime/src/format/neo.rs index b7b28f4c492..473d406ff9c 100644 --- a/components/datetime/src/format/neo.rs +++ b/components/datetime/src/format/neo.rs @@ -325,7 +325,7 @@ size_test!( /// use icu::datetime::neo_pattern::DateTimePattern; /// use icu::datetime::neo_skeleton::NeoSkeleton; /// use icu::locale::locale; -/// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; +/// use icu::timezone::{TimeZoneInfo, CustomZonedDateTime}; /// use writeable::{Part, assert_try_writeable_parts_eq}; /// /// // Create an instance that can format all fields (NeoSkeleton): @@ -366,7 +366,7 @@ size_test!( /// use icu::datetime::neo_pattern::DateTimePattern; /// use icu::datetime::neo_skeleton::NeoTimeZoneSkeleton; /// use icu::locale::locale; -/// use icu::timezone::CustomTimeZone; +/// use icu::timezone::TimeZoneInfo; /// use writeable::{Part, assert_try_writeable_parts_eq}; /// /// // Create an instance that can format abbreviated month, weekday, and day period names: @@ -382,7 +382,7 @@ size_test!( /// // Further, the time zone we provide doesn't contain any offset into! /// // Missing data is filled in on a best-effort basis, and an error is signaled. /// assert_try_writeable_parts_eq!( -/// names.with_pattern(&pattern).format(&CustomTimeZone::unknown()), +/// names.with_pattern(&pattern).format(&TimeZoneInfo::unknown()), /// "It is: {E} {M} {d} {y} {G} at {h}:{m}:{s} {a} {z}", /// Err(DateTimeWriteError::MissingInputField("iso_weekday")), /// [ diff --git a/components/datetime/src/lib.rs b/components/datetime/src/lib.rs index 542f6644670..7eea73d41dc 100644 --- a/components/datetime/src/lib.rs +++ b/components/datetime/src/lib.rs @@ -12,7 +12,7 @@ //! used to quickly format any date and time provided. There are variants of these types that can format greater or fewer components. //! //! These formatters work with types from the [`calendar`] module, like [`Date`], [`DateTime`], and [`Time`], -//! and [`timezone::CustomTimeZone`], however other types may be used provided they implement the traits from the [`input`] module. +//! and [`timezone::TimeZoneInfo`], however other types may be used provided they implement the traits from the [`input`] module. //! //! Each instance of a date-related formatter is associated with a particular [`Calendar`]. //! The "Typed" vs untyped formatter distinction is to help with this. For example, if you know at compile time that you @@ -69,7 +69,7 @@ //! [`Time`]: calendar::types::{Time} //! [`Calendar`]: calendar::{Calendar} //! [`AnyCalendar`]: calendar::any_calendar::{AnyCalendar} -//! [`timezone::CustomTimeZone`]: icu::timezone::{CustomTimeZone} +//! [`timezone::TimeZoneInfo`]: icu::timezone::{TimeZoneInfo} // https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations #![cfg_attr(not(any(test, feature = "std")), no_std)] diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index be6aa441bc1..1be01de4832 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -267,7 +267,7 @@ //! //! ``` //! use icu::calendar::DateTime; -//! use icu::timezone::{CustomTimeZone, MetazoneCalculator, TimeZoneIdMapper, TimeZoneBcp47Id}; +//! use icu::timezone::{TimeZoneInfo, UtcOffset, TimeZoneIdMapper, TimeZoneBcp47Id}; //! use icu::datetime::neo::TypedNeoFormatter; //! use icu::datetime::neo_marker::NeoTimeZoneGenericMarker; //! use icu::datetime::neo_skeleton::NeoSkeletonLength; @@ -279,12 +279,11 @@ //! // Set up the time zone. Note: the inputs here are //! // 1. The offset //! // 2. The IANA time zone ID -//! // 3. A datetime (for metazone resolution) +//! // 3. A datetime (for non-location name resolution) //! // 4. Note: we do not need the zone variant because of `load_generic_*()` //! -//! // Set up the Metazone calculator, time zone ID mapper, +//! // Set up the time zone ID mapper, //! // and the DateTime to use in calculation -//! let mzc = MetazoneCalculator::new(); //! let mapper = TimeZoneIdMapper::new(); //! let datetime = DateTime::try_new_iso_datetime(2022, 8, 29, 0, 0, 0) //! .unwrap(); @@ -296,39 +295,40 @@ //! ) //! .unwrap(); //! -//! // "uschi" - has metazone symbol data for generic_non_location_short -//! let mut time_zone = "-0600".parse::().unwrap(); -//! time_zone.time_zone_id = mapper.as_borrowed().iana_to_bcp47("America/Chicago"); -//! time_zone.maybe_calculate_metazone(&mzc, &datetime); +//! // "uschi" - has symbol data for generic_non_location_short +//! let time_zone = TimeZoneInfo { +//! time_zone_id: mapper.as_borrowed().iana_to_bcp47("America/Chicago"), +//! offset: Some(UtcOffset::from_eighths_of_hour(-6 * 8)), +//! local_time: Some((datetime.date, datetime.time)), +//! ..TimeZoneInfo::unknown() +//! }; //! assert_try_writeable_eq!( //! tzf.format(&time_zone), //! "CT" //! ); //! -//! // "ushnl" - has time zone override symbol data for generic_non_location_short -//! let mut time_zone = "-1000".parse::().unwrap(); -//! time_zone.time_zone_id = TimeZoneBcp47Id(tinystr!(8, "ushnl")); -//! time_zone.maybe_calculate_metazone(&mzc, &datetime); +//! // This is the latest non-location name for `uschi`, so we don't *have* +//! // to set the `local_time`. +//! let time_zone = TimeZoneInfo { +//! time_zone_id: mapper.as_borrowed().iana_to_bcp47("America/Chicago"), +//! offset: Some(UtcOffset::from_eighths_of_hour(-6 * 8)), +//! ..TimeZoneInfo::unknown() +//! }; //! assert_try_writeable_eq!( //! tzf.format(&time_zone), -//! "HST" -//! ); -//! -//! // If we don't calculate the metazone, it falls back to generic location -//! let mut time_zone = "-1000".parse::().unwrap(); -//! time_zone.time_zone_id = TimeZoneBcp47Id(tinystr!(8, "ushnl")); -//! assert_try_writeable_eq!( -//! tzf.format(&time_zone), -//! "{v}", -//! Err(DateTimeWriteError::MissingInputField("metazone")) +//! "CT" //! ); //! -//! // If we don't set a zone at all, there's no fallback to the offset -//! let mut time_zone = "+0530".parse::().unwrap(); +//! // "ushnl" - has time zone override symbol data for generic_non_location_short +//! let time_zone = TimeZoneInfo { +//! time_zone_id: TimeZoneBcp47Id(tinystr!(8, "ushnl")), +//! offset: Some(UtcOffset::from_eighths_of_hour(-10 * 8)), +//! local_time: Some((datetime.date, datetime.time)), +//! ..TimeZoneInfo::unknown() +//! }; //! assert_try_writeable_eq!( //! tzf.format(&time_zone), -//! "{v}", -//! Err(DateTimeWriteError::MissingInputField("metazone")) +//! "HST" //! ); //! ``` @@ -2136,7 +2136,7 @@ macro_rules! impl_zone_marker { /// In [`NeoFormatter`](crate::neo::NeoFormatter): /// /// ``` - /// use icu::timezone::CustomTimeZone; + /// use icu::timezone::{TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant}; /// use icu::datetime::neo::NeoFormatter; #[doc = concat!("use icu::datetime::neo_marker::", stringify!($type), ";")] /// use icu::datetime::neo_skeleton::NeoSkeletonLength; @@ -2150,13 +2150,13 @@ macro_rules! impl_zone_marker { /// ) /// .unwrap(); /// - /// // Time zone for America/Chicago in the summer - /// let zone = CustomTimeZone::from_parts( - /// -40, // offset eighths of hour - /// tinystr!(8, "uschi"), // time zone ID - /// tinystr!(4, "amce"), // metazone ID - /// tinystr!(2, "dt"), // zone variant: daylight time - /// ); + /// // Time zone info for America/Chicago in the summer + /// let zone = TimeZoneInfo { + /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), + /// offset: Some(UtcOffset::from_eighths_of_hour(-5 * 8)), + /// zone_variant: Some(ZoneVariant::daylight()), + /// ..TimeZoneInfo::unknown() + /// }; /// /// assert_try_writeable_eq!( /// fmt.convert_and_format(&zone), @@ -2168,7 +2168,7 @@ macro_rules! impl_zone_marker { /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{CustomZonedDateTime, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant}; /// use icu::calendar::Gregorian; /// use icu::datetime::neo::TypedNeoFormatter; #[doc = concat!("use icu::datetime::neo_marker::", stringify!($type), ";")] @@ -2183,13 +2183,13 @@ macro_rules! impl_zone_marker { /// ) /// .unwrap(); /// - /// // Time zone for America/Chicago in the summer - /// let zone = CustomTimeZone::from_parts( - /// -40, // offset eighths of hour - /// tinystr!(8, "uschi"), // time zone ID - /// tinystr!(4, "amce"), // metazone ID - /// tinystr!(2, "dt"), // zone variant: daylight time - /// ); + /// // Time zone info for America/Chicago in the summer + /// let zone = TimeZoneInfo { + /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), + /// offset: Some(UtcOffset::from_eighths_of_hour(-5 * 8)), + /// zone_variant: Some(ZoneVariant::daylight()), + /// ..TimeZoneInfo::unknown() + /// }; /// /// assert_try_writeable_eq!( /// fmt.format(&zone), @@ -2325,7 +2325,7 @@ macro_rules! impl_zoneddatetime_marker { /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{TimeZoneInfo, CustomZonedDateTime}; /// use icu::datetime::neo::NeoFormatter; #[doc = concat!("use icu::datetime::neo_marker::", stringify!($type), ";")] /// use icu::datetime::neo_skeleton::NeoSkeletonLength; @@ -2350,7 +2350,7 @@ macro_rules! impl_zoneddatetime_marker { /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{TimeZoneInfo, CustomZonedDateTime}; /// use icu::calendar::Gregorian; /// use icu::datetime::neo::TypedNeoFormatter; #[doc = concat!("use icu::datetime::neo_marker::", stringify!($type), ";")] @@ -2500,7 +2500,7 @@ impl_zone_marker!( /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{CustomZonedDateTime, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant}; /// use icu::calendar::Gregorian; /// use icu::datetime::neo::TypedNeoFormatter; /// use icu::datetime::neo_marker::NeoTimeZoneSpecificMarker; @@ -2515,13 +2515,13 @@ impl_zone_marker!( /// ) /// .unwrap(); /// - /// // Time zone for America/Sao_Paulo year-round - /// let zone = CustomTimeZone::from_parts( - /// -24, // offset eighths of hour - /// tinystr!(8, "brsao"), // time zone ID - /// tinystr!(4, "bras"), // metazone ID - /// tinystr!(2, "st"), // zone variant: standard time - /// ); + /// // Time zone info for America/Sao_Paulo in the summer + /// let zone = TimeZoneInfo { + /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "brsao")), + /// offset: Some(UtcOffset::from_eighths_of_hour(-3 * 8)), + /// zone_variant: Some(ZoneVariant::standard()), + /// ..TimeZoneInfo::unknown() + /// }; /// /// assert_try_writeable_eq!( /// fmt.format(&zone), @@ -2543,7 +2543,7 @@ impl_zone_marker!( /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{TimeZoneInfo, CustomZonedDateTime}; /// use icu::calendar::Gregorian; /// use icu::datetime::neo::NeoFormatter; /// use icu::datetime::neo_marker::NeoMonthDayMarker; @@ -2615,7 +2615,7 @@ impl_zone_marker!( /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{CustomZonedDateTime, TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant}; /// use icu::calendar::Gregorian; /// use icu::datetime::neo::TypedNeoFormatter; /// use icu::datetime::neo_marker::NeoTimeZoneGenericMarker; @@ -2630,13 +2630,13 @@ impl_zone_marker!( /// ) /// .unwrap(); /// - /// // Time zone for America/Sao_Paulo year-round - /// let zone = CustomTimeZone::from_parts( - /// -24, // offset eighths of hour - /// tinystr!(8, "brsao"), // time zone ID - /// tinystr!(4, "bras"), // metazone ID - /// tinystr!(2, "st"), // zone variant: standard time - /// ); + /// // Time zone info for America/Sao_Paulo in the summer + /// let zone = TimeZoneInfo { + /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "brsao")), + /// offset: Some(UtcOffset::from_eighths_of_hour(-3 * 8)), + /// zone_variant: Some(ZoneVariant::standard()), + /// ..TimeZoneInfo::unknown() + /// }; /// /// assert_try_writeable_eq!( /// fmt.format(&zone), @@ -2659,7 +2659,7 @@ impl_zone_marker!( /// /// ``` /// use icu::calendar::{Date, Time}; - /// use icu::timezone::{CustomTimeZone, CustomZonedDateTime}; + /// use icu::timezone::{TimeZoneInfo, CustomZonedDateTime}; /// use icu::calendar::Gregorian; /// use icu::datetime::neo::NeoFormatter; /// use icu::datetime::neo_marker::NeoMonthDayMarker; diff --git a/components/datetime/tests/mock.rs b/components/datetime/tests/mock.rs index 52d42c24e12..e321184fd94 100644 --- a/components/datetime/tests/mock.rs +++ b/components/datetime/tests/mock.rs @@ -37,7 +37,7 @@ pub fn parse_gregorian_from_str(input: &str) -> DateTime { datetime_iso.to_calendar(Gregorian) } -/// Parse a [`DateTime`] and [`CustomTimeZone`] from a string. +/// Parse a [`DateTime`] and [`TimeZoneInfo`] from a string. /// /// This utility is for easily creating dates, not a complete robust solution. The /// string must take a specific form of the ISO 8601 format: From f8643699beeaf41d2804b455d02c6ee4fa330848 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 14:25:37 -0700 Subject: [PATCH 04/21] check --- components/datetime/src/time_zone.rs | 152 +++++++++--- components/timezone/src/lib.rs | 6 +- components/timezone/src/metazone.rs | 132 ---------- components/timezone/src/zone_offset.rs | 129 ---------- ffi/capi/bindings/c/CustomTimeZone.d.h | 19 -- ffi/capi/bindings/c/CustomTimeZone.h | 82 ------- .../c/GregorianZonedDateTimeFormatter.h | 4 +- ffi/capi/bindings/c/MetazoneCalculator.d.h | 19 -- ffi/capi/bindings/c/MetazoneCalculator.h | 30 --- ffi/capi/bindings/c/TimeZoneInfo.d.h | 19 ++ ffi/capi/bindings/c/TimeZoneInfo.h | 85 +++++++ ffi/capi/bindings/c/ZoneOffsetCalculator.d.h | 19 -- ffi/capi/bindings/c/ZoneOffsetCalculator.h | 30 --- ffi/capi/bindings/c/ZonedDateTimeFormatter.h | 6 +- .../bindings/cpp/icu4x/CustomTimeZone.hpp | 220 ----------------- .../GregorianZonedDateTimeFormatter.d.hpp | 6 +- .../icu4x/GregorianZonedDateTimeFormatter.hpp | 6 +- .../cpp/icu4x/MetazoneCalculator.d.hpp | 48 ---- .../bindings/cpp/icu4x/MetazoneCalculator.hpp | 57 ----- ...ustomTimeZone.d.hpp => TimeZoneInfo.d.hpp} | 38 +-- ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp | 229 ++++++++++++++++++ .../cpp/icu4x/ZoneOffsetCalculator.d.hpp | 48 ---- .../cpp/icu4x/ZoneOffsetCalculator.hpp | 57 ----- .../cpp/icu4x/ZonedDateTimeFormatter.d.hpp | 8 +- .../cpp/icu4x/ZonedDateTimeFormatter.hpp | 10 +- .../GregorianZonedDateTimeFormatter.g.dart | 4 +- .../bindings/dart/MetazoneCalculator.g.dart | 51 ---- ...tomTimeZone.g.dart => TimeZoneInfo.g.dart} | 193 ++++++++------- .../bindings/dart/ZoneOffsetCalculator.g.dart | 51 ---- .../dart/ZonedDateTimeFormatter.g.dart | 8 +- ffi/capi/bindings/dart/lib.g.dart | 4 +- .../GregorianZonedDateTimeFormatter.d.ts | 2 +- .../GregorianZonedDateTimeFormatter.mjs | 4 +- ...{CustomTimeZone.d.ts => TimeZoneInfo.d.ts} | 2 +- .../{CustomTimeZone.mjs => TimeZoneInfo.mjs} | 6 +- .../demo_gen/ZonedDateTimeFormatter.d.ts | 2 +- .../demo_gen/ZonedDateTimeFormatter.mjs | 6 +- ffi/capi/bindings/demo_gen/index.mjs | 16 +- .../js/GregorianZonedDateTimeFormatter.d.ts | 4 +- .../js/GregorianZonedDateTimeFormatter.mjs | 2 +- ffi/capi/bindings/js/MetazoneCalculator.d.ts | 21 -- ffi/capi/bindings/js/MetazoneCalculator.mjs | 64 ----- ...{CustomTimeZone.d.ts => TimeZoneInfo.d.ts} | 10 +- .../{CustomTimeZone.mjs => TimeZoneInfo.mjs} | 80 +++--- .../bindings/js/ZoneOffsetCalculator.d.ts | 21 -- ffi/capi/bindings/js/ZoneOffsetCalculator.mjs | 64 ----- .../bindings/js/ZonedDateTimeFormatter.d.ts | 6 +- .../bindings/js/ZonedDateTimeFormatter.mjs | 2 +- ffi/capi/bindings/js/index.d.ts | 6 +- ffi/capi/bindings/js/index.mjs | 6 +- ffi/capi/src/lib.rs | 4 - ffi/capi/src/metazone_calculator.rs | 35 --- ffi/capi/src/timezone.rs | 55 +++-- ffi/capi/src/zone_offset_calculator.rs | 35 --- ffi/capi/src/zoned_formatter.rs | 14 +- ffi/capi/tests/missing_apis.txt | 1 - tutorials/cpp/datetime.cpp | 6 +- 57 files changed, 730 insertions(+), 1514 deletions(-) delete mode 100644 components/timezone/src/metazone.rs delete mode 100644 components/timezone/src/zone_offset.rs delete mode 100644 ffi/capi/bindings/c/CustomTimeZone.d.h delete mode 100644 ffi/capi/bindings/c/CustomTimeZone.h delete mode 100644 ffi/capi/bindings/c/MetazoneCalculator.d.h delete mode 100644 ffi/capi/bindings/c/MetazoneCalculator.h create mode 100644 ffi/capi/bindings/c/TimeZoneInfo.d.h create mode 100644 ffi/capi/bindings/c/TimeZoneInfo.h delete mode 100644 ffi/capi/bindings/c/ZoneOffsetCalculator.d.h delete mode 100644 ffi/capi/bindings/c/ZoneOffsetCalculator.h delete mode 100644 ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp delete mode 100644 ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.d.hpp delete mode 100644 ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.hpp rename ffi/capi/bindings/cpp/icu4x/{CustomTimeZone.d.hpp => TimeZoneInfo.d.hpp} (63%) create mode 100644 ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp delete mode 100644 ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.d.hpp delete mode 100644 ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.hpp delete mode 100644 ffi/capi/bindings/dart/MetazoneCalculator.g.dart rename ffi/capi/bindings/dart/{CustomTimeZone.g.dart => TimeZoneInfo.g.dart} (61%) delete mode 100644 ffi/capi/bindings/dart/ZoneOffsetCalculator.g.dart rename ffi/capi/bindings/demo_gen/{CustomTimeZone.d.ts => TimeZoneInfo.d.ts} (61%) rename ffi/capi/bindings/demo_gen/{CustomTimeZone.mjs => TimeZoneInfo.mjs} (80%) delete mode 100644 ffi/capi/bindings/js/MetazoneCalculator.d.ts delete mode 100644 ffi/capi/bindings/js/MetazoneCalculator.mjs rename ffi/capi/bindings/js/{CustomTimeZone.d.ts => TimeZoneInfo.d.ts} (80%) rename ffi/capi/bindings/js/{CustomTimeZone.mjs => TimeZoneInfo.mjs} (68%) delete mode 100644 ffi/capi/bindings/js/ZoneOffsetCalculator.d.ts delete mode 100644 ffi/capi/bindings/js/ZoneOffsetCalculator.mjs delete mode 100644 ffi/capi/src/metazone_calculator.rs delete mode 100644 ffi/capi/src/zone_offset_calculator.rs diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index 6d20ff08eb8..ad2f4cea891 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -11,10 +11,9 @@ use crate::{ }; use core::fmt; use fixed_decimal::FixedDecimal; +use icu_calendar::{Date, DateTime, Iso, Time}; use icu_decimal::FixedDecimalFormatter; -use icu_timezone::{ - MetazoneCalculator, TimeZoneBcp47Id, UtcOffset, ZoneOffsetCalculator, ZoneVariant, -}; +use icu_timezone::{provider::MetazoneId, TimeZoneBcp47Id, UtcOffset, ZoneVariant}; use writeable::Writeable; /// All time zone styles that this crate can format @@ -215,6 +214,90 @@ pub(crate) struct TimeZoneDataPayloadsBorrowed<'a> { pub(crate) mz_specific_short: Option<&'a provider::time_zones::MetazoneSpecificNamesV1<'a>>, } +impl ExtractedInput { + fn zone_variant_or_guess( + &self, + time_zone_id: TimeZoneBcp47Id, + local_time: Option<(Date, Time)>, + offset_period: &icu_timezone::provider::ZoneOffsetPeriodV1, + ) -> ZoneVariant { + if let Some(zv) = self.zone_variant.flatten() { + return zv; + } + + let Some(offset) = self.offset.flatten() else { + return ZoneVariant::standard(); + }; + + let dst_offset = { + match offset_period.0.get0(&time_zone_id) { + Some(cursor) => { + let offsets = if let Some((date, time)) = local_time { + let mut offsets = None; + let minutes_since_local_unix_epoch = + DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1_copied().rev() { + if minutes_since_local_unix_epoch + <= ::from_unaligned(*minutes) + { + offsets = Some(id); + } else { + break; + } + } + offsets.unwrap_or_default() // shouldn't happen + } else { + cursor + .iter1() + .map(|(_, v)| zerovec::ule::AsULE::from_unaligned(*v)) + .next_back() + .unwrap_or_default() // shouldn't happen + }; + (offsets.1 != 0) + .then_some(UtcOffset::from_eighths_of_hour(offsets.0 + offsets.1)) + } + None => None, + } + }; + + if Some(offset) == dst_offset { + ZoneVariant::daylight() + } else { + ZoneVariant::standard() + } + } + + fn metazone( + &self, + time_zone_id: TimeZoneBcp47Id, + local_time: Option<(Date, Time)>, + metazone_period: &icu_timezone::provider::MetazonePeriodV1, + ) -> Option { + match metazone_period.0.get0(&time_zone_id) { + Some(cursor) => { + if let Some((date, time)) = local_time { + let mut metazone_id = None; + let minutes_since_local_unix_epoch = + DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1() { + if minutes_since_local_unix_epoch + >= ::from_unaligned(*minutes) + { + metazone_id = id.get() + } else { + break; + } + } + metazone_id + } else { + cursor.iter1().next_back().and_then(|(_, m)| m.get()) + } + } + None => None, + } + } +} + /// Determines which ISO-8601 format should be used to format the timezone offset. #[derive(Debug, Clone, Copy, PartialEq)] #[allow(clippy::exhaustive_enums)] // this type is stable @@ -354,8 +437,11 @@ impl FormatTimeZone for GenericNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let metazone_id = - MetazoneCalculator::new().compute_metazone_from_time_zone(time_zone_id, local_time); + let metazone_id = input.metazone( + time_zone_id, + local_time, + icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, + ); let Some(name) = metazone_id.and_then(|mz| { names @@ -385,15 +471,18 @@ impl FormatTimeZone for SpecificNonLocationFormat { data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(zone_variant) = input.zone_variant else { - return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); + let Some(time_zone_id) = input.time_zone_id else { + return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; let Some(local_time) = input.local_time else { return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); }; - let Some(time_zone_id) = input.time_zone_id else { - return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); - }; + let zone_variant = input.zone_variant_or_guess( + time_zone_id, + local_time, + icu_timezone::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, + ); + let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_specific_long.as_ref(), _ => data_payloads.mz_specific_short.as_ref(), @@ -401,19 +490,11 @@ impl FormatTimeZone for SpecificNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let metazone_id = - MetazoneCalculator::new().compute_metazone_from_time_zone(time_zone_id, local_time); - - let zone_variant = zone_variant.unwrap_or_else(|| { - let (_, dst) = ZoneOffsetCalculator::new() - .compute_offsets_from_time_zone(time_zone_id, local_time) - .unwrap_or_default(); - if dst.is_some() && input.offset == Some(dst) { - ZoneVariant::daylight() - } else { - ZoneVariant::standard() - } - }); + let metazone_id = input.metazone( + time_zone_id, + local_time, + icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, + ); let Some(name) = metazone_id.and_then(|mz| { names @@ -569,9 +650,6 @@ impl FormatTimeZone for SpecificLocationFormat { data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(zone_variant) = input.zone_variant else { - return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); - }; let Some(local_time) = input.local_time else { return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); }; @@ -582,16 +660,11 @@ impl FormatTimeZone for SpecificLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let zone_variant = zone_variant.unwrap_or_else(|| { - let (_, dst) = ZoneOffsetCalculator::new() - .compute_offsets_from_time_zone(time_zone_id, local_time) - .unwrap_or_default(); - if dst.is_some() && input.offset == Some(dst) { - ZoneVariant::daylight() - } else { - ZoneVariant::standard() - } - }); + let zone_variant = input.zone_variant_or_guess( + time_zone_id, + local_time, + icu_timezone::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, + ); if let Some(location) = locations.locations.get(&time_zone_id) { if zone_variant == ZoneVariant::daylight() { @@ -641,8 +714,11 @@ impl FormatTimeZone for GenericPartialLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let metazone_id = - MetazoneCalculator::new().compute_metazone_from_time_zone(time_zone_id, local_time); + let metazone_id = input.metazone( + time_zone_id, + local_time, + icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, + ); let Some(location) = locations.locations.get(&time_zone_id) else { return Ok(Err(FormatTimeZoneError::Fallback)); diff --git a/components/timezone/src/lib.rs b/components/timezone/src/lib.rs index 8985ceb8e3f..b485e7ef9ec 100644 --- a/components/timezone/src/lib.rs +++ b/components/timezone/src/lib.rs @@ -125,12 +125,10 @@ extern crate alloc; mod error; mod ids; -mod metazone; pub mod provider; mod time_zone; mod types; mod windows_tz; -mod zone_offset; mod zoned_datetime; #[cfg(all(feature = "ixdtf", feature = "compiled_data"))] @@ -141,12 +139,10 @@ pub use ids::{ TimeZoneIdMapper, TimeZoneIdMapperBorrowed, TimeZoneIdMapperWithFastCanonicalization, TimeZoneIdMapperWithFastCanonicalizationBorrowed, }; -pub use metazone::MetazoneCalculator; -pub use provider::{MetazoneId, TimeZoneBcp47Id}; +pub use provider::TimeZoneBcp47Id; pub use time_zone::TimeZoneInfo; pub use types::{UtcOffset, ZoneVariant}; pub use windows_tz::{WindowsTimeZoneMapper, WindowsTimeZoneMapperBorrowed}; -pub use zone_offset::ZoneOffsetCalculator; pub use zoned_datetime::CustomZonedDateTime; #[cfg(all(feature = "ixdtf", feature = "compiled_data"))] diff --git a/components/timezone/src/metazone.rs b/components/timezone/src/metazone.rs deleted file mode 100644 index 3c6de42cbe7..00000000000 --- a/components/timezone/src/metazone.rs +++ /dev/null @@ -1,132 +0,0 @@ -// 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::{MetazoneId, TimeZoneBcp47Id}; - -use crate::provider::MetazonePeriodV1Marker; -use icu_calendar::Iso; -use icu_calendar::{Date, DateTime, Time}; -use icu_provider::prelude::*; -use zerovec::ule::AsULE; - -/// [`MetazoneCalculator`] uses data from the [data provider] to calculate metazone id. -/// -/// [data provider]: icu_provider -#[derive(Debug)] -pub struct MetazoneCalculator { - pub(super) metazone_period: DataPayload, -} - -#[cfg(feature = "compiled_data")] -impl Default for MetazoneCalculator { - fn default() -> Self { - Self::new() - } -} - -impl MetazoneCalculator { - /// Constructs a `MetazoneCalculator` using compiled data. - /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* - /// - /// [📚 Help choosing a constructor](icu_provider::constructors) - #[cfg(feature = "compiled_data")] - #[inline] - pub const fn new() -> Self { - MetazoneCalculator { - metazone_period: DataPayload::from_static_ref( - crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, - ), - } - } - - icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError, - functions: [ - new: skip, - try_new_with_any_provider, - try_new_with_buffer_provider, - try_new_unstable, - Self, - ] - ); - - #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::new)] - pub fn try_new_unstable( - provider: &(impl DataProvider + ?Sized), - ) -> Result { - let metazone_period = provider.load(Default::default())?.payload; - Ok(Self { metazone_period }) - } - - /// Calculate metazone id from timezone id and local datetime. - /// - /// # Examples - /// - /// ``` - /// use icu::calendar::DateTime; - /// use icu::timezone::provider::{MetazoneId, TimeZoneBcp47Id}; - /// use icu::timezone::MetazoneCalculator; - /// use tinystr::tinystr; - /// - /// let mzc = MetazoneCalculator::new(); - /// - /// assert_eq!( - /// mzc.compute_metazone_from_time_zone( - /// TimeZoneBcp47Id(tinystr!(8, "gugum")), - /// &DateTime::try_new_iso_datetime(1969, 1, 1, 0, 0, 0).unwrap() - /// ), - /// None - /// ); - /// - /// assert_eq!( - /// mzc.compute_metazone_from_time_zone( - /// TimeZoneBcp47Id(tinystr!(8, "gugum")), - /// &DateTime::try_new_iso_datetime(1970, 1, 1, 0, 0, 0).unwrap() - /// ), - /// Some(MetazoneId(tinystr!(4, "guam"))) - /// ); - /// - /// assert_eq!( - /// mzc.compute_metazone_from_time_zone( - /// TimeZoneBcp47Id(tinystr!(8, "gugum")), - /// &DateTime::try_new_iso_datetime(1975, 1, 1, 0, 0, 0).unwrap() - /// ), - /// Some(MetazoneId(tinystr!(4, "guam"))) - /// ); - /// - /// assert_eq!( - /// mzc.compute_metazone_from_time_zone( - /// TimeZoneBcp47Id(tinystr!(8, "gugum")), - /// &DateTime::try_new_iso_datetime(2000, 12, 22, 15, 0, 0).unwrap() - /// ), - /// Some(MetazoneId(tinystr!(4, "cham"))) - /// ); - /// ``` - pub fn compute_metazone_from_time_zone( - &self, - time_zone_id: TimeZoneBcp47Id, - local_time: Option<(Date, Time)>, - ) -> Option { - match self.metazone_period.get().0.get0(&time_zone_id) { - Some(cursor) => { - if let Some((date, time)) = local_time { - let mut metazone_id = None; - let minutes_since_local_unix_epoch = - DateTime { date, time }.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1() { - if minutes_since_local_unix_epoch >= i32::from_unaligned(*minutes) { - metazone_id = id.get() - } else { - break; - } - } - metazone_id - } else { - cursor.iter1().next_back().and_then(|(_, m)| m.get()) - } - } - None => None, - } - } -} diff --git a/components/timezone/src/zone_offset.rs b/components/timezone/src/zone_offset.rs deleted file mode 100644 index f63f04be419..00000000000 --- a/components/timezone/src/zone_offset.rs +++ /dev/null @@ -1,129 +0,0 @@ -// 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::ZoneOffsetPeriodV1Marker; -use crate::{TimeZoneBcp47Id, UtcOffset}; -use icu_calendar::Iso; -use icu_calendar::{Date, DateTime, Time}; -use icu_provider::prelude::*; - -/// [`ZoneOffsetCalculator`] uses data from the [data provider] to calculate time zone offsets. -/// -/// [data provider]: icu_provider -#[derive(Debug)] -pub struct ZoneOffsetCalculator { - pub(super) offset_period: DataPayload, -} - -#[cfg(feature = "compiled_data")] -impl Default for ZoneOffsetCalculator { - fn default() -> Self { - Self::new() - } -} - -impl ZoneOffsetCalculator { - /// Constructs a `ZoneOffsetCalculator` using compiled data. - /// - /// ✨ *Enabled with the `compiled_data` Cargo feature.* - /// - /// [📚 Help choosing a constructor](icu_provider::constructors) - #[cfg(feature = "compiled_data")] - #[inline] - pub const fn new() -> Self { - ZoneOffsetCalculator { - offset_period: DataPayload::from_static_ref( - crate::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, - ), - } - } - - icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError, - functions: [ - new: skip, - try_new_with_any_provider, - try_new_with_buffer_provider, - try_new_unstable, - Self, - ] - ); - - #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::new)] - pub fn try_new_unstable( - provider: &(impl DataProvider + ?Sized), - ) -> Result { - let metazone_period = provider.load(Default::default())?.payload; - Ok(Self { - offset_period: metazone_period, - }) - } - - /// Calculate zone offsets from timezone and local datetime. - /// - /// # Examples - /// - /// ``` - /// use icu::calendar::DateTime; - /// use icu::timezone::TimeZoneBcp47Id; - /// use icu::timezone::ZoneOffsetCalculator; - /// use icu::timezone::UtcOffset; - /// use tinystr::tinystr; - /// - /// let zoc = ZoneOffsetCalculator::new(); - /// - /// // America/Denver observes DST - /// assert_eq!( - /// zoc.compute_offsets_from_time_zone( - /// TimeZoneBcp47Id(tinystr!(8, "usden")), - /// &DateTime::try_new_iso_datetime(2024, 1, 1, 0, 0, 0).unwrap() - /// ), - /// Some((UtcOffset::try_from_seconds(-7 * 3600).unwrap(), Some(UtcOffset::try_from_seconds(-6 * 3600).unwrap()))) - /// ); - /// - /// // America/Phoenix does not - /// assert_eq!( - /// zoc.compute_offsets_from_time_zone( - /// TimeZoneBcp47Id(tinystr!(8, "usphx")), - /// &DateTime::try_new_iso_datetime(2024, 1, 1, 0, 0, 0).unwrap() - /// ), - /// Some((UtcOffset::try_from_seconds(-7 * 3600).unwrap(), None)) - /// ); - /// ``` - pub fn compute_offsets_from_time_zone( - &self, - time_zone_id: TimeZoneBcp47Id, - local_time: Option<(Date, Time)>, - ) -> Option<(UtcOffset, Option)> { - use zerovec::ule::AsULE; - match self.offset_period.get().0.get0(&time_zone_id) { - Some(cursor) => { - let offsets = if let Some((date, time)) = local_time { - let mut offsets = None; - let minutes_since_local_unix_epoch = - DateTime { date, time }.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1_copied().rev() { - if minutes_since_local_unix_epoch <= i32::from_unaligned(*minutes) { - offsets = Some(id); - } else { - break; - } - } - offsets? - } else { - cursor - .iter1() - .map(|(_, v)| <_>::from_unaligned(*v)) - .next_back() - .unwrap_or_default() // shouldn't happen - }; - Some(( - UtcOffset::from_eighths_of_hour(offsets.0), - (offsets.1 != 0) - .then_some(UtcOffset::from_eighths_of_hour(offsets.0 + offsets.1)), - )) - } - None => None, - } - } -} diff --git a/ffi/capi/bindings/c/CustomTimeZone.d.h b/ffi/capi/bindings/c/CustomTimeZone.d.h deleted file mode 100644 index 1aa32727a20..00000000000 --- a/ffi/capi/bindings/c/CustomTimeZone.d.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef CustomTimeZone_D_H -#define CustomTimeZone_D_H - -#include -#include -#include -#include -#include "diplomat_runtime.h" - - - - - -typedef struct CustomTimeZone CustomTimeZone; - - - - -#endif // CustomTimeZone_D_H diff --git a/ffi/capi/bindings/c/CustomTimeZone.h b/ffi/capi/bindings/c/CustomTimeZone.h deleted file mode 100644 index da3a164e24a..00000000000 --- a/ffi/capi/bindings/c/CustomTimeZone.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef CustomTimeZone_H -#define CustomTimeZone_H - -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "TimeZoneIdMapper.d.h" - -#include "CustomTimeZone.d.h" - - - - - - -CustomTimeZone* icu4x_CustomTimeZone_unknown_mv1(void); - -CustomTimeZone* icu4x_CustomTimeZone_utc_mv1(void); - -typedef struct icu4x_CustomTimeZone_try_set_offset_seconds_mv1_result { bool is_ok;} icu4x_CustomTimeZone_try_set_offset_seconds_mv1_result; -icu4x_CustomTimeZone_try_set_offset_seconds_mv1_result icu4x_CustomTimeZone_try_set_offset_seconds_mv1(CustomTimeZone* self, int32_t offset_seconds); - -void icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1(CustomTimeZone* self, int8_t offset_eighths_of_hour); - -typedef struct icu4x_CustomTimeZone_offset_eighths_of_hour_mv1_result {union {int8_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_eighths_of_hour_mv1_result; -icu4x_CustomTimeZone_offset_eighths_of_hour_mv1_result icu4x_CustomTimeZone_offset_eighths_of_hour_mv1(const CustomTimeZone* self); - -void icu4x_CustomTimeZone_clear_offset_mv1(CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_offset_seconds_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_seconds_mv1_result; -icu4x_CustomTimeZone_offset_seconds_mv1_result icu4x_CustomTimeZone_offset_seconds_mv1(const CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_is_offset_positive_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_offset_positive_mv1_result; -icu4x_CustomTimeZone_is_offset_positive_mv1_result icu4x_CustomTimeZone_is_offset_positive_mv1(const CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_is_offset_zero_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_offset_zero_mv1_result; -icu4x_CustomTimeZone_is_offset_zero_mv1_result icu4x_CustomTimeZone_is_offset_zero_mv1(const CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_offset_hours_part_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_hours_part_mv1_result; -icu4x_CustomTimeZone_offset_hours_part_mv1_result icu4x_CustomTimeZone_offset_hours_part_mv1(const CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_offset_minutes_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_minutes_part_mv1_result; -icu4x_CustomTimeZone_offset_minutes_part_mv1_result icu4x_CustomTimeZone_offset_minutes_part_mv1(const CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_offset_seconds_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_seconds_part_mv1_result; -icu4x_CustomTimeZone_offset_seconds_part_mv1_result icu4x_CustomTimeZone_offset_seconds_part_mv1(const CustomTimeZone* self); - -void icu4x_CustomTimeZone_set_time_zone_id_mv1(CustomTimeZone* self, DiplomatStringView id); - -void icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(CustomTimeZone* self, const TimeZoneIdMapper* mapper, DiplomatStringView id); - -void icu4x_CustomTimeZone_time_zone_id_mv1(const CustomTimeZone* self, DiplomatWrite* write); - -typedef struct icu4x_CustomTimeZone_try_set_zone_variant_mv1_result { bool is_ok;} icu4x_CustomTimeZone_try_set_zone_variant_mv1_result; -icu4x_CustomTimeZone_try_set_zone_variant_mv1_result icu4x_CustomTimeZone_try_set_zone_variant_mv1(CustomTimeZone* self, DiplomatStringView id); - -void icu4x_CustomTimeZone_clear_zone_variant_mv1(CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_zone_variant_mv1_result { bool is_ok;} icu4x_CustomTimeZone_zone_variant_mv1_result; -icu4x_CustomTimeZone_zone_variant_mv1_result icu4x_CustomTimeZone_zone_variant_mv1(const CustomTimeZone* self, DiplomatWrite* write); - -void icu4x_CustomTimeZone_set_standard_time_mv1(CustomTimeZone* self); - -void icu4x_CustomTimeZone_set_daylight_time_mv1(CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_is_standard_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_standard_time_mv1_result; -icu4x_CustomTimeZone_is_standard_time_mv1_result icu4x_CustomTimeZone_is_standard_time_mv1(const CustomTimeZone* self); - -typedef struct icu4x_CustomTimeZone_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_daylight_time_mv1_result; -icu4x_CustomTimeZone_is_daylight_time_mv1_result icu4x_CustomTimeZone_is_daylight_time_mv1(const CustomTimeZone* self); - - -void icu4x_CustomTimeZone_destroy_mv1(CustomTimeZone* self); - - - - - -#endif // CustomTimeZone_H diff --git a/ffi/capi/bindings/c/GregorianZonedDateTimeFormatter.h b/ffi/capi/bindings/c/GregorianZonedDateTimeFormatter.h index cf013ceb128..d73d2db9422 100644 --- a/ffi/capi/bindings/c/GregorianZonedDateTimeFormatter.h +++ b/ffi/capi/bindings/c/GregorianZonedDateTimeFormatter.h @@ -7,12 +7,12 @@ #include #include "diplomat_runtime.h" -#include "CustomTimeZone.d.h" #include "DataProvider.d.h" #include "DateTimeLength.d.h" #include "Error.d.h" #include "IsoDateTime.d.h" #include "Locale.d.h" +#include "TimeZoneInfo.d.h" #include "GregorianZonedDateTimeFormatter.d.h" @@ -24,7 +24,7 @@ typedef struct icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1_result {union {GregorianZonedDateTimeFormatter* ok; Error err;}; bool is_ok;} icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1_result; icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1_result icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1(const DataProvider* provider, const Locale* locale, DateTimeLength length); -void icu4x_GregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const GregorianZonedDateTimeFormatter* self, const IsoDateTime* datetime, const CustomTimeZone* time_zone, DiplomatWrite* write); +void icu4x_GregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const GregorianZonedDateTimeFormatter* self, const IsoDateTime* datetime, const TimeZoneInfo* time_zone, DiplomatWrite* write); void icu4x_GregorianZonedDateTimeFormatter_destroy_mv1(GregorianZonedDateTimeFormatter* self); diff --git a/ffi/capi/bindings/c/MetazoneCalculator.d.h b/ffi/capi/bindings/c/MetazoneCalculator.d.h deleted file mode 100644 index 4c36c75d5fb..00000000000 --- a/ffi/capi/bindings/c/MetazoneCalculator.d.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef MetazoneCalculator_D_H -#define MetazoneCalculator_D_H - -#include -#include -#include -#include -#include "diplomat_runtime.h" - - - - - -typedef struct MetazoneCalculator MetazoneCalculator; - - - - -#endif // MetazoneCalculator_D_H diff --git a/ffi/capi/bindings/c/MetazoneCalculator.h b/ffi/capi/bindings/c/MetazoneCalculator.h deleted file mode 100644 index 807fcc5f36b..00000000000 --- a/ffi/capi/bindings/c/MetazoneCalculator.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef MetazoneCalculator_H -#define MetazoneCalculator_H - -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "DataError.d.h" -#include "DataProvider.d.h" - -#include "MetazoneCalculator.d.h" - - - - - - -typedef struct icu4x_MetazoneCalculator_create_mv1_result {union {MetazoneCalculator* ok; DataError err;}; bool is_ok;} icu4x_MetazoneCalculator_create_mv1_result; -icu4x_MetazoneCalculator_create_mv1_result icu4x_MetazoneCalculator_create_mv1(const DataProvider* provider); - - -void icu4x_MetazoneCalculator_destroy_mv1(MetazoneCalculator* self); - - - - - -#endif // MetazoneCalculator_H diff --git a/ffi/capi/bindings/c/TimeZoneInfo.d.h b/ffi/capi/bindings/c/TimeZoneInfo.d.h new file mode 100644 index 00000000000..2eff6b782b3 --- /dev/null +++ b/ffi/capi/bindings/c/TimeZoneInfo.d.h @@ -0,0 +1,19 @@ +#ifndef TimeZoneInfo_D_H +#define TimeZoneInfo_D_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + + + + + +typedef struct TimeZoneInfo TimeZoneInfo; + + + + +#endif // TimeZoneInfo_D_H diff --git a/ffi/capi/bindings/c/TimeZoneInfo.h b/ffi/capi/bindings/c/TimeZoneInfo.h new file mode 100644 index 00000000000..a6ededf97a4 --- /dev/null +++ b/ffi/capi/bindings/c/TimeZoneInfo.h @@ -0,0 +1,85 @@ +#ifndef TimeZoneInfo_H +#define TimeZoneInfo_H + +#include +#include +#include +#include +#include "diplomat_runtime.h" + +#include "TimeZoneIdMapper.d.h" + +#include "TimeZoneInfo.d.h" + + + + + + +TimeZoneInfo* icu4x_TimeZoneInfo_unknown_mv1(void); + +TimeZoneInfo* icu4x_TimeZoneInfo_utc_mv1(void); + +typedef struct icu4x_TimeZoneInfo_try_set_offset_seconds_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_try_set_offset_seconds_mv1_result; +icu4x_TimeZoneInfo_try_set_offset_seconds_mv1_result icu4x_TimeZoneInfo_try_set_offset_seconds_mv1(TimeZoneInfo* self, int32_t offset_seconds); + +void icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1(TimeZoneInfo* self, int8_t offset_eighths_of_hour); + +typedef struct icu4x_TimeZoneInfo_try_set_offset_str_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_try_set_offset_str_mv1_result; +icu4x_TimeZoneInfo_try_set_offset_str_mv1_result icu4x_TimeZoneInfo_try_set_offset_str_mv1(TimeZoneInfo* self, DiplomatStringView offset); + +typedef struct icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1_result {union {int8_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1_result; +icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1_result icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1(const TimeZoneInfo* self); + +void icu4x_TimeZoneInfo_clear_offset_mv1(TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_offset_seconds_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_seconds_mv1_result; +icu4x_TimeZoneInfo_offset_seconds_mv1_result icu4x_TimeZoneInfo_offset_seconds_mv1(const TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_is_offset_positive_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_offset_positive_mv1_result; +icu4x_TimeZoneInfo_is_offset_positive_mv1_result icu4x_TimeZoneInfo_is_offset_positive_mv1(const TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_is_offset_zero_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_offset_zero_mv1_result; +icu4x_TimeZoneInfo_is_offset_zero_mv1_result icu4x_TimeZoneInfo_is_offset_zero_mv1(const TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_offset_hours_part_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_hours_part_mv1_result; +icu4x_TimeZoneInfo_offset_hours_part_mv1_result icu4x_TimeZoneInfo_offset_hours_part_mv1(const TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_offset_minutes_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_minutes_part_mv1_result; +icu4x_TimeZoneInfo_offset_minutes_part_mv1_result icu4x_TimeZoneInfo_offset_minutes_part_mv1(const TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_offset_seconds_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_seconds_part_mv1_result; +icu4x_TimeZoneInfo_offset_seconds_part_mv1_result icu4x_TimeZoneInfo_offset_seconds_part_mv1(const TimeZoneInfo* self); + +void icu4x_TimeZoneInfo_set_time_zone_id_mv1(TimeZoneInfo* self, DiplomatStringView id); + +void icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1(TimeZoneInfo* self, const TimeZoneIdMapper* mapper, DiplomatStringView id); + +void icu4x_TimeZoneInfo_time_zone_id_mv1(const TimeZoneInfo* self, DiplomatWrite* write); + +typedef struct icu4x_TimeZoneInfo_try_set_zone_variant_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_try_set_zone_variant_mv1_result; +icu4x_TimeZoneInfo_try_set_zone_variant_mv1_result icu4x_TimeZoneInfo_try_set_zone_variant_mv1(TimeZoneInfo* self, DiplomatStringView id); + +void icu4x_TimeZoneInfo_clear_zone_variant_mv1(TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_zone_variant_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_zone_variant_mv1_result; +icu4x_TimeZoneInfo_zone_variant_mv1_result icu4x_TimeZoneInfo_zone_variant_mv1(const TimeZoneInfo* self, DiplomatWrite* write); + +void icu4x_TimeZoneInfo_set_standard_time_mv1(TimeZoneInfo* self); + +void icu4x_TimeZoneInfo_set_daylight_time_mv1(TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_is_standard_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_standard_time_mv1_result; +icu4x_TimeZoneInfo_is_standard_time_mv1_result icu4x_TimeZoneInfo_is_standard_time_mv1(const TimeZoneInfo* self); + +typedef struct icu4x_TimeZoneInfo_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_daylight_time_mv1_result; +icu4x_TimeZoneInfo_is_daylight_time_mv1_result icu4x_TimeZoneInfo_is_daylight_time_mv1(const TimeZoneInfo* self); + + +void icu4x_TimeZoneInfo_destroy_mv1(TimeZoneInfo* self); + + + + + +#endif // TimeZoneInfo_H diff --git a/ffi/capi/bindings/c/ZoneOffsetCalculator.d.h b/ffi/capi/bindings/c/ZoneOffsetCalculator.d.h deleted file mode 100644 index 9ca7fa94480..00000000000 --- a/ffi/capi/bindings/c/ZoneOffsetCalculator.d.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef ZoneOffsetCalculator_D_H -#define ZoneOffsetCalculator_D_H - -#include -#include -#include -#include -#include "diplomat_runtime.h" - - - - - -typedef struct ZoneOffsetCalculator ZoneOffsetCalculator; - - - - -#endif // ZoneOffsetCalculator_D_H diff --git a/ffi/capi/bindings/c/ZoneOffsetCalculator.h b/ffi/capi/bindings/c/ZoneOffsetCalculator.h deleted file mode 100644 index 9f6b2d00c37..00000000000 --- a/ffi/capi/bindings/c/ZoneOffsetCalculator.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ZoneOffsetCalculator_H -#define ZoneOffsetCalculator_H - -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "DataError.d.h" -#include "DataProvider.d.h" - -#include "ZoneOffsetCalculator.d.h" - - - - - - -typedef struct icu4x_ZoneOffsetCalculator_create_mv1_result {union {ZoneOffsetCalculator* ok; DataError err;}; bool is_ok;} icu4x_ZoneOffsetCalculator_create_mv1_result; -icu4x_ZoneOffsetCalculator_create_mv1_result icu4x_ZoneOffsetCalculator_create_mv1(const DataProvider* provider); - - -void icu4x_ZoneOffsetCalculator_destroy_mv1(ZoneOffsetCalculator* self); - - - - - -#endif // ZoneOffsetCalculator_H diff --git a/ffi/capi/bindings/c/ZonedDateTimeFormatter.h b/ffi/capi/bindings/c/ZonedDateTimeFormatter.h index 0bb003ba7cc..99616873d45 100644 --- a/ffi/capi/bindings/c/ZonedDateTimeFormatter.h +++ b/ffi/capi/bindings/c/ZonedDateTimeFormatter.h @@ -7,13 +7,13 @@ #include #include "diplomat_runtime.h" -#include "CustomTimeZone.d.h" #include "DataProvider.d.h" #include "DateTime.d.h" #include "DateTimeLength.d.h" #include "Error.d.h" #include "IsoDateTime.d.h" #include "Locale.d.h" +#include "TimeZoneInfo.d.h" #include "ZonedDateTimeFormatter.d.h" @@ -26,10 +26,10 @@ typedef struct icu4x_ZonedDateTimeFormatter_create_with_length_mv1_result {union icu4x_ZonedDateTimeFormatter_create_with_length_mv1_result icu4x_ZonedDateTimeFormatter_create_with_length_mv1(const DataProvider* provider, const Locale* locale, DateTimeLength length); typedef struct icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result {union { Error err;}; bool is_ok;} icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result; -icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1(const ZonedDateTimeFormatter* self, const DateTime* datetime, const CustomTimeZone* time_zone, DiplomatWrite* write); +icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1(const ZonedDateTimeFormatter* self, const DateTime* datetime, const TimeZoneInfo* time_zone, DiplomatWrite* write); typedef struct icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result {union { Error err;}; bool is_ok;} icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result; -icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const ZonedDateTimeFormatter* self, const IsoDateTime* datetime, const CustomTimeZone* time_zone, DiplomatWrite* write); +icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const ZonedDateTimeFormatter* self, const IsoDateTime* datetime, const TimeZoneInfo* time_zone, DiplomatWrite* write); void icu4x_ZonedDateTimeFormatter_destroy_mv1(ZonedDateTimeFormatter* self); diff --git a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp b/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp deleted file mode 100644 index 2b65ee886b2..00000000000 --- a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.hpp +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef icu4x_CustomTimeZone_HPP -#define icu4x_CustomTimeZone_HPP - -#include "CustomTimeZone.d.hpp" - -#include -#include -#include -#include -#include -#include -#include "../diplomat_runtime.hpp" -#include "TimeZoneIdMapper.hpp" -#include "TimeZoneInvalidOffsetError.hpp" - - -namespace icu4x { -namespace capi { - extern "C" { - - icu4x::capi::CustomTimeZone* icu4x_CustomTimeZone_unknown_mv1(void); - - icu4x::capi::CustomTimeZone* icu4x_CustomTimeZone_utc_mv1(void); - - typedef struct icu4x_CustomTimeZone_try_set_offset_seconds_mv1_result { bool is_ok;} icu4x_CustomTimeZone_try_set_offset_seconds_mv1_result; - icu4x_CustomTimeZone_try_set_offset_seconds_mv1_result icu4x_CustomTimeZone_try_set_offset_seconds_mv1(icu4x::capi::CustomTimeZone* self, int32_t offset_seconds); - - void icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1(icu4x::capi::CustomTimeZone* self, int8_t offset_eighths_of_hour); - - typedef struct icu4x_CustomTimeZone_offset_eighths_of_hour_mv1_result {union {int8_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_eighths_of_hour_mv1_result; - icu4x_CustomTimeZone_offset_eighths_of_hour_mv1_result icu4x_CustomTimeZone_offset_eighths_of_hour_mv1(const icu4x::capi::CustomTimeZone* self); - - void icu4x_CustomTimeZone_clear_offset_mv1(icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_offset_seconds_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_seconds_mv1_result; - icu4x_CustomTimeZone_offset_seconds_mv1_result icu4x_CustomTimeZone_offset_seconds_mv1(const icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_is_offset_positive_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_offset_positive_mv1_result; - icu4x_CustomTimeZone_is_offset_positive_mv1_result icu4x_CustomTimeZone_is_offset_positive_mv1(const icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_is_offset_zero_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_offset_zero_mv1_result; - icu4x_CustomTimeZone_is_offset_zero_mv1_result icu4x_CustomTimeZone_is_offset_zero_mv1(const icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_offset_hours_part_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_hours_part_mv1_result; - icu4x_CustomTimeZone_offset_hours_part_mv1_result icu4x_CustomTimeZone_offset_hours_part_mv1(const icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_offset_minutes_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_minutes_part_mv1_result; - icu4x_CustomTimeZone_offset_minutes_part_mv1_result icu4x_CustomTimeZone_offset_minutes_part_mv1(const icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_offset_seconds_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_CustomTimeZone_offset_seconds_part_mv1_result; - icu4x_CustomTimeZone_offset_seconds_part_mv1_result icu4x_CustomTimeZone_offset_seconds_part_mv1(const icu4x::capi::CustomTimeZone* self); - - void icu4x_CustomTimeZone_set_time_zone_id_mv1(icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatStringView id); - - void icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(icu4x::capi::CustomTimeZone* self, const icu4x::capi::TimeZoneIdMapper* mapper, diplomat::capi::DiplomatStringView id); - - void icu4x_CustomTimeZone_time_zone_id_mv1(const icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatWrite* write); - - typedef struct icu4x_CustomTimeZone_try_set_zone_variant_mv1_result { bool is_ok;} icu4x_CustomTimeZone_try_set_zone_variant_mv1_result; - icu4x_CustomTimeZone_try_set_zone_variant_mv1_result icu4x_CustomTimeZone_try_set_zone_variant_mv1(icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatStringView id); - - void icu4x_CustomTimeZone_clear_zone_variant_mv1(icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_zone_variant_mv1_result { bool is_ok;} icu4x_CustomTimeZone_zone_variant_mv1_result; - icu4x_CustomTimeZone_zone_variant_mv1_result icu4x_CustomTimeZone_zone_variant_mv1(const icu4x::capi::CustomTimeZone* self, diplomat::capi::DiplomatWrite* write); - - void icu4x_CustomTimeZone_set_standard_time_mv1(icu4x::capi::CustomTimeZone* self); - - void icu4x_CustomTimeZone_set_daylight_time_mv1(icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_is_standard_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_standard_time_mv1_result; - icu4x_CustomTimeZone_is_standard_time_mv1_result icu4x_CustomTimeZone_is_standard_time_mv1(const icu4x::capi::CustomTimeZone* self); - - typedef struct icu4x_CustomTimeZone_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_CustomTimeZone_is_daylight_time_mv1_result; - icu4x_CustomTimeZone_is_daylight_time_mv1_result icu4x_CustomTimeZone_is_daylight_time_mv1(const icu4x::capi::CustomTimeZone* self); - - - void icu4x_CustomTimeZone_destroy_mv1(CustomTimeZone* self); - - } // extern "C" -} // namespace capi -} // namespace - -inline std::unique_ptr icu4x::CustomTimeZone::unknown() { - auto result = icu4x::capi::icu4x_CustomTimeZone_unknown_mv1(); - return std::unique_ptr(icu4x::CustomTimeZone::FromFFI(result)); -} - -inline std::unique_ptr icu4x::CustomTimeZone::utc() { - auto result = icu4x::capi::icu4x_CustomTimeZone_utc_mv1(); - return std::unique_ptr(icu4x::CustomTimeZone::FromFFI(result)); -} - -inline diplomat::result icu4x::CustomTimeZone::try_set_offset_seconds(int32_t offset_seconds) { - auto result = icu4x::capi::icu4x_CustomTimeZone_try_set_offset_seconds_mv1(this->AsFFI(), - offset_seconds); - return result.is_ok ? diplomat::result(diplomat::Ok()) : diplomat::result(diplomat::Err(icu4x::TimeZoneInvalidOffsetError {})); -} - -inline void icu4x::CustomTimeZone::set_offset_eighths_of_hour(int8_t offset_eighths_of_hour) { - icu4x::capi::icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1(this->AsFFI(), - offset_eighths_of_hour); -} - -inline std::optional icu4x::CustomTimeZone::offset_eighths_of_hour() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_offset_eighths_of_hour_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline void icu4x::CustomTimeZone::clear_offset() { - icu4x::capi::icu4x_CustomTimeZone_clear_offset_mv1(this->AsFFI()); -} - -inline std::optional icu4x::CustomTimeZone::offset_seconds() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_offset_seconds_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline std::optional icu4x::CustomTimeZone::is_offset_positive() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_is_offset_positive_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline std::optional icu4x::CustomTimeZone::is_offset_zero() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_is_offset_zero_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline std::optional icu4x::CustomTimeZone::offset_hours_part() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_offset_hours_part_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline std::optional icu4x::CustomTimeZone::offset_minutes_part() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_offset_minutes_part_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline std::optional icu4x::CustomTimeZone::offset_seconds_part() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_offset_seconds_part_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline void icu4x::CustomTimeZone::set_time_zone_id(std::string_view id) { - icu4x::capi::icu4x_CustomTimeZone_set_time_zone_id_mv1(this->AsFFI(), - {id.data(), id.size()}); -} - -inline void icu4x::CustomTimeZone::set_iana_time_zone_id(const icu4x::TimeZoneIdMapper& mapper, std::string_view id) { - icu4x::capi::icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(this->AsFFI(), - mapper.AsFFI(), - {id.data(), id.size()}); -} - -inline std::string icu4x::CustomTimeZone::time_zone_id() const { - std::string output; - diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); - icu4x::capi::icu4x_CustomTimeZone_time_zone_id_mv1(this->AsFFI(), - &write); - return output; -} - -inline std::optional icu4x::CustomTimeZone::try_set_zone_variant(std::string_view id) { - auto result = icu4x::capi::icu4x_CustomTimeZone_try_set_zone_variant_mv1(this->AsFFI(), - {id.data(), id.size()}); - return result.is_ok ? std::optional() : std::nullopt; -} - -inline void icu4x::CustomTimeZone::clear_zone_variant() { - icu4x::capi::icu4x_CustomTimeZone_clear_zone_variant_mv1(this->AsFFI()); -} - -inline std::optional icu4x::CustomTimeZone::zone_variant() const { - std::string output; - diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); - auto result = icu4x::capi::icu4x_CustomTimeZone_zone_variant_mv1(this->AsFFI(), - &write); - return result.is_ok ? std::optional(std::move(output)) : std::nullopt; -} - -inline void icu4x::CustomTimeZone::set_standard_time() { - icu4x::capi::icu4x_CustomTimeZone_set_standard_time_mv1(this->AsFFI()); -} - -inline void icu4x::CustomTimeZone::set_daylight_time() { - icu4x::capi::icu4x_CustomTimeZone_set_daylight_time_mv1(this->AsFFI()); -} - -inline std::optional icu4x::CustomTimeZone::is_standard_time() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_is_standard_time_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline std::optional icu4x::CustomTimeZone::is_daylight_time() const { - auto result = icu4x::capi::icu4x_CustomTimeZone_is_daylight_time_mv1(this->AsFFI()); - return result.is_ok ? std::optional(result.ok) : std::nullopt; -} - -inline const icu4x::capi::CustomTimeZone* icu4x::CustomTimeZone::AsFFI() const { - return reinterpret_cast(this); -} - -inline icu4x::capi::CustomTimeZone* icu4x::CustomTimeZone::AsFFI() { - return reinterpret_cast(this); -} - -inline const icu4x::CustomTimeZone* icu4x::CustomTimeZone::FromFFI(const icu4x::capi::CustomTimeZone* ptr) { - return reinterpret_cast(ptr); -} - -inline icu4x::CustomTimeZone* icu4x::CustomTimeZone::FromFFI(icu4x::capi::CustomTimeZone* ptr) { - return reinterpret_cast(ptr); -} - -inline void icu4x::CustomTimeZone::operator delete(void* ptr) { - icu4x::capi::icu4x_CustomTimeZone_destroy_mv1(reinterpret_cast(ptr)); -} - - -#endif // icu4x_CustomTimeZone_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.d.hpp b/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.d.hpp index bed29d0eefd..9fa4fc3c71c 100644 --- a/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.d.hpp +++ b/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.d.hpp @@ -10,8 +10,6 @@ #include "../diplomat_runtime.hpp" namespace icu4x { -namespace capi { struct CustomTimeZone; } -class CustomTimeZone; namespace capi { struct DataProvider; } class DataProvider; namespace capi { struct GregorianZonedDateTimeFormatter; } @@ -20,6 +18,8 @@ namespace capi { struct IsoDateTime; } class IsoDateTime; namespace capi { struct Locale; } class Locale; +namespace capi { struct TimeZoneInfo; } +class TimeZoneInfo; class DateTimeLength; class Error; } @@ -37,7 +37,7 @@ class GregorianZonedDateTimeFormatter { inline static diplomat::result, icu4x::Error> create_with_length(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::DateTimeLength length); - inline std::string format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::CustomTimeZone& time_zone) const; + inline std::string format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::TimeZoneInfo& time_zone) const; inline const icu4x::capi::GregorianZonedDateTimeFormatter* AsFFI() const; inline icu4x::capi::GregorianZonedDateTimeFormatter* AsFFI(); diff --git a/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.hpp b/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.hpp index 7b3a9935d34..070ebe23d85 100644 --- a/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.hpp +++ b/ffi/capi/bindings/cpp/icu4x/GregorianZonedDateTimeFormatter.hpp @@ -10,12 +10,12 @@ #include #include #include "../diplomat_runtime.hpp" -#include "CustomTimeZone.hpp" #include "DataProvider.hpp" #include "DateTimeLength.hpp" #include "Error.hpp" #include "IsoDateTime.hpp" #include "Locale.hpp" +#include "TimeZoneInfo.hpp" namespace icu4x { @@ -25,7 +25,7 @@ namespace capi { typedef struct icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1_result {union {icu4x::capi::GregorianZonedDateTimeFormatter* ok; icu4x::capi::Error err;}; bool is_ok;} icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1_result; icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1_result icu4x_GregorianZonedDateTimeFormatter_create_with_length_mv1(const icu4x::capi::DataProvider* provider, const icu4x::capi::Locale* locale, icu4x::capi::DateTimeLength length); - void icu4x_GregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const icu4x::capi::GregorianZonedDateTimeFormatter* self, const icu4x::capi::IsoDateTime* datetime, const icu4x::capi::CustomTimeZone* time_zone, diplomat::capi::DiplomatWrite* write); + void icu4x_GregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const icu4x::capi::GregorianZonedDateTimeFormatter* self, const icu4x::capi::IsoDateTime* datetime, const icu4x::capi::TimeZoneInfo* time_zone, diplomat::capi::DiplomatWrite* write); void icu4x_GregorianZonedDateTimeFormatter_destroy_mv1(GregorianZonedDateTimeFormatter* self); @@ -41,7 +41,7 @@ inline diplomat::result, return result.is_ok ? diplomat::result, icu4x::Error>(diplomat::Ok>(std::unique_ptr(icu4x::GregorianZonedDateTimeFormatter::FromFFI(result.ok)))) : diplomat::result, icu4x::Error>(diplomat::Err(icu4x::Error::FromFFI(result.err))); } -inline std::string icu4x::GregorianZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::CustomTimeZone& time_zone) const { +inline std::string icu4x::GregorianZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::TimeZoneInfo& time_zone) const { std::string output; diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); icu4x::capi::icu4x_GregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(this->AsFFI(), diff --git a/ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.d.hpp b/ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.d.hpp deleted file mode 100644 index a60308a2493..00000000000 --- a/ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.d.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef icu4x_MetazoneCalculator_D_HPP -#define icu4x_MetazoneCalculator_D_HPP - -#include -#include -#include -#include -#include -#include -#include "../diplomat_runtime.hpp" - -namespace icu4x { -namespace capi { struct DataProvider; } -class DataProvider; -namespace capi { struct MetazoneCalculator; } -class MetazoneCalculator; -class DataError; -} - - -namespace icu4x { -namespace capi { - struct MetazoneCalculator; -} // namespace capi -} // namespace - -namespace icu4x { -class MetazoneCalculator { -public: - - inline static diplomat::result, icu4x::DataError> create(const icu4x::DataProvider& provider); - - inline const icu4x::capi::MetazoneCalculator* AsFFI() const; - inline icu4x::capi::MetazoneCalculator* AsFFI(); - inline static const icu4x::MetazoneCalculator* FromFFI(const icu4x::capi::MetazoneCalculator* ptr); - inline static icu4x::MetazoneCalculator* FromFFI(icu4x::capi::MetazoneCalculator* ptr); - inline static void operator delete(void* ptr); -private: - MetazoneCalculator() = delete; - MetazoneCalculator(const icu4x::MetazoneCalculator&) = delete; - MetazoneCalculator(icu4x::MetazoneCalculator&&) noexcept = delete; - MetazoneCalculator operator=(const icu4x::MetazoneCalculator&) = delete; - MetazoneCalculator operator=(icu4x::MetazoneCalculator&&) noexcept = delete; - static void operator delete[](void*, size_t) = delete; -}; - -} // namespace -#endif // icu4x_MetazoneCalculator_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.hpp b/ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.hpp deleted file mode 100644 index 6274dd544f1..00000000000 --- a/ffi/capi/bindings/cpp/icu4x/MetazoneCalculator.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef icu4x_MetazoneCalculator_HPP -#define icu4x_MetazoneCalculator_HPP - -#include "MetazoneCalculator.d.hpp" - -#include -#include -#include -#include -#include -#include -#include "../diplomat_runtime.hpp" -#include "DataError.hpp" -#include "DataProvider.hpp" - - -namespace icu4x { -namespace capi { - extern "C" { - - typedef struct icu4x_MetazoneCalculator_create_mv1_result {union {icu4x::capi::MetazoneCalculator* ok; icu4x::capi::DataError err;}; bool is_ok;} icu4x_MetazoneCalculator_create_mv1_result; - icu4x_MetazoneCalculator_create_mv1_result icu4x_MetazoneCalculator_create_mv1(const icu4x::capi::DataProvider* provider); - - - void icu4x_MetazoneCalculator_destroy_mv1(MetazoneCalculator* self); - - } // extern "C" -} // namespace capi -} // namespace - -inline diplomat::result, icu4x::DataError> icu4x::MetazoneCalculator::create(const icu4x::DataProvider& provider) { - auto result = icu4x::capi::icu4x_MetazoneCalculator_create_mv1(provider.AsFFI()); - return result.is_ok ? diplomat::result, icu4x::DataError>(diplomat::Ok>(std::unique_ptr(icu4x::MetazoneCalculator::FromFFI(result.ok)))) : diplomat::result, icu4x::DataError>(diplomat::Err(icu4x::DataError::FromFFI(result.err))); -} - -inline const icu4x::capi::MetazoneCalculator* icu4x::MetazoneCalculator::AsFFI() const { - return reinterpret_cast(this); -} - -inline icu4x::capi::MetazoneCalculator* icu4x::MetazoneCalculator::AsFFI() { - return reinterpret_cast(this); -} - -inline const icu4x::MetazoneCalculator* icu4x::MetazoneCalculator::FromFFI(const icu4x::capi::MetazoneCalculator* ptr) { - return reinterpret_cast(ptr); -} - -inline icu4x::MetazoneCalculator* icu4x::MetazoneCalculator::FromFFI(icu4x::capi::MetazoneCalculator* ptr) { - return reinterpret_cast(ptr); -} - -inline void icu4x::MetazoneCalculator::operator delete(void* ptr) { - icu4x::capi::icu4x_MetazoneCalculator_destroy_mv1(reinterpret_cast(ptr)); -} - - -#endif // icu4x_MetazoneCalculator_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp similarity index 63% rename from ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp rename to ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp index 014f7e80792..58ecfbf2e27 100644 --- a/ffi/capi/bindings/cpp/icu4x/CustomTimeZone.d.hpp +++ b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp @@ -1,5 +1,5 @@ -#ifndef icu4x_CustomTimeZone_D_HPP -#define icu4x_CustomTimeZone_D_HPP +#ifndef icu4x_TimeZoneInfo_D_HPP +#define icu4x_TimeZoneInfo_D_HPP #include #include @@ -10,32 +10,34 @@ #include "../diplomat_runtime.hpp" namespace icu4x { -namespace capi { struct CustomTimeZone; } -class CustomTimeZone; namespace capi { struct TimeZoneIdMapper; } class TimeZoneIdMapper; +namespace capi { struct TimeZoneInfo; } +class TimeZoneInfo; struct TimeZoneInvalidOffsetError; } namespace icu4x { namespace capi { - struct CustomTimeZone; + struct TimeZoneInfo; } // namespace capi } // namespace namespace icu4x { -class CustomTimeZone { +class TimeZoneInfo { public: - inline static std::unique_ptr unknown(); + inline static std::unique_ptr unknown(); - inline static std::unique_ptr utc(); + inline static std::unique_ptr utc(); inline diplomat::result try_set_offset_seconds(int32_t offset_seconds); inline void set_offset_eighths_of_hour(int8_t offset_eighths_of_hour); + inline diplomat::result try_set_offset_str(std::string_view offset); + inline std::optional offset_eighths_of_hour() const; inline void clear_offset(); @@ -72,19 +74,19 @@ class CustomTimeZone { inline std::optional is_daylight_time() const; - inline const icu4x::capi::CustomTimeZone* AsFFI() const; - inline icu4x::capi::CustomTimeZone* AsFFI(); - inline static const icu4x::CustomTimeZone* FromFFI(const icu4x::capi::CustomTimeZone* ptr); - inline static icu4x::CustomTimeZone* FromFFI(icu4x::capi::CustomTimeZone* ptr); + inline const icu4x::capi::TimeZoneInfo* AsFFI() const; + inline icu4x::capi::TimeZoneInfo* AsFFI(); + inline static const icu4x::TimeZoneInfo* FromFFI(const icu4x::capi::TimeZoneInfo* ptr); + inline static icu4x::TimeZoneInfo* FromFFI(icu4x::capi::TimeZoneInfo* ptr); inline static void operator delete(void* ptr); private: - CustomTimeZone() = delete; - CustomTimeZone(const icu4x::CustomTimeZone&) = delete; - CustomTimeZone(icu4x::CustomTimeZone&&) noexcept = delete; - CustomTimeZone operator=(const icu4x::CustomTimeZone&) = delete; - CustomTimeZone operator=(icu4x::CustomTimeZone&&) noexcept = delete; + TimeZoneInfo() = delete; + TimeZoneInfo(const icu4x::TimeZoneInfo&) = delete; + TimeZoneInfo(icu4x::TimeZoneInfo&&) noexcept = delete; + TimeZoneInfo operator=(const icu4x::TimeZoneInfo&) = delete; + TimeZoneInfo operator=(icu4x::TimeZoneInfo&&) noexcept = delete; static void operator delete[](void*, size_t) = delete; }; } // namespace -#endif // icu4x_CustomTimeZone_D_HPP +#endif // icu4x_TimeZoneInfo_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp new file mode 100644 index 00000000000..5916143739d --- /dev/null +++ b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp @@ -0,0 +1,229 @@ +#ifndef icu4x_TimeZoneInfo_HPP +#define icu4x_TimeZoneInfo_HPP + +#include "TimeZoneInfo.d.hpp" + +#include +#include +#include +#include +#include +#include +#include "../diplomat_runtime.hpp" +#include "TimeZoneIdMapper.hpp" +#include "TimeZoneInvalidOffsetError.hpp" + + +namespace icu4x { +namespace capi { + extern "C" { + + icu4x::capi::TimeZoneInfo* icu4x_TimeZoneInfo_unknown_mv1(void); + + icu4x::capi::TimeZoneInfo* icu4x_TimeZoneInfo_utc_mv1(void); + + typedef struct icu4x_TimeZoneInfo_try_set_offset_seconds_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_try_set_offset_seconds_mv1_result; + icu4x_TimeZoneInfo_try_set_offset_seconds_mv1_result icu4x_TimeZoneInfo_try_set_offset_seconds_mv1(icu4x::capi::TimeZoneInfo* self, int32_t offset_seconds); + + void icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1(icu4x::capi::TimeZoneInfo* self, int8_t offset_eighths_of_hour); + + typedef struct icu4x_TimeZoneInfo_try_set_offset_str_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_try_set_offset_str_mv1_result; + icu4x_TimeZoneInfo_try_set_offset_str_mv1_result icu4x_TimeZoneInfo_try_set_offset_str_mv1(icu4x::capi::TimeZoneInfo* self, diplomat::capi::DiplomatStringView offset); + + typedef struct icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1_result {union {int8_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1_result; + icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1_result icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1(const icu4x::capi::TimeZoneInfo* self); + + void icu4x_TimeZoneInfo_clear_offset_mv1(icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_offset_seconds_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_seconds_mv1_result; + icu4x_TimeZoneInfo_offset_seconds_mv1_result icu4x_TimeZoneInfo_offset_seconds_mv1(const icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_is_offset_positive_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_offset_positive_mv1_result; + icu4x_TimeZoneInfo_is_offset_positive_mv1_result icu4x_TimeZoneInfo_is_offset_positive_mv1(const icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_is_offset_zero_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_offset_zero_mv1_result; + icu4x_TimeZoneInfo_is_offset_zero_mv1_result icu4x_TimeZoneInfo_is_offset_zero_mv1(const icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_offset_hours_part_mv1_result {union {int32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_hours_part_mv1_result; + icu4x_TimeZoneInfo_offset_hours_part_mv1_result icu4x_TimeZoneInfo_offset_hours_part_mv1(const icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_offset_minutes_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_minutes_part_mv1_result; + icu4x_TimeZoneInfo_offset_minutes_part_mv1_result icu4x_TimeZoneInfo_offset_minutes_part_mv1(const icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_offset_seconds_part_mv1_result {union {uint32_t ok; }; bool is_ok;} icu4x_TimeZoneInfo_offset_seconds_part_mv1_result; + icu4x_TimeZoneInfo_offset_seconds_part_mv1_result icu4x_TimeZoneInfo_offset_seconds_part_mv1(const icu4x::capi::TimeZoneInfo* self); + + void icu4x_TimeZoneInfo_set_time_zone_id_mv1(icu4x::capi::TimeZoneInfo* self, diplomat::capi::DiplomatStringView id); + + void icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1(icu4x::capi::TimeZoneInfo* self, const icu4x::capi::TimeZoneIdMapper* mapper, diplomat::capi::DiplomatStringView id); + + void icu4x_TimeZoneInfo_time_zone_id_mv1(const icu4x::capi::TimeZoneInfo* self, diplomat::capi::DiplomatWrite* write); + + typedef struct icu4x_TimeZoneInfo_try_set_zone_variant_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_try_set_zone_variant_mv1_result; + icu4x_TimeZoneInfo_try_set_zone_variant_mv1_result icu4x_TimeZoneInfo_try_set_zone_variant_mv1(icu4x::capi::TimeZoneInfo* self, diplomat::capi::DiplomatStringView id); + + void icu4x_TimeZoneInfo_clear_zone_variant_mv1(icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_zone_variant_mv1_result { bool is_ok;} icu4x_TimeZoneInfo_zone_variant_mv1_result; + icu4x_TimeZoneInfo_zone_variant_mv1_result icu4x_TimeZoneInfo_zone_variant_mv1(const icu4x::capi::TimeZoneInfo* self, diplomat::capi::DiplomatWrite* write); + + void icu4x_TimeZoneInfo_set_standard_time_mv1(icu4x::capi::TimeZoneInfo* self); + + void icu4x_TimeZoneInfo_set_daylight_time_mv1(icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_is_standard_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_standard_time_mv1_result; + icu4x_TimeZoneInfo_is_standard_time_mv1_result icu4x_TimeZoneInfo_is_standard_time_mv1(const icu4x::capi::TimeZoneInfo* self); + + typedef struct icu4x_TimeZoneInfo_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_daylight_time_mv1_result; + icu4x_TimeZoneInfo_is_daylight_time_mv1_result icu4x_TimeZoneInfo_is_daylight_time_mv1(const icu4x::capi::TimeZoneInfo* self); + + + void icu4x_TimeZoneInfo_destroy_mv1(TimeZoneInfo* self); + + } // extern "C" +} // namespace capi +} // namespace + +inline std::unique_ptr icu4x::TimeZoneInfo::unknown() { + auto result = icu4x::capi::icu4x_TimeZoneInfo_unknown_mv1(); + return std::unique_ptr(icu4x::TimeZoneInfo::FromFFI(result)); +} + +inline std::unique_ptr icu4x::TimeZoneInfo::utc() { + auto result = icu4x::capi::icu4x_TimeZoneInfo_utc_mv1(); + return std::unique_ptr(icu4x::TimeZoneInfo::FromFFI(result)); +} + +inline diplomat::result icu4x::TimeZoneInfo::try_set_offset_seconds(int32_t offset_seconds) { + auto result = icu4x::capi::icu4x_TimeZoneInfo_try_set_offset_seconds_mv1(this->AsFFI(), + offset_seconds); + return result.is_ok ? diplomat::result(diplomat::Ok()) : diplomat::result(diplomat::Err(icu4x::TimeZoneInvalidOffsetError {})); +} + +inline void icu4x::TimeZoneInfo::set_offset_eighths_of_hour(int8_t offset_eighths_of_hour) { + icu4x::capi::icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1(this->AsFFI(), + offset_eighths_of_hour); +} + +inline diplomat::result icu4x::TimeZoneInfo::try_set_offset_str(std::string_view offset) { + auto result = icu4x::capi::icu4x_TimeZoneInfo_try_set_offset_str_mv1(this->AsFFI(), + {offset.data(), offset.size()}); + return result.is_ok ? diplomat::result(diplomat::Ok()) : diplomat::result(diplomat::Err(icu4x::TimeZoneInvalidOffsetError {})); +} + +inline std::optional icu4x::TimeZoneInfo::offset_eighths_of_hour() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline void icu4x::TimeZoneInfo::clear_offset() { + icu4x::capi::icu4x_TimeZoneInfo_clear_offset_mv1(this->AsFFI()); +} + +inline std::optional icu4x::TimeZoneInfo::offset_seconds() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_offset_seconds_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline std::optional icu4x::TimeZoneInfo::is_offset_positive() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_is_offset_positive_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline std::optional icu4x::TimeZoneInfo::is_offset_zero() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_is_offset_zero_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline std::optional icu4x::TimeZoneInfo::offset_hours_part() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_offset_hours_part_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline std::optional icu4x::TimeZoneInfo::offset_minutes_part() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_offset_minutes_part_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline std::optional icu4x::TimeZoneInfo::offset_seconds_part() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_offset_seconds_part_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline void icu4x::TimeZoneInfo::set_time_zone_id(std::string_view id) { + icu4x::capi::icu4x_TimeZoneInfo_set_time_zone_id_mv1(this->AsFFI(), + {id.data(), id.size()}); +} + +inline void icu4x::TimeZoneInfo::set_iana_time_zone_id(const icu4x::TimeZoneIdMapper& mapper, std::string_view id) { + icu4x::capi::icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1(this->AsFFI(), + mapper.AsFFI(), + {id.data(), id.size()}); +} + +inline std::string icu4x::TimeZoneInfo::time_zone_id() const { + std::string output; + diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); + icu4x::capi::icu4x_TimeZoneInfo_time_zone_id_mv1(this->AsFFI(), + &write); + return output; +} + +inline std::optional icu4x::TimeZoneInfo::try_set_zone_variant(std::string_view id) { + auto result = icu4x::capi::icu4x_TimeZoneInfo_try_set_zone_variant_mv1(this->AsFFI(), + {id.data(), id.size()}); + return result.is_ok ? std::optional() : std::nullopt; +} + +inline void icu4x::TimeZoneInfo::clear_zone_variant() { + icu4x::capi::icu4x_TimeZoneInfo_clear_zone_variant_mv1(this->AsFFI()); +} + +inline std::optional icu4x::TimeZoneInfo::zone_variant() const { + std::string output; + diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); + auto result = icu4x::capi::icu4x_TimeZoneInfo_zone_variant_mv1(this->AsFFI(), + &write); + return result.is_ok ? std::optional(std::move(output)) : std::nullopt; +} + +inline void icu4x::TimeZoneInfo::set_standard_time() { + icu4x::capi::icu4x_TimeZoneInfo_set_standard_time_mv1(this->AsFFI()); +} + +inline void icu4x::TimeZoneInfo::set_daylight_time() { + icu4x::capi::icu4x_TimeZoneInfo_set_daylight_time_mv1(this->AsFFI()); +} + +inline std::optional icu4x::TimeZoneInfo::is_standard_time() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_is_standard_time_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline std::optional icu4x::TimeZoneInfo::is_daylight_time() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_is_daylight_time_mv1(this->AsFFI()); + return result.is_ok ? std::optional(result.ok) : std::nullopt; +} + +inline const icu4x::capi::TimeZoneInfo* icu4x::TimeZoneInfo::AsFFI() const { + return reinterpret_cast(this); +} + +inline icu4x::capi::TimeZoneInfo* icu4x::TimeZoneInfo::AsFFI() { + return reinterpret_cast(this); +} + +inline const icu4x::TimeZoneInfo* icu4x::TimeZoneInfo::FromFFI(const icu4x::capi::TimeZoneInfo* ptr) { + return reinterpret_cast(ptr); +} + +inline icu4x::TimeZoneInfo* icu4x::TimeZoneInfo::FromFFI(icu4x::capi::TimeZoneInfo* ptr) { + return reinterpret_cast(ptr); +} + +inline void icu4x::TimeZoneInfo::operator delete(void* ptr) { + icu4x::capi::icu4x_TimeZoneInfo_destroy_mv1(reinterpret_cast(ptr)); +} + + +#endif // icu4x_TimeZoneInfo_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.d.hpp b/ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.d.hpp deleted file mode 100644 index 98d6fb4c79f..00000000000 --- a/ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.d.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef icu4x_ZoneOffsetCalculator_D_HPP -#define icu4x_ZoneOffsetCalculator_D_HPP - -#include -#include -#include -#include -#include -#include -#include "../diplomat_runtime.hpp" - -namespace icu4x { -namespace capi { struct DataProvider; } -class DataProvider; -namespace capi { struct ZoneOffsetCalculator; } -class ZoneOffsetCalculator; -class DataError; -} - - -namespace icu4x { -namespace capi { - struct ZoneOffsetCalculator; -} // namespace capi -} // namespace - -namespace icu4x { -class ZoneOffsetCalculator { -public: - - inline static diplomat::result, icu4x::DataError> create(const icu4x::DataProvider& provider); - - inline const icu4x::capi::ZoneOffsetCalculator* AsFFI() const; - inline icu4x::capi::ZoneOffsetCalculator* AsFFI(); - inline static const icu4x::ZoneOffsetCalculator* FromFFI(const icu4x::capi::ZoneOffsetCalculator* ptr); - inline static icu4x::ZoneOffsetCalculator* FromFFI(icu4x::capi::ZoneOffsetCalculator* ptr); - inline static void operator delete(void* ptr); -private: - ZoneOffsetCalculator() = delete; - ZoneOffsetCalculator(const icu4x::ZoneOffsetCalculator&) = delete; - ZoneOffsetCalculator(icu4x::ZoneOffsetCalculator&&) noexcept = delete; - ZoneOffsetCalculator operator=(const icu4x::ZoneOffsetCalculator&) = delete; - ZoneOffsetCalculator operator=(icu4x::ZoneOffsetCalculator&&) noexcept = delete; - static void operator delete[](void*, size_t) = delete; -}; - -} // namespace -#endif // icu4x_ZoneOffsetCalculator_D_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.hpp b/ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.hpp deleted file mode 100644 index 782cd1aaadf..00000000000 --- a/ffi/capi/bindings/cpp/icu4x/ZoneOffsetCalculator.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef icu4x_ZoneOffsetCalculator_HPP -#define icu4x_ZoneOffsetCalculator_HPP - -#include "ZoneOffsetCalculator.d.hpp" - -#include -#include -#include -#include -#include -#include -#include "../diplomat_runtime.hpp" -#include "DataError.hpp" -#include "DataProvider.hpp" - - -namespace icu4x { -namespace capi { - extern "C" { - - typedef struct icu4x_ZoneOffsetCalculator_create_mv1_result {union {icu4x::capi::ZoneOffsetCalculator* ok; icu4x::capi::DataError err;}; bool is_ok;} icu4x_ZoneOffsetCalculator_create_mv1_result; - icu4x_ZoneOffsetCalculator_create_mv1_result icu4x_ZoneOffsetCalculator_create_mv1(const icu4x::capi::DataProvider* provider); - - - void icu4x_ZoneOffsetCalculator_destroy_mv1(ZoneOffsetCalculator* self); - - } // extern "C" -} // namespace capi -} // namespace - -inline diplomat::result, icu4x::DataError> icu4x::ZoneOffsetCalculator::create(const icu4x::DataProvider& provider) { - auto result = icu4x::capi::icu4x_ZoneOffsetCalculator_create_mv1(provider.AsFFI()); - return result.is_ok ? diplomat::result, icu4x::DataError>(diplomat::Ok>(std::unique_ptr(icu4x::ZoneOffsetCalculator::FromFFI(result.ok)))) : diplomat::result, icu4x::DataError>(diplomat::Err(icu4x::DataError::FromFFI(result.err))); -} - -inline const icu4x::capi::ZoneOffsetCalculator* icu4x::ZoneOffsetCalculator::AsFFI() const { - return reinterpret_cast(this); -} - -inline icu4x::capi::ZoneOffsetCalculator* icu4x::ZoneOffsetCalculator::AsFFI() { - return reinterpret_cast(this); -} - -inline const icu4x::ZoneOffsetCalculator* icu4x::ZoneOffsetCalculator::FromFFI(const icu4x::capi::ZoneOffsetCalculator* ptr) { - return reinterpret_cast(ptr); -} - -inline icu4x::ZoneOffsetCalculator* icu4x::ZoneOffsetCalculator::FromFFI(icu4x::capi::ZoneOffsetCalculator* ptr) { - return reinterpret_cast(ptr); -} - -inline void icu4x::ZoneOffsetCalculator::operator delete(void* ptr) { - icu4x::capi::icu4x_ZoneOffsetCalculator_destroy_mv1(reinterpret_cast(ptr)); -} - - -#endif // icu4x_ZoneOffsetCalculator_HPP diff --git a/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.d.hpp b/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.d.hpp index 54d0cfa3656..a5d7731ac96 100644 --- a/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.d.hpp +++ b/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.d.hpp @@ -10,8 +10,6 @@ #include "../diplomat_runtime.hpp" namespace icu4x { -namespace capi { struct CustomTimeZone; } -class CustomTimeZone; namespace capi { struct DataProvider; } class DataProvider; namespace capi { struct DateTime; } @@ -20,6 +18,8 @@ namespace capi { struct IsoDateTime; } class IsoDateTime; namespace capi { struct Locale; } class Locale; +namespace capi { struct TimeZoneInfo; } +class TimeZoneInfo; namespace capi { struct ZonedDateTimeFormatter; } class ZonedDateTimeFormatter; class DateTimeLength; @@ -39,9 +39,9 @@ class ZonedDateTimeFormatter { inline static diplomat::result, icu4x::Error> create_with_length(const icu4x::DataProvider& provider, const icu4x::Locale& locale, icu4x::DateTimeLength length); - inline diplomat::result format_datetime_with_custom_time_zone(const icu4x::DateTime& datetime, const icu4x::CustomTimeZone& time_zone) const; + inline diplomat::result format_datetime_with_custom_time_zone(const icu4x::DateTime& datetime, const icu4x::TimeZoneInfo& time_zone) const; - inline diplomat::result format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::CustomTimeZone& time_zone) const; + inline diplomat::result format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::TimeZoneInfo& time_zone) const; inline const icu4x::capi::ZonedDateTimeFormatter* AsFFI() const; inline icu4x::capi::ZonedDateTimeFormatter* AsFFI(); diff --git a/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.hpp b/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.hpp index 81c53ffe446..6cb0ed80c62 100644 --- a/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.hpp +++ b/ffi/capi/bindings/cpp/icu4x/ZonedDateTimeFormatter.hpp @@ -10,13 +10,13 @@ #include #include #include "../diplomat_runtime.hpp" -#include "CustomTimeZone.hpp" #include "DataProvider.hpp" #include "DateTime.hpp" #include "DateTimeLength.hpp" #include "Error.hpp" #include "IsoDateTime.hpp" #include "Locale.hpp" +#include "TimeZoneInfo.hpp" namespace icu4x { @@ -27,10 +27,10 @@ namespace capi { icu4x_ZonedDateTimeFormatter_create_with_length_mv1_result icu4x_ZonedDateTimeFormatter_create_with_length_mv1(const icu4x::capi::DataProvider* provider, const icu4x::capi::Locale* locale, icu4x::capi::DateTimeLength length); typedef struct icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result {union { icu4x::capi::Error err;}; bool is_ok;} icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result; - icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1(const icu4x::capi::ZonedDateTimeFormatter* self, const icu4x::capi::DateTime* datetime, const icu4x::capi::CustomTimeZone* time_zone, diplomat::capi::DiplomatWrite* write); + icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1(const icu4x::capi::ZonedDateTimeFormatter* self, const icu4x::capi::DateTime* datetime, const icu4x::capi::TimeZoneInfo* time_zone, diplomat::capi::DiplomatWrite* write); typedef struct icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result {union { icu4x::capi::Error err;}; bool is_ok;} icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result; - icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const icu4x::capi::ZonedDateTimeFormatter* self, const icu4x::capi::IsoDateTime* datetime, const icu4x::capi::CustomTimeZone* time_zone, diplomat::capi::DiplomatWrite* write); + icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1_result icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(const icu4x::capi::ZonedDateTimeFormatter* self, const icu4x::capi::IsoDateTime* datetime, const icu4x::capi::TimeZoneInfo* time_zone, diplomat::capi::DiplomatWrite* write); void icu4x_ZonedDateTimeFormatter_destroy_mv1(ZonedDateTimeFormatter* self); @@ -46,7 +46,7 @@ inline diplomat::result, icu4x::E return result.is_ok ? diplomat::result, icu4x::Error>(diplomat::Ok>(std::unique_ptr(icu4x::ZonedDateTimeFormatter::FromFFI(result.ok)))) : diplomat::result, icu4x::Error>(diplomat::Err(icu4x::Error::FromFFI(result.err))); } -inline diplomat::result icu4x::ZonedDateTimeFormatter::format_datetime_with_custom_time_zone(const icu4x::DateTime& datetime, const icu4x::CustomTimeZone& time_zone) const { +inline diplomat::result icu4x::ZonedDateTimeFormatter::format_datetime_with_custom_time_zone(const icu4x::DateTime& datetime, const icu4x::TimeZoneInfo& time_zone) const { std::string output; diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); auto result = icu4x::capi::icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1(this->AsFFI(), @@ -56,7 +56,7 @@ inline diplomat::result icu4x::ZonedDateTimeFormatter return result.is_ok ? diplomat::result(diplomat::Ok(std::move(output))) : diplomat::result(diplomat::Err(icu4x::Error::FromFFI(result.err))); } -inline diplomat::result icu4x::ZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::CustomTimeZone& time_zone) const { +inline diplomat::result icu4x::ZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone(const icu4x::IsoDateTime& datetime, const icu4x::TimeZoneInfo& time_zone) const { std::string output; diplomat::capi::DiplomatWrite write = diplomat::WriteFromString(output); auto result = icu4x::capi::icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(this->AsFFI(), diff --git a/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart b/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart index 382b5200874..2a5a80b01eb 100644 --- a/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart @@ -38,8 +38,8 @@ final class GregorianZonedDateTimeFormatter implements ffi.Finalizable { return GregorianZonedDateTimeFormatter._fromFfi(result.union.ok, []); } - /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string. - String formatIsoDatetimeWithCustomTimeZone(IsoDateTime datetime, CustomTimeZone timeZone) { + /// Formats a [`IsoDateTime`] and [`TimeZoneInfo`] to a string. + String formatIsoDatetimeWithCustomTimeZone(IsoDateTime datetime, TimeZoneInfo timeZone) { final write = _Write(); _icu4x_GregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(_ffi, datetime._ffi, timeZone._ffi, write._ffi); return write.finalize(); diff --git a/ffi/capi/bindings/dart/MetazoneCalculator.g.dart b/ffi/capi/bindings/dart/MetazoneCalculator.g.dart deleted file mode 100644 index 9cf67abeb41..00000000000 --- a/ffi/capi/bindings/dart/MetazoneCalculator.g.dart +++ /dev/null @@ -1,51 +0,0 @@ -// generated by diplomat-tool - -part of 'lib.g.dart'; - -/// An object capable of computing the metazone from a timezone. -/// -/// This can be used via `maybe_calculate_metazone()` on [`CustomTimeZone`]. -/// -/// [`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone -/// -/// See the [Rust documentation for `MetazoneCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html) for more information. -final class MetazoneCalculator implements ffi.Finalizable { - final ffi.Pointer _ffi; - - // These are "used" in the sense that they keep dependencies alive - // ignore: unused_field - final core.List _selfEdge; - - // This takes in a list of lifetime edges (including for &self borrows) - // corresponding to data this may borrow from. These should be flat arrays containing - // references to objects, and this object will hold on to them to keep them alive and - // maintain borrow validity. - MetazoneCalculator._fromFfi(this._ffi, this._selfEdge) { - if (_selfEdge.isEmpty) { - _finalizer.attach(this, _ffi.cast()); - } - } - - static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_MetazoneCalculator_destroy_mv1)); - - /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.new) for more information. - /// - /// Throws [DataError] on failure. - factory MetazoneCalculator(DataProvider provider) { - final result = _icu4x_MetazoneCalculator_create_mv1(provider._ffi); - if (!result.isOk) { - throw DataError.values[result.union.err]; - } - return MetazoneCalculator._fromFfi(result.union.ok, []); - } -} - -@meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_MetazoneCalculator_destroy_mv1') -// ignore: non_constant_identifier_names -external void _icu4x_MetazoneCalculator_destroy_mv1(ffi.Pointer self); - -@meta.RecordUse() -@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_MetazoneCalculator_create_mv1') -// ignore: non_constant_identifier_names -external _ResultOpaqueInt32 _icu4x_MetazoneCalculator_create_mv1(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/CustomTimeZone.g.dart b/ffi/capi/bindings/dart/TimeZoneInfo.g.dart similarity index 61% rename from ffi/capi/bindings/dart/CustomTimeZone.g.dart rename to ffi/capi/bindings/dart/TimeZoneInfo.g.dart index 7d88f813149..b325ed011c5 100644 --- a/ffi/capi/bindings/dart/CustomTimeZone.g.dart +++ b/ffi/capi/bindings/dart/TimeZoneInfo.g.dart @@ -2,8 +2,8 @@ part of 'lib.g.dart'; -/// See the [Rust documentation for `CustomTimeZone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html) for more information. -final class CustomTimeZone implements ffi.Finalizable { +/// See the [Rust documentation for `TimeZoneInfo`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html) for more information. +final class TimeZoneInfo implements ffi.Finalizable { final ffi.Pointer _ffi; // These are "used" in the sense that they keep dependencies alive @@ -14,28 +14,28 @@ final class CustomTimeZone implements ffi.Finalizable { // corresponding to data this may borrow from. These should be flat arrays containing // references to objects, and this object will hold on to them to keep them alive and // maintain borrow validity. - CustomTimeZone._fromFfi(this._ffi, this._selfEdge) { + TimeZoneInfo._fromFfi(this._ffi, this._selfEdge) { if (_selfEdge.isEmpty) { _finalizer.attach(this, _ffi.cast()); } } - static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_CustomTimeZone_destroy_mv1)); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_TimeZoneInfo_destroy_mv1)); /// Creates a time zone with no information. /// - /// See the [Rust documentation for `unknown`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.unknown) for more information. - factory CustomTimeZone() { - final result = _icu4x_CustomTimeZone_unknown_mv1(); - return CustomTimeZone._fromFfi(result, []); + /// See the [Rust documentation for `unknown`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#method.unknown) for more information. + factory TimeZoneInfo() { + final result = _icu4x_TimeZoneInfo_unknown_mv1(); + return TimeZoneInfo._fromFfi(result, []); } /// Creates a time zone for UTC (Coordinated Universal Time). /// - /// See the [Rust documentation for `utc`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.utc) for more information. - factory CustomTimeZone.utc() { - final result = _icu4x_CustomTimeZone_utc_mv1(); - return CustomTimeZone._fromFfi(result, []); + /// See the [Rust documentation for `utc`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#method.utc) for more information. + factory TimeZoneInfo.utc() { + final result = _icu4x_TimeZoneInfo_utc_mv1(); + return TimeZoneInfo._fromFfi(result, []); } /// Sets the `offset` field from offset seconds. @@ -48,7 +48,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// Throws [TimeZoneInvalidOffsetError] on failure. void trySetOffsetSeconds(int offsetSeconds) { - final result = _icu4x_CustomTimeZone_try_set_offset_seconds_mv1(_ffi, offsetSeconds); + final result = _icu4x_TimeZoneInfo_try_set_offset_seconds_mv1(_ffi, offsetSeconds); if (!result.isOk) { throw TimeZoneInvalidOffsetError(); } @@ -59,14 +59,28 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `from_eighths_of_hour`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.from_eighths_of_hour) for more information. void setOffsetEighthsOfHour(int offsetEighthsOfHour) { - _icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1(_ffi, offsetEighthsOfHour); + _icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1(_ffi, offsetEighthsOfHour); + } + + /// Sets the `offset` field from a string. + /// + /// See the [Rust documentation for `try_from_str`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.try_from_str) for more information. + /// + /// Throws [TimeZoneInvalidOffsetError] on failure. + void trySetOffsetStr(String offset) { + final temp = _FinalizedArena(); + final result = _icu4x_TimeZoneInfo_try_set_offset_str_mv1(_ffi, offset._utf8AllocIn(temp.arena)); + if (!result.isOk) { + throw TimeZoneInvalidOffsetError(); + } + } /// Gets the `offset` field from offset as eighths of an hour. /// /// See the [Rust documentation for `to_eighths_of_hour`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.to_eighths_of_hour) for more information. int? offsetEighthsOfHour() { - final result = _icu4x_CustomTimeZone_offset_eighths_of_hour_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1(_ffi); if (!result.isOk) { return null; } @@ -79,7 +93,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html) void clearOffset() { - _icu4x_CustomTimeZone_clear_offset_mv1(_ffi); + _icu4x_TimeZoneInfo_clear_offset_mv1(_ffi); } /// Returns the value of the `offset` field as offset seconds. @@ -90,7 +104,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html) int? get offsetSeconds { - final result = _icu4x_CustomTimeZone_offset_seconds_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_offset_seconds_mv1(_ffi); if (!result.isOk) { return null; } @@ -103,7 +117,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `is_positive`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.is_positive) for more information. bool? get isOffsetPositive { - final result = _icu4x_CustomTimeZone_is_offset_positive_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_is_offset_positive_mv1(_ffi); if (!result.isOk) { return null; } @@ -116,7 +130,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `is_zero`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.is_zero) for more information. bool? get isOffsetZero { - final result = _icu4x_CustomTimeZone_is_offset_zero_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_is_offset_zero_mv1(_ffi); if (!result.isOk) { return null; } @@ -129,7 +143,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `hours_part`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.hours_part) for more information. int? get offsetHoursPart { - final result = _icu4x_CustomTimeZone_offset_hours_part_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_offset_hours_part_mv1(_ffi); if (!result.isOk) { return null; } @@ -142,7 +156,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `minutes_part`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.minutes_part) for more information. int? get offsetMinutesPart { - final result = _icu4x_CustomTimeZone_offset_minutes_part_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_offset_minutes_part_mv1(_ffi); if (!result.isOk) { return null; } @@ -155,7 +169,7 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `seconds_part`](https://docs.rs/icu/latest/icu/timezone/struct.UtcOffset.html#method.seconds_part) for more information. int? get offsetSecondsPart { - final result = _icu4x_CustomTimeZone_offset_seconds_part_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_offset_seconds_part_mv1(_ffi); if (!result.isOk) { return null; } @@ -166,31 +180,31 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// Errors if the string is not a valid BCP-47 time zone ID. /// - /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id) for more information. + /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.time_zone_id) for more information. /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html) void setTimeZoneId(String id) { final temp = _FinalizedArena(); - _icu4x_CustomTimeZone_set_time_zone_id_mv1(_ffi, id._utf8AllocIn(temp.arena)); + _icu4x_TimeZoneInfo_set_time_zone_id_mv1(_ffi, id._utf8AllocIn(temp.arena)); } /// Sets the `time_zone_id` field from an IANA string by looking up /// the corresponding BCP-47 string. void setIanaTimeZoneId(TimeZoneIdMapper mapper, String id) { final temp = _FinalizedArena(); - _icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(_ffi, mapper._ffi, id._utf8AllocIn(temp.arena)); + _icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1(_ffi, mapper._ffi, id._utf8AllocIn(temp.arena)); } /// Writes the value of the `time_zone_id` field as a string. /// /// Returns null if the `time_zone_id` field is empty. /// - /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id) for more information. + /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.time_zone_id) for more information. /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html) String get timeZoneId { final write = _Write(); - _icu4x_CustomTimeZone_time_zone_id_mv1(_ffi, write._ffi); + _icu4x_TimeZoneInfo_time_zone_id_mv1(_ffi, write._ffi); return write.finalize(); } @@ -198,34 +212,34 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// Returns null if the string is not a valid zone variant. /// - /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information. + /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) for more information. /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) bool trySetZoneVariant(String id) { final temp = _FinalizedArena(); - final result = _icu4x_CustomTimeZone_try_set_zone_variant_mv1(_ffi, id._utf8AllocIn(temp.arena)); + final result = _icu4x_TimeZoneInfo_try_set_zone_variant_mv1(_ffi, id._utf8AllocIn(temp.arena)); return result.isOk; } /// Clears the `zone_variant` field. /// - /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information. + /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) for more information. /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) void clearZoneVariant() { - _icu4x_CustomTimeZone_clear_zone_variant_mv1(_ffi); + _icu4x_TimeZoneInfo_clear_zone_variant_mv1(_ffi); } /// Writes the value of the `zone_variant` field as a string. /// /// Returns null if the `zone_variant` field is empty. /// - /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information. + /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) for more information. /// /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) String? get zoneVariant { final write = _Write(); - final result = _icu4x_CustomTimeZone_zone_variant_mv1(_ffi, write._ffi); + final result = _icu4x_TimeZoneInfo_zone_variant_mv1(_ffi, write._ffi); if (!result.isOk) { return null; } @@ -237,9 +251,9 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `standard`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard) for more information. /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) + /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) void setStandardTime() { - _icu4x_CustomTimeZone_set_standard_time_mv1(_ffi); + _icu4x_TimeZoneInfo_set_standard_time_mv1(_ffi); } /// Sets the `zone_variant` field to "daylight" time, which may or may @@ -247,9 +261,9 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `daylight`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight) for more information. /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) + /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) void setDaylightTime() { - _icu4x_CustomTimeZone_set_daylight_time_mv1(_ffi); + _icu4x_TimeZoneInfo_set_daylight_time_mv1(_ffi); } /// Returns whether the `zone_variant` field is standard time. @@ -258,9 +272,9 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `standard`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard) for more information. /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) + /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) bool? get isStandardTime { - final result = _icu4x_CustomTimeZone_is_standard_time_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_is_standard_time_mv1(_ffi); if (!result.isOk) { return null; } @@ -273,9 +287,9 @@ final class CustomTimeZone implements ffi.Finalizable { /// /// See the [Rust documentation for `daylight`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight) for more information. /// - /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) + /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.zone_variant) bool? get isDaylightTime { - final result = _icu4x_CustomTimeZone_is_daylight_time_mv1(_ffi); + final result = _icu4x_TimeZoneInfo_is_daylight_time_mv1(_ffi); if (!result.isOk) { return null; } @@ -284,116 +298,121 @@ final class CustomTimeZone implements ffi.Finalizable { } @meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_destroy_mv1') +@ffi.Native)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_destroy_mv1') +// ignore: non_constant_identifier_names +external void _icu4x_TimeZoneInfo_destroy_mv1(ffi.Pointer self); + +@meta.RecordUse() +@ffi.Native Function()>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_unknown_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_destroy_mv1(ffi.Pointer self); +external ffi.Pointer _icu4x_TimeZoneInfo_unknown_mv1(); @meta.RecordUse() -@ffi.Native Function()>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_unknown_mv1') +@ffi.Native Function()>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_utc_mv1') // ignore: non_constant_identifier_names -external ffi.Pointer _icu4x_CustomTimeZone_unknown_mv1(); +external ffi.Pointer _icu4x_TimeZoneInfo_utc_mv1(); @meta.RecordUse() -@ffi.Native Function()>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_utc_mv1') +@ffi.Native<_ResultVoidTimeZoneInvalidOffsetErrorFfi Function(ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_try_set_offset_seconds_mv1') // ignore: non_constant_identifier_names -external ffi.Pointer _icu4x_CustomTimeZone_utc_mv1(); +external _ResultVoidTimeZoneInvalidOffsetErrorFfi _icu4x_TimeZoneInfo_try_set_offset_seconds_mv1(ffi.Pointer self, int offsetSeconds); @meta.RecordUse() -@ffi.Native<_ResultVoidTimeZoneInvalidOffsetErrorFfi Function(ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_try_set_offset_seconds_mv1') +@ffi.Native, ffi.Int8)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1') // ignore: non_constant_identifier_names -external _ResultVoidTimeZoneInvalidOffsetErrorFfi _icu4x_CustomTimeZone_try_set_offset_seconds_mv1(ffi.Pointer self, int offsetSeconds); +external void _icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1(ffi.Pointer self, int offsetEighthsOfHour); @meta.RecordUse() -@ffi.Native, ffi.Int8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1') +@ffi.Native<_ResultVoidTimeZoneInvalidOffsetErrorFfi Function(ffi.Pointer, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_try_set_offset_str_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1(ffi.Pointer self, int offsetEighthsOfHour); +external _ResultVoidTimeZoneInvalidOffsetErrorFfi _icu4x_TimeZoneInfo_try_set_offset_str_mv1(ffi.Pointer self, _SliceUtf8 offset); @meta.RecordUse() -@ffi.Native<_ResultInt8Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_offset_eighths_of_hour_mv1') +@ffi.Native<_ResultInt8Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1') // ignore: non_constant_identifier_names -external _ResultInt8Void _icu4x_CustomTimeZone_offset_eighths_of_hour_mv1(ffi.Pointer self); +external _ResultInt8Void _icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_clear_offset_mv1') +@ffi.Native)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_clear_offset_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_clear_offset_mv1(ffi.Pointer self); +external void _icu4x_TimeZoneInfo_clear_offset_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultInt32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_offset_seconds_mv1') +@ffi.Native<_ResultInt32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_offset_seconds_mv1') // ignore: non_constant_identifier_names -external _ResultInt32Void _icu4x_CustomTimeZone_offset_seconds_mv1(ffi.Pointer self); +external _ResultInt32Void _icu4x_TimeZoneInfo_offset_seconds_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_is_offset_positive_mv1') +@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_is_offset_positive_mv1') // ignore: non_constant_identifier_names -external _ResultBoolVoid _icu4x_CustomTimeZone_is_offset_positive_mv1(ffi.Pointer self); +external _ResultBoolVoid _icu4x_TimeZoneInfo_is_offset_positive_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_is_offset_zero_mv1') +@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_is_offset_zero_mv1') // ignore: non_constant_identifier_names -external _ResultBoolVoid _icu4x_CustomTimeZone_is_offset_zero_mv1(ffi.Pointer self); +external _ResultBoolVoid _icu4x_TimeZoneInfo_is_offset_zero_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultInt32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_offset_hours_part_mv1') +@ffi.Native<_ResultInt32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_offset_hours_part_mv1') // ignore: non_constant_identifier_names -external _ResultInt32Void _icu4x_CustomTimeZone_offset_hours_part_mv1(ffi.Pointer self); +external _ResultInt32Void _icu4x_TimeZoneInfo_offset_hours_part_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultUint32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_offset_minutes_part_mv1') +@ffi.Native<_ResultUint32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_offset_minutes_part_mv1') // ignore: non_constant_identifier_names -external _ResultUint32Void _icu4x_CustomTimeZone_offset_minutes_part_mv1(ffi.Pointer self); +external _ResultUint32Void _icu4x_TimeZoneInfo_offset_minutes_part_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultUint32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_offset_seconds_part_mv1') +@ffi.Native<_ResultUint32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_offset_seconds_part_mv1') // ignore: non_constant_identifier_names -external _ResultUint32Void _icu4x_CustomTimeZone_offset_seconds_part_mv1(ffi.Pointer self); +external _ResultUint32Void _icu4x_TimeZoneInfo_offset_seconds_part_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_set_time_zone_id_mv1') +@ffi.Native, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_set_time_zone_id_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_set_time_zone_id_mv1(ffi.Pointer self, _SliceUtf8 id); +external void _icu4x_TimeZoneInfo_set_time_zone_id_mv1(ffi.Pointer self, _SliceUtf8 id); @meta.RecordUse() -@ffi.Native, ffi.Pointer, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_set_iana_time_zone_id_mv1') +@ffi.Native, ffi.Pointer, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(ffi.Pointer self, ffi.Pointer mapper, _SliceUtf8 id); +external void _icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1(ffi.Pointer self, ffi.Pointer mapper, _SliceUtf8 id); @meta.RecordUse() -@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_time_zone_id_mv1') +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_time_zone_id_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_time_zone_id_mv1(ffi.Pointer self, ffi.Pointer write); +external void _icu4x_TimeZoneInfo_time_zone_id_mv1(ffi.Pointer self, ffi.Pointer write); @meta.RecordUse() -@ffi.Native<_ResultVoidVoid Function(ffi.Pointer, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_try_set_zone_variant_mv1') +@ffi.Native<_ResultVoidVoid Function(ffi.Pointer, _SliceUtf8)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_try_set_zone_variant_mv1') // ignore: non_constant_identifier_names -external _ResultVoidVoid _icu4x_CustomTimeZone_try_set_zone_variant_mv1(ffi.Pointer self, _SliceUtf8 id); +external _ResultVoidVoid _icu4x_TimeZoneInfo_try_set_zone_variant_mv1(ffi.Pointer self, _SliceUtf8 id); @meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_clear_zone_variant_mv1') +@ffi.Native)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_clear_zone_variant_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_clear_zone_variant_mv1(ffi.Pointer self); +external void _icu4x_TimeZoneInfo_clear_zone_variant_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultVoidVoid Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_zone_variant_mv1') +@ffi.Native<_ResultVoidVoid Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_zone_variant_mv1') // ignore: non_constant_identifier_names -external _ResultVoidVoid _icu4x_CustomTimeZone_zone_variant_mv1(ffi.Pointer self, ffi.Pointer write); +external _ResultVoidVoid _icu4x_TimeZoneInfo_zone_variant_mv1(ffi.Pointer self, ffi.Pointer write); @meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_set_standard_time_mv1') +@ffi.Native)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_set_standard_time_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_set_standard_time_mv1(ffi.Pointer self); +external void _icu4x_TimeZoneInfo_set_standard_time_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_set_daylight_time_mv1') +@ffi.Native)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_set_daylight_time_mv1') // ignore: non_constant_identifier_names -external void _icu4x_CustomTimeZone_set_daylight_time_mv1(ffi.Pointer self); +external void _icu4x_TimeZoneInfo_set_daylight_time_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_is_standard_time_mv1') +@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_is_standard_time_mv1') // ignore: non_constant_identifier_names -external _ResultBoolVoid _icu4x_CustomTimeZone_is_standard_time_mv1(ffi.Pointer self); +external _ResultBoolVoid _icu4x_TimeZoneInfo_is_standard_time_mv1(ffi.Pointer self); @meta.RecordUse() -@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_CustomTimeZone_is_daylight_time_mv1') +@ffi.Native<_ResultBoolVoid Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_is_daylight_time_mv1') // ignore: non_constant_identifier_names -external _ResultBoolVoid _icu4x_CustomTimeZone_is_daylight_time_mv1(ffi.Pointer self); +external _ResultBoolVoid _icu4x_TimeZoneInfo_is_daylight_time_mv1(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/ZoneOffsetCalculator.g.dart b/ffi/capi/bindings/dart/ZoneOffsetCalculator.g.dart deleted file mode 100644 index cd5a7f39724..00000000000 --- a/ffi/capi/bindings/dart/ZoneOffsetCalculator.g.dart +++ /dev/null @@ -1,51 +0,0 @@ -// generated by diplomat-tool - -part of 'lib.g.dart'; - -/// An object capable of computing UTC offsets from a timezone. -/// -/// This can be used via `maybe_calculate_zone_variant()` on [`CustomTimeZone`]. -/// -/// [`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone -/// -/// See the [Rust documentation for `ZoneOffsetCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneOffsetCalculator.html) for more information. -final class ZoneOffsetCalculator implements ffi.Finalizable { - final ffi.Pointer _ffi; - - // These are "used" in the sense that they keep dependencies alive - // ignore: unused_field - final core.List _selfEdge; - - // This takes in a list of lifetime edges (including for &self borrows) - // corresponding to data this may borrow from. These should be flat arrays containing - // references to objects, and this object will hold on to them to keep them alive and - // maintain borrow validity. - ZoneOffsetCalculator._fromFfi(this._ffi, this._selfEdge) { - if (_selfEdge.isEmpty) { - _finalizer.attach(this, _ffi.cast()); - } - } - - static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_icu4x_ZoneOffsetCalculator_destroy_mv1)); - - /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneOffsetCalculator.html#method.new) for more information. - /// - /// Throws [DataError] on failure. - factory ZoneOffsetCalculator(DataProvider provider) { - final result = _icu4x_ZoneOffsetCalculator_create_mv1(provider._ffi); - if (!result.isOk) { - throw DataError.values[result.union.err]; - } - return ZoneOffsetCalculator._fromFfi(result.union.ok, []); - } -} - -@meta.RecordUse() -@ffi.Native)>(isLeaf: true, symbol: 'icu4x_ZoneOffsetCalculator_destroy_mv1') -// ignore: non_constant_identifier_names -external void _icu4x_ZoneOffsetCalculator_destroy_mv1(ffi.Pointer self); - -@meta.RecordUse() -@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_ZoneOffsetCalculator_create_mv1') -// ignore: non_constant_identifier_names -external _ResultOpaqueInt32 _icu4x_ZoneOffsetCalculator_create_mv1(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart b/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart index a25f8aa6ae4..48204f3d140 100644 --- a/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart @@ -38,10 +38,10 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { return ZonedDateTimeFormatter._fromFfi(result.union.ok, []); } - /// Formats a [`DateTime`] and [`CustomTimeZone`] to a string. + /// Formats a [`DateTime`] and [`TimeZoneInfo`] to a string. /// /// Throws [Error] on failure. - String formatDatetimeWithCustomTimeZone(DateTime datetime, CustomTimeZone timeZone) { + String formatDatetimeWithCustomTimeZone(DateTime datetime, TimeZoneInfo timeZone) { final write = _Write(); final result = _icu4x_ZonedDateTimeFormatter_format_datetime_with_custom_time_zone_mv1(_ffi, datetime._ffi, timeZone._ffi, write._ffi); if (!result.isOk) { @@ -50,10 +50,10 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { return write.finalize(); } - /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string. + /// Formats a [`IsoDateTime`] and [`TimeZoneInfo`] to a string. /// /// Throws [Error] on failure. - String formatIsoDatetimeWithCustomTimeZone(IsoDateTime datetime, CustomTimeZone timeZone) { + String formatIsoDatetimeWithCustomTimeZone(IsoDateTime datetime, TimeZoneInfo timeZone) { final write = _Write(); final result = _icu4x_ZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone_mv1(_ffi, datetime._ffi, timeZone._ffi, write._ffi); if (!result.isOk) { diff --git a/ffi/capi/bindings/dart/lib.g.dart b/ffi/capi/bindings/dart/lib.g.dart index 9e90fdc7f1f..4329913216b 100644 --- a/ffi/capi/bindings/dart/lib.g.dart +++ b/ffi/capi/bindings/dart/lib.g.dart @@ -40,7 +40,6 @@ part 'CollatorOptions.g.dart'; part 'CollatorResolvedOptions.g.dart'; part 'CollatorStrength.g.dart'; part 'ComposingNormalizer.g.dart'; -part 'CustomTimeZone.g.dart'; part 'DataError.g.dart'; part 'DataProvider.g.dart'; part 'Date.g.dart'; @@ -102,7 +101,6 @@ part 'LocaleParseError.g.dart'; part 'Logger.g.dart'; part 'MeasureUnit.g.dart'; part 'MeasureUnitParser.g.dart'; -part 'MetazoneCalculator.g.dart'; part 'PluralCategories.g.dart'; part 'PluralCategory.g.dart'; part 'PluralOperands.g.dart'; @@ -122,6 +120,7 @@ part 'Time.g.dart'; part 'TimeFormatter.g.dart'; part 'TimeZoneIdMapper.g.dart'; part 'TimeZoneIdMapperWithFastCanonicalization.g.dart'; +part 'TimeZoneInfo.g.dart'; part 'TimeZoneInvalidOffsetError.g.dart'; part 'TitlecaseMapper.g.dart'; part 'TitlecaseOptions.g.dart'; @@ -137,7 +136,6 @@ part 'WordBreakIteratorLatin1.g.dart'; part 'WordBreakIteratorUtf16.g.dart'; part 'WordBreakIteratorUtf8.g.dart'; part 'WordSegmenter.g.dart'; -part 'ZoneOffsetCalculator.g.dart'; part 'ZonedDateTimeFormatter.g.dart'; /// A [Rune] is a Unicode code point, such as `a`, or `💡`. diff --git a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts index 86490f83f82..ce6d9c32efb 100644 --- a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts +++ b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.d.ts @@ -1,6 +1,6 @@ -import { CustomTimeZone } from "icu4x" import { DataProvider } from "icu4x" import { GregorianZonedDateTimeFormatter } from "icu4x" import { IsoDateTime } from "icu4x" import { Locale } from "icu4x" +import { TimeZoneInfo } from "icu4x" export function formatIsoDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number); diff --git a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs index 58c584a1978..b7ac7431098 100644 --- a/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs +++ b/ffi/capi/bindings/demo_gen/GregorianZonedDateTimeFormatter.mjs @@ -1,8 +1,8 @@ -import { CustomTimeZone } from "icu4x" import { DataProvider } from "icu4x" import { GregorianZonedDateTimeFormatter } from "icu4x" import { IsoDateTime } from "icu4x" import { Locale } from "icu4x" +import { TimeZoneInfo } from "icu4x" export function formatIsoDatetimeWithCustomTimeZone() { var terminusArgs = arguments; return (function (...args) { return args[0].formatIsoDatetimeWithCustomTimeZone(...args.slice(1)) }).apply( @@ -37,7 +37,7 @@ export function formatIsoDatetimeWithCustomTimeZone() { terminusArgs[8] ] ), - CustomTimeZone.unknown.apply( + TimeZoneInfo.unknown.apply( null, [ ] diff --git a/ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts b/ffi/capi/bindings/demo_gen/TimeZoneInfo.d.ts similarity index 61% rename from ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts rename to ffi/capi/bindings/demo_gen/TimeZoneInfo.d.ts index 29124e8a6f3..e7313f93520 100644 --- a/ffi/capi/bindings/demo_gen/CustomTimeZone.d.ts +++ b/ffi/capi/bindings/demo_gen/TimeZoneInfo.d.ts @@ -1,3 +1,3 @@ -import { CustomTimeZone } from "icu4x" +import { TimeZoneInfo } from "icu4x" export function timeZoneId(); export function zoneVariant(); diff --git a/ffi/capi/bindings/demo_gen/CustomTimeZone.mjs b/ffi/capi/bindings/demo_gen/TimeZoneInfo.mjs similarity index 80% rename from ffi/capi/bindings/demo_gen/CustomTimeZone.mjs rename to ffi/capi/bindings/demo_gen/TimeZoneInfo.mjs index 84c717c1ea2..89afa48e102 100644 --- a/ffi/capi/bindings/demo_gen/CustomTimeZone.mjs +++ b/ffi/capi/bindings/demo_gen/TimeZoneInfo.mjs @@ -1,10 +1,10 @@ -import { CustomTimeZone } from "icu4x" +import { TimeZoneInfo } from "icu4x" export function timeZoneId() { var terminusArgs = arguments; return (function (...args) { return args[0].timeZoneId }).apply( null, [ - CustomTimeZone.unknown.apply( + TimeZoneInfo.unknown.apply( null, [ ] @@ -17,7 +17,7 @@ export function zoneVariant() { return (function (...args) { return args[0].zoneVariant }).apply( null, [ - CustomTimeZone.unknown.apply( + TimeZoneInfo.unknown.apply( null, [ ] diff --git a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts index 1701acd896b..941e69b0e28 100644 --- a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts +++ b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.d.ts @@ -1,9 +1,9 @@ import { Calendar } from "icu4x" -import { CustomTimeZone } from "icu4x" import { DataProvider } from "icu4x" import { DateTime } from "icu4x" import { IsoDateTime } from "icu4x" import { Locale } from "icu4x" +import { TimeZoneInfo } from "icu4x" import { ZonedDateTimeFormatter } from "icu4x" export function formatDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number, name: string); export function formatIsoDatetimeWithCustomTimeZone(name: string, length: DateTimeLength, year: number, month: number, day: number, hour: number, minute: number, second: number, nanosecond: number); diff --git a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs index 007819eac61..f1176cae38d 100644 --- a/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs +++ b/ffi/capi/bindings/demo_gen/ZonedDateTimeFormatter.mjs @@ -1,9 +1,9 @@ import { Calendar } from "icu4x" -import { CustomTimeZone } from "icu4x" import { DataProvider } from "icu4x" import { DateTime } from "icu4x" import { IsoDateTime } from "icu4x" import { Locale } from "icu4x" +import { TimeZoneInfo } from "icu4x" import { ZonedDateTimeFormatter } from "icu4x" export function formatDatetimeWithCustomTimeZone() { var terminusArgs = arguments; @@ -55,7 +55,7 @@ export function formatDatetimeWithCustomTimeZone() { ) ] ), - CustomTimeZone.unknown.apply( + TimeZoneInfo.unknown.apply( null, [ ] @@ -97,7 +97,7 @@ export function formatIsoDatetimeWithCustomTimeZone() { terminusArgs[8] ] ), - CustomTimeZone.unknown.apply( + TimeZoneInfo.unknown.apply( null, [ ] diff --git a/ffi/capi/bindings/demo_gen/index.mjs b/ffi/capi/bindings/demo_gen/index.mjs index 20fdb1d8f27..58453bcc041 100644 --- a/ffi/capi/bindings/demo_gen/index.mjs +++ b/ffi/capi/bindings/demo_gen/index.mjs @@ -29,8 +29,8 @@ import * as ComposingNormalizerDemo from "./ComposingNormalizer.mjs"; export * as ComposingNormalizerDemo from "./ComposingNormalizer.mjs"; import * as DecomposingNormalizerDemo from "./DecomposingNormalizer.mjs"; export * as DecomposingNormalizerDemo from "./DecomposingNormalizer.mjs"; -import * as CustomTimeZoneDemo from "./CustomTimeZone.mjs"; -export * as CustomTimeZoneDemo from "./CustomTimeZone.mjs"; +import * as TimeZoneInfoDemo from "./TimeZoneInfo.mjs"; +export * as TimeZoneInfoDemo from "./TimeZoneInfo.mjs"; import * as TimeZoneIdMapperDemo from "./TimeZoneIdMapper.mjs"; export * as TimeZoneIdMapperDemo from "./TimeZoneIdMapper.mjs"; import * as TimeZoneIdMapperWithFastCanonicalizationDemo from "./TimeZoneIdMapperWithFastCanonicalization.mjs"; @@ -1122,19 +1122,19 @@ let termini = Object.assign({ ] }, - "CustomTimeZone.timeZoneId": { - func: CustomTimeZoneDemo.timeZoneId, + "TimeZoneInfo.timeZoneId": { + func: TimeZoneInfoDemo.timeZoneId, // For avoiding webpacking minifying issues: - funcName: "CustomTimeZone.timeZoneId", + funcName: "TimeZoneInfo.timeZoneId", parameters: [ ] }, - "CustomTimeZone.zoneVariant": { - func: CustomTimeZoneDemo.zoneVariant, + "TimeZoneInfo.zoneVariant": { + func: TimeZoneInfoDemo.zoneVariant, // For avoiding webpacking minifying issues: - funcName: "CustomTimeZone.zoneVariant", + funcName: "TimeZoneInfo.zoneVariant", parameters: [ ] diff --git a/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.d.ts b/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.d.ts index 4367c5755fb..aef979778be 100644 --- a/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.d.ts +++ b/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.d.ts @@ -1,10 +1,10 @@ // generated by diplomat-tool -import type { CustomTimeZone } from "./CustomTimeZone" import type { DataProvider } from "./DataProvider" import type { DateTimeLength } from "./DateTimeLength" import type { Error } from "./Error" import type { IsoDateTime } from "./IsoDateTime" import type { Locale } from "./Locale" +import type { TimeZoneInfo } from "./TimeZoneInfo" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; @@ -19,5 +19,5 @@ export class GregorianZonedDateTimeFormatter { static createWithLength(provider: DataProvider, locale: Locale, length: DateTimeLength): GregorianZonedDateTimeFormatter; - formatIsoDatetimeWithCustomTimeZone(datetime: IsoDateTime, timeZone: CustomTimeZone): string; + formatIsoDatetimeWithCustomTimeZone(datetime: IsoDateTime, timeZone: TimeZoneInfo): string; } \ No newline at end of file diff --git a/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.mjs b/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.mjs index b5d339975f4..a8f6f7c3911 100644 --- a/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.mjs +++ b/ffi/capi/bindings/js/GregorianZonedDateTimeFormatter.mjs @@ -1,10 +1,10 @@ // generated by diplomat-tool -import { CustomTimeZone } from "./CustomTimeZone.mjs" import { DataProvider } from "./DataProvider.mjs" import { DateTimeLength } from "./DateTimeLength.mjs" import { Error } from "./Error.mjs" import { IsoDateTime } from "./IsoDateTime.mjs" import { Locale } from "./Locale.mjs" +import { TimeZoneInfo } from "./TimeZoneInfo.mjs" import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; diff --git a/ffi/capi/bindings/js/MetazoneCalculator.d.ts b/ffi/capi/bindings/js/MetazoneCalculator.d.ts deleted file mode 100644 index 8a5e5b7a2f2..00000000000 --- a/ffi/capi/bindings/js/MetazoneCalculator.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// generated by diplomat-tool -import type { DataError } from "./DataError" -import type { DataProvider } from "./DataProvider" -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - - -/** An object capable of computing the metazone from a timezone. -* -*This can be used via `maybe_calculate_metazone()` on [`CustomTimeZone`]. -* -*[`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone -* -*See the [Rust documentation for `MetazoneCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html) for more information. -*/ -export class MetazoneCalculator { - - - get ffiValue(): pointer; - - static create(provider: DataProvider): MetazoneCalculator; -} \ No newline at end of file diff --git a/ffi/capi/bindings/js/MetazoneCalculator.mjs b/ffi/capi/bindings/js/MetazoneCalculator.mjs deleted file mode 100644 index c1df099410d..00000000000 --- a/ffi/capi/bindings/js/MetazoneCalculator.mjs +++ /dev/null @@ -1,64 +0,0 @@ -// generated by diplomat-tool -import { DataError } from "./DataError.mjs" -import { DataProvider } from "./DataProvider.mjs" -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - - -/** An object capable of computing the metazone from a timezone. -* -*This can be used via `maybe_calculate_metazone()` on [`CustomTimeZone`]. -* -*[`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone -* -*See the [Rust documentation for `MetazoneCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html) for more information. -*/ -const MetazoneCalculator_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_MetazoneCalculator_destroy_mv1(ptr); -}); - -export class MetazoneCalculator { - // Internal ptr reference: - #ptr = null; - - // Lifetimes are only to keep dependencies alive. - // Since JS won't garbage collect until there are no incoming edges. - #selfEdge = []; - - constructor(symbol, ptr, selfEdge) { - if (symbol !== diplomatRuntime.internalConstructor) { - console.error("MetazoneCalculator is an Opaque type. You cannot call its constructor."); - return; - } - - this.#ptr = ptr; - this.#selfEdge = selfEdge; - - // Are we being borrowed? If not, we can register. - if (this.#selfEdge.length === 0) { - MetazoneCalculator_box_destroy_registry.register(this, this.#ptr); - } - } - - get ffiValue() { - return this.#ptr; - } - - static create(provider) { - const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - - const result = wasm.icu4x_MetazoneCalculator_create_mv1(diplomatReceive.buffer, provider.ffiValue); - - try { - if (!diplomatReceive.resultFlag) { - const cause = new DataError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); - throw new globalThis.Error('DataError: ' + cause.value, { cause }); - } - return new MetazoneCalculator(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); - } - - finally { - diplomatReceive.free(); - } - } -} \ No newline at end of file diff --git a/ffi/capi/bindings/js/CustomTimeZone.d.ts b/ffi/capi/bindings/js/TimeZoneInfo.d.ts similarity index 80% rename from ffi/capi/bindings/js/CustomTimeZone.d.ts rename to ffi/capi/bindings/js/TimeZoneInfo.d.ts index 73f1e2558e1..5c729b94bf3 100644 --- a/ffi/capi/bindings/js/CustomTimeZone.d.ts +++ b/ffi/capi/bindings/js/TimeZoneInfo.d.ts @@ -4,21 +4,23 @@ import type { TimeZoneInvalidOffsetError } from "./TimeZoneInvalidOffsetError" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; -/** See the [Rust documentation for `CustomTimeZone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html) for more information. +/** See the [Rust documentation for `TimeZoneInfo`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html) for more information. */ -export class CustomTimeZone { +export class TimeZoneInfo { get ffiValue(): pointer; - static unknown(): CustomTimeZone; + static unknown(): TimeZoneInfo; - static utc(): CustomTimeZone; + static utc(): TimeZoneInfo; trySetOffsetSeconds(offsetSeconds: number): void; setOffsetEighthsOfHour(offsetEighthsOfHour: number): void; + trySetOffsetStr(offset: string): void; + offsetEighthsOfHour(): number | null; clearOffset(): void; diff --git a/ffi/capi/bindings/js/CustomTimeZone.mjs b/ffi/capi/bindings/js/TimeZoneInfo.mjs similarity index 68% rename from ffi/capi/bindings/js/CustomTimeZone.mjs rename to ffi/capi/bindings/js/TimeZoneInfo.mjs index 4b8cd75c087..21909907ab7 100644 --- a/ffi/capi/bindings/js/CustomTimeZone.mjs +++ b/ffi/capi/bindings/js/TimeZoneInfo.mjs @@ -5,13 +5,13 @@ import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; -/** See the [Rust documentation for `CustomTimeZone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html) for more information. +/** See the [Rust documentation for `TimeZoneInfo`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html) for more information. */ -const CustomTimeZone_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_CustomTimeZone_destroy_mv1(ptr); +const TimeZoneInfo_box_destroy_registry = new FinalizationRegistry((ptr) => { + wasm.icu4x_TimeZoneInfo_destroy_mv1(ptr); }); -export class CustomTimeZone { +export class TimeZoneInfo { // Internal ptr reference: #ptr = null; @@ -21,7 +21,7 @@ export class CustomTimeZone { constructor(symbol, ptr, selfEdge) { if (symbol !== diplomatRuntime.internalConstructor) { - console.error("CustomTimeZone is an Opaque type. You cannot call its constructor."); + console.error("TimeZoneInfo is an Opaque type. You cannot call its constructor."); return; } @@ -30,7 +30,7 @@ export class CustomTimeZone { // Are we being borrowed? If not, we can register. if (this.#selfEdge.length === 0) { - CustomTimeZone_box_destroy_registry.register(this, this.#ptr); + TimeZoneInfo_box_destroy_registry.register(this, this.#ptr); } } @@ -39,27 +39,27 @@ export class CustomTimeZone { } static unknown() { - const result = wasm.icu4x_CustomTimeZone_unknown_mv1(); + const result = wasm.icu4x_TimeZoneInfo_unknown_mv1(); try { - return new CustomTimeZone(diplomatRuntime.internalConstructor, result, []); + return new TimeZoneInfo(diplomatRuntime.internalConstructor, result, []); } finally {} } static utc() { - const result = wasm.icu4x_CustomTimeZone_utc_mv1(); + const result = wasm.icu4x_TimeZoneInfo_utc_mv1(); try { - return new CustomTimeZone(diplomatRuntime.internalConstructor, result, []); + return new TimeZoneInfo(diplomatRuntime.internalConstructor, result, []); } finally {} } trySetOffsetSeconds(offsetSeconds) { - const result = wasm.icu4x_CustomTimeZone_try_set_offset_seconds_mv1(this.ffiValue, offsetSeconds); + const result = wasm.icu4x_TimeZoneInfo_try_set_offset_seconds_mv1(this.ffiValue, offsetSeconds); try { if (result !== 1) { @@ -72,17 +72,37 @@ export class CustomTimeZone { finally {} } - setOffsetEighthsOfHour(offsetEighthsOfHour) {wasm.icu4x_CustomTimeZone_set_offset_eighths_of_hour_mv1(this.ffiValue, offsetEighthsOfHour); + setOffsetEighthsOfHour(offsetEighthsOfHour) {wasm.icu4x_TimeZoneInfo_set_offset_eighths_of_hour_mv1(this.ffiValue, offsetEighthsOfHour); try {} finally {} } + trySetOffsetStr(offset) { + let functionCleanupArena = new diplomatRuntime.CleanupArena(); + + const offsetSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, offset)); + + const result = wasm.icu4x_TimeZoneInfo_try_set_offset_str_mv1(this.ffiValue, ...offsetSlice.splat()); + + try { + if (result !== 1) { + const cause = new TimeZoneInvalidOffsetError(diplomatRuntime.internalConstructor); + throw new globalThis.Error('TimeZoneInvalidOffsetError', { cause }); + } + + } + + finally { + functionCleanupArena.free(); + } + } + offsetEighthsOfHour() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 2, 1, true); - const result = wasm.icu4x_CustomTimeZone_offset_eighths_of_hour_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_offset_eighths_of_hour_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -96,7 +116,7 @@ export class CustomTimeZone { } } - clearOffset() {wasm.icu4x_CustomTimeZone_clear_offset_mv1(this.ffiValue); + clearOffset() {wasm.icu4x_TimeZoneInfo_clear_offset_mv1(this.ffiValue); try {} @@ -106,7 +126,7 @@ export class CustomTimeZone { get offsetSeconds() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - const result = wasm.icu4x_CustomTimeZone_offset_seconds_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_offset_seconds_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -123,7 +143,7 @@ export class CustomTimeZone { get isOffsetPositive() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 2, 1, true); - const result = wasm.icu4x_CustomTimeZone_is_offset_positive_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_is_offset_positive_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -140,7 +160,7 @@ export class CustomTimeZone { get isOffsetZero() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 2, 1, true); - const result = wasm.icu4x_CustomTimeZone_is_offset_zero_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_is_offset_zero_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -157,7 +177,7 @@ export class CustomTimeZone { get offsetHoursPart() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - const result = wasm.icu4x_CustomTimeZone_offset_hours_part_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_offset_hours_part_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -174,7 +194,7 @@ export class CustomTimeZone { get offsetMinutesPart() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - const result = wasm.icu4x_CustomTimeZone_offset_minutes_part_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_offset_minutes_part_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -191,7 +211,7 @@ export class CustomTimeZone { get offsetSecondsPart() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - const result = wasm.icu4x_CustomTimeZone_offset_seconds_part_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_offset_seconds_part_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -209,7 +229,7 @@ export class CustomTimeZone { let functionCleanupArena = new diplomatRuntime.CleanupArena(); const idSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, id)); - wasm.icu4x_CustomTimeZone_set_time_zone_id_mv1(this.ffiValue, ...idSlice.splat()); + wasm.icu4x_TimeZoneInfo_set_time_zone_id_mv1(this.ffiValue, ...idSlice.splat()); try {} @@ -222,7 +242,7 @@ export class CustomTimeZone { let functionCleanupArena = new diplomatRuntime.CleanupArena(); const idSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, id)); - wasm.icu4x_CustomTimeZone_set_iana_time_zone_id_mv1(this.ffiValue, mapper.ffiValue, ...idSlice.splat()); + wasm.icu4x_TimeZoneInfo_set_iana_time_zone_id_mv1(this.ffiValue, mapper.ffiValue, ...idSlice.splat()); try {} @@ -233,7 +253,7 @@ export class CustomTimeZone { get timeZoneId() { const write = new diplomatRuntime.DiplomatWriteBuf(wasm); - wasm.icu4x_CustomTimeZone_time_zone_id_mv1(this.ffiValue, write.buffer); + wasm.icu4x_TimeZoneInfo_time_zone_id_mv1(this.ffiValue, write.buffer); try { return write.readString8(); @@ -249,7 +269,7 @@ export class CustomTimeZone { const idSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.str8(wasm, id)); - const result = wasm.icu4x_CustomTimeZone_try_set_zone_variant_mv1(this.ffiValue, ...idSlice.splat()); + const result = wasm.icu4x_TimeZoneInfo_try_set_zone_variant_mv1(this.ffiValue, ...idSlice.splat()); try { return result === 1; @@ -260,7 +280,7 @@ export class CustomTimeZone { } } - clearZoneVariant() {wasm.icu4x_CustomTimeZone_clear_zone_variant_mv1(this.ffiValue); + clearZoneVariant() {wasm.icu4x_TimeZoneInfo_clear_zone_variant_mv1(this.ffiValue); try {} @@ -270,7 +290,7 @@ export class CustomTimeZone { get zoneVariant() { const write = new diplomatRuntime.DiplomatWriteBuf(wasm); - const result = wasm.icu4x_CustomTimeZone_zone_variant_mv1(this.ffiValue, write.buffer); + const result = wasm.icu4x_TimeZoneInfo_zone_variant_mv1(this.ffiValue, write.buffer); try { return result === 0 ? null : write.readString8(); @@ -281,14 +301,14 @@ export class CustomTimeZone { } } - setStandardTime() {wasm.icu4x_CustomTimeZone_set_standard_time_mv1(this.ffiValue); + setStandardTime() {wasm.icu4x_TimeZoneInfo_set_standard_time_mv1(this.ffiValue); try {} finally {} } - setDaylightTime() {wasm.icu4x_CustomTimeZone_set_daylight_time_mv1(this.ffiValue); + setDaylightTime() {wasm.icu4x_TimeZoneInfo_set_daylight_time_mv1(this.ffiValue); try {} @@ -298,7 +318,7 @@ export class CustomTimeZone { get isStandardTime() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 2, 1, true); - const result = wasm.icu4x_CustomTimeZone_is_standard_time_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_is_standard_time_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { @@ -315,7 +335,7 @@ export class CustomTimeZone { get isDaylightTime() { const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 2, 1, true); - const result = wasm.icu4x_CustomTimeZone_is_daylight_time_mv1(diplomatReceive.buffer, this.ffiValue); + const result = wasm.icu4x_TimeZoneInfo_is_daylight_time_mv1(diplomatReceive.buffer, this.ffiValue); try { if (!diplomatReceive.resultFlag) { diff --git a/ffi/capi/bindings/js/ZoneOffsetCalculator.d.ts b/ffi/capi/bindings/js/ZoneOffsetCalculator.d.ts deleted file mode 100644 index c47dfb95f92..00000000000 --- a/ffi/capi/bindings/js/ZoneOffsetCalculator.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// generated by diplomat-tool -import type { DataError } from "./DataError" -import type { DataProvider } from "./DataProvider" -import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; - - -/** An object capable of computing UTC offsets from a timezone. -* -*This can be used via `maybe_calculate_zone_variant()` on [`CustomTimeZone`]. -* -*[`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone -* -*See the [Rust documentation for `ZoneOffsetCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneOffsetCalculator.html) for more information. -*/ -export class ZoneOffsetCalculator { - - - get ffiValue(): pointer; - - static create(provider: DataProvider): ZoneOffsetCalculator; -} \ No newline at end of file diff --git a/ffi/capi/bindings/js/ZoneOffsetCalculator.mjs b/ffi/capi/bindings/js/ZoneOffsetCalculator.mjs deleted file mode 100644 index cecb45ac94c..00000000000 --- a/ffi/capi/bindings/js/ZoneOffsetCalculator.mjs +++ /dev/null @@ -1,64 +0,0 @@ -// generated by diplomat-tool -import { DataError } from "./DataError.mjs" -import { DataProvider } from "./DataProvider.mjs" -import wasm from "./diplomat-wasm.mjs"; -import * as diplomatRuntime from "./diplomat-runtime.mjs"; - - -/** An object capable of computing UTC offsets from a timezone. -* -*This can be used via `maybe_calculate_zone_variant()` on [`CustomTimeZone`]. -* -*[`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone -* -*See the [Rust documentation for `ZoneOffsetCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneOffsetCalculator.html) for more information. -*/ -const ZoneOffsetCalculator_box_destroy_registry = new FinalizationRegistry((ptr) => { - wasm.icu4x_ZoneOffsetCalculator_destroy_mv1(ptr); -}); - -export class ZoneOffsetCalculator { - // Internal ptr reference: - #ptr = null; - - // Lifetimes are only to keep dependencies alive. - // Since JS won't garbage collect until there are no incoming edges. - #selfEdge = []; - - constructor(symbol, ptr, selfEdge) { - if (symbol !== diplomatRuntime.internalConstructor) { - console.error("ZoneOffsetCalculator is an Opaque type. You cannot call its constructor."); - return; - } - - this.#ptr = ptr; - this.#selfEdge = selfEdge; - - // Are we being borrowed? If not, we can register. - if (this.#selfEdge.length === 0) { - ZoneOffsetCalculator_box_destroy_registry.register(this, this.#ptr); - } - } - - get ffiValue() { - return this.#ptr; - } - - static create(provider) { - const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true); - - const result = wasm.icu4x_ZoneOffsetCalculator_create_mv1(diplomatReceive.buffer, provider.ffiValue); - - try { - if (!diplomatReceive.resultFlag) { - const cause = new DataError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer)); - throw new globalThis.Error('DataError: ' + cause.value, { cause }); - } - return new ZoneOffsetCalculator(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []); - } - - finally { - diplomatReceive.free(); - } - } -} \ No newline at end of file diff --git a/ffi/capi/bindings/js/ZonedDateTimeFormatter.d.ts b/ffi/capi/bindings/js/ZonedDateTimeFormatter.d.ts index 75870eddea5..e78c2de4265 100644 --- a/ffi/capi/bindings/js/ZonedDateTimeFormatter.d.ts +++ b/ffi/capi/bindings/js/ZonedDateTimeFormatter.d.ts @@ -1,11 +1,11 @@ // generated by diplomat-tool -import type { CustomTimeZone } from "./CustomTimeZone" import type { DataProvider } from "./DataProvider" import type { DateTime } from "./DateTime" import type { DateTimeLength } from "./DateTimeLength" import type { Error } from "./Error" import type { IsoDateTime } from "./IsoDateTime" import type { Locale } from "./Locale" +import type { TimeZoneInfo } from "./TimeZoneInfo" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; @@ -20,7 +20,7 @@ export class ZonedDateTimeFormatter { static createWithLength(provider: DataProvider, locale: Locale, length: DateTimeLength): ZonedDateTimeFormatter; - formatDatetimeWithCustomTimeZone(datetime: DateTime, timeZone: CustomTimeZone): string; + formatDatetimeWithCustomTimeZone(datetime: DateTime, timeZone: TimeZoneInfo): string; - formatIsoDatetimeWithCustomTimeZone(datetime: IsoDateTime, timeZone: CustomTimeZone): string; + formatIsoDatetimeWithCustomTimeZone(datetime: IsoDateTime, timeZone: TimeZoneInfo): string; } \ No newline at end of file diff --git a/ffi/capi/bindings/js/ZonedDateTimeFormatter.mjs b/ffi/capi/bindings/js/ZonedDateTimeFormatter.mjs index 245db067eed..c142bb11b83 100644 --- a/ffi/capi/bindings/js/ZonedDateTimeFormatter.mjs +++ b/ffi/capi/bindings/js/ZonedDateTimeFormatter.mjs @@ -1,11 +1,11 @@ // generated by diplomat-tool -import { CustomTimeZone } from "./CustomTimeZone.mjs" import { DataProvider } from "./DataProvider.mjs" import { DateTime } from "./DateTime.mjs" import { DateTimeLength } from "./DateTimeLength.mjs" import { Error } from "./Error.mjs" import { IsoDateTime } from "./IsoDateTime.mjs" import { Locale } from "./Locale.mjs" +import { TimeZoneInfo } from "./TimeZoneInfo.mjs" import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; diff --git a/ffi/capi/bindings/js/index.d.ts b/ffi/capi/bindings/js/index.d.ts index a33a8d50ea4..84598eeeda0 100644 --- a/ffi/capi/bindings/js/index.d.ts +++ b/ffi/capi/bindings/js/index.d.ts @@ -94,8 +94,6 @@ export { LocaleDirectionality } from "./LocaleDirectionality" export { Logger } from "./Logger" -export { MetazoneCalculator } from "./MetazoneCalculator" - export { ComposingNormalizer } from "./ComposingNormalizer" export { DecomposingNormalizer } from "./DecomposingNormalizer" @@ -166,7 +164,7 @@ export { WordSegmenter } from "./WordSegmenter" export { Time } from "./Time" -export { CustomTimeZone } from "./CustomTimeZone" +export { TimeZoneInfo } from "./TimeZoneInfo" export { TimeZoneIdMapper } from "./TimeZoneIdMapper" @@ -182,8 +180,6 @@ export { UnitsConverterFactory } from "./UnitsConverterFactory" export { WeekCalculator } from "./WeekCalculator" -export { ZoneOffsetCalculator } from "./ZoneOffsetCalculator" - export { GregorianZonedDateTimeFormatter } from "./GregorianZonedDateTimeFormatter" export { ZonedDateTimeFormatter } from "./ZonedDateTimeFormatter" diff --git a/ffi/capi/bindings/js/index.mjs b/ffi/capi/bindings/js/index.mjs index dd98151c23a..6badd4bfbbf 100644 --- a/ffi/capi/bindings/js/index.mjs +++ b/ffi/capi/bindings/js/index.mjs @@ -92,8 +92,6 @@ export { LocaleDirectionality } from "./LocaleDirectionality.mjs" export { Logger } from "./Logger.mjs" -export { MetazoneCalculator } from "./MetazoneCalculator.mjs" - export { ComposingNormalizer } from "./ComposingNormalizer.mjs" export { DecomposingNormalizer } from "./DecomposingNormalizer.mjs" @@ -164,7 +162,7 @@ export { WordSegmenter } from "./WordSegmenter.mjs" export { Time } from "./Time.mjs" -export { CustomTimeZone } from "./CustomTimeZone.mjs" +export { TimeZoneInfo } from "./TimeZoneInfo.mjs" export { TimeZoneIdMapper } from "./TimeZoneIdMapper.mjs" @@ -180,8 +178,6 @@ export { UnitsConverterFactory } from "./UnitsConverterFactory.mjs" export { WeekCalculator } from "./WeekCalculator.mjs" -export { ZoneOffsetCalculator } from "./ZoneOffsetCalculator.mjs" - export { GregorianZonedDateTimeFormatter } from "./GregorianZonedDateTimeFormatter.mjs" export { ZonedDateTimeFormatter } from "./ZonedDateTimeFormatter.mjs" diff --git a/ffi/capi/src/lib.rs b/ffi/capi/src/lib.rs index f312bf634fb..00fcc69214c 100644 --- a/ffi/capi/src/lib.rs +++ b/ffi/capi/src/lib.rs @@ -98,8 +98,6 @@ pub mod list; pub mod locale; #[cfg(feature = "locale")] pub mod locale_directionality; -#[cfg(feature = "timezone")] -pub mod metazone_calculator; #[cfg(feature = "normalizer")] pub mod normalizer; #[cfg(feature = "normalizer")] @@ -136,7 +134,5 @@ pub mod timezone_mapper; pub mod units_converter; #[cfg(feature = "calendar")] pub mod week; -#[cfg(feature = "timezone")] -pub mod zone_offset_calculator; #[cfg(feature = "datetime")] pub mod zoned_formatter; diff --git a/ffi/capi/src/metazone_calculator.rs b/ffi/capi/src/metazone_calculator.rs deleted file mode 100644 index 44467487b15..00000000000 --- a/ffi/capi/src/metazone_calculator.rs +++ /dev/null @@ -1,35 +0,0 @@ -// 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 ). - -#[diplomat::bridge] -#[diplomat::abi_rename = "icu4x_{0}_mv1"] -#[diplomat::attr(auto, namespace = "icu4x")] -pub mod ffi { - use alloc::boxed::Box; - - use crate::errors::ffi::DataError; - use crate::provider::ffi::DataProvider; - - /// An object capable of computing the metazone from a timezone. - /// - /// This can be used via `maybe_calculate_metazone()` on [`CustomTimeZone`]. - /// - /// [`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone - #[diplomat::opaque] - #[diplomat::rust_link(icu::timezone::MetazoneCalculator, Struct)] - pub struct MetazoneCalculator(pub icu_timezone::MetazoneCalculator); - - impl MetazoneCalculator { - #[diplomat::rust_link(icu::timezone::MetazoneCalculator::new, FnInStruct)] - #[diplomat::attr(supports = fallible_constructors, constructor)] - pub fn create(provider: &DataProvider) -> Result, DataError> { - Ok(Box::new(MetazoneCalculator(call_constructor!( - icu_timezone::MetazoneCalculator::new [r => Ok(r)], - icu_timezone::MetazoneCalculator::try_new_with_any_provider, - icu_timezone::MetazoneCalculator::try_new_with_buffer_provider, - provider, - )?))) - } - } -} diff --git a/ffi/capi/src/timezone.rs b/ffi/capi/src/timezone.rs index e69a43dc151..dbf3df2b0d1 100644 --- a/ffi/capi/src/timezone.rs +++ b/ffi/capi/src/timezone.rs @@ -13,23 +13,23 @@ pub mod ffi { use crate::errors::ffi::TimeZoneInvalidOffsetError; #[diplomat::opaque] - #[diplomat::rust_link(icu::timezone::CustomTimeZone, Struct)] - pub struct CustomTimeZone(pub icu_timezone::TimeZoneInfo); + #[diplomat::rust_link(icu::timezone::TimeZoneInfo, Struct)] + pub struct TimeZoneInfo(pub icu_timezone::TimeZoneInfo); - impl CustomTimeZone { + impl TimeZoneInfo { /// Creates a time zone with no information. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::unknown, FnInStruct)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::unknown, FnInStruct)] #[diplomat::rust_link(icu::timezone::TimeZoneBcp47Id::unknown, FnInStruct, hidden)] #[diplomat::attr(supports = fallible_constructors, constructor)] - pub fn unknown() -> Box { + pub fn unknown() -> Box { Box::new(icu_timezone::TimeZoneInfo::unknown().into()) } /// Creates a time zone for UTC (Coordinated Universal Time). - #[diplomat::rust_link(icu::timezone::CustomTimeZone::utc, FnInStruct)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::utc, FnInStruct)] #[diplomat::rust_link(icu::timezone::UtcOffset::zero, FnInStruct, hidden)] #[diplomat::attr(supports = fallible_constructors, named_constructor)] - pub fn utc() -> Box { + pub fn utc() -> Box { Box::new(icu_timezone::TimeZoneInfo::utc().into()) } @@ -39,7 +39,7 @@ pub mod ffi { #[diplomat::rust_link(icu::timezone::UtcOffset::try_from_seconds, FnInStruct)] #[diplomat::rust_link(icu::timezone::UtcOffset, Struct, compact)] #[diplomat::rust_link(icu::timezone::UtcOffset::from_seconds_unchecked, FnInStruct, hidden)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::new_with_offset, FnInStruct, hidden)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::new_with_offset, FnInStruct, hidden)] pub fn try_set_offset_seconds( &mut self, offset_seconds: i32, @@ -56,6 +56,21 @@ pub mod ffi { )); } + /// Sets the `offset` field from a string. + #[diplomat::rust_link(icu::timezone::UtcOffset::try_from_str, FnInStruct)] + #[diplomat::rust_link(icu::timezone::UtcOffset::try_from_utf8, FnInStruct, hidden)] + #[diplomat::rust_link(icu::timezone::UtcOffset::from_str, FnInStruct, hidden)] + pub fn try_set_offset_str( + &mut self, + offset: &DiplomatStr, + ) -> Result<(), TimeZoneInvalidOffsetError> { + self.0.offset = Some( + icu_timezone::UtcOffset::try_from_utf8(offset) + .map_err(|_| TimeZoneInvalidOffsetError)?, + ); + Ok(()) + } + /// Gets the `offset` field from offset as eighths of an hour. #[diplomat::rust_link(icu::timezone::UtcOffset::to_eighths_of_hour, FnInStruct)] pub fn offset_eighths_of_hour(&self) -> Option { @@ -129,7 +144,7 @@ pub mod ffi { /// Sets the `time_zone_id` field from a BCP-47 string. /// /// Errors if the string is not a valid BCP-47 time zone ID. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::time_zone_id, StructField)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::time_zone_id, StructField)] #[diplomat::rust_link(icu::timezone::TimeZoneBcp47Id, Struct, compact)] #[diplomat::rust_link(icu::timezone::TimeZoneBcp47Id::from_str, FnInStruct, hidden)] #[diplomat::rust_link(icu::timezone::TimeZoneBcp47Id::deref, FnInStruct, hidden)] @@ -157,7 +172,7 @@ pub mod ffi { /// Writes the value of the `time_zone_id` field as a string. /// /// Returns null if the `time_zone_id` field is empty. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::time_zone_id, StructField)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::time_zone_id, StructField)] #[diplomat::rust_link(icu::timezone::TimeZoneBcp47Id, Struct, compact)] #[diplomat::attr(auto, getter)] pub fn time_zone_id(&self, write: &mut diplomat_runtime::DiplomatWrite) { @@ -167,7 +182,7 @@ pub mod ffi { /// Sets the `zone_variant` field from a string. /// /// Returns null if the string is not a valid zone variant. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField)] #[diplomat::rust_link(icu::timezone::ZoneVariant, Struct, compact)] #[diplomat::rust_link(icu::timezone::ZoneVariant::from_str, FnInStruct, hidden)] pub fn try_set_zone_variant(&mut self, id: &DiplomatStr) -> Option<()> { @@ -178,7 +193,7 @@ pub mod ffi { } /// Clears the `zone_variant` field. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField)] #[diplomat::rust_link(icu::timezone::ZoneVariant, Struct, compact)] pub fn clear_zone_variant(&mut self) { self.0.zone_variant.take(); @@ -187,7 +202,7 @@ pub mod ffi { /// Writes the value of the `zone_variant` field as a string. /// /// Returns null if the `zone_variant` field is empty. - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField)] #[diplomat::rust_link(icu::timezone::ZoneVariant, Struct, compact)] #[diplomat::attr(auto, getter)] pub fn zone_variant(&self, write: &mut diplomat_runtime::DiplomatWrite) -> Option<()> { @@ -198,7 +213,7 @@ pub mod ffi { /// Sets the `zone_variant` field to "standard" time, which may or may /// not correspond to a display name with "Standard" in its name. #[diplomat::rust_link(icu::timezone::ZoneVariant::standard, FnInStruct)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField, compact)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField, compact)] pub fn set_standard_time(&mut self) { self.0.zone_variant = Some(icu_timezone::ZoneVariant::standard()) } @@ -206,7 +221,7 @@ pub mod ffi { /// Sets the `zone_variant` field to "daylight" time, which may or may /// not correspond to a display name with "Daylight" in its name. #[diplomat::rust_link(icu::timezone::ZoneVariant::daylight, FnInStruct)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField, compact)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField, compact)] pub fn set_daylight_time(&mut self) { self.0.zone_variant = Some(icu_timezone::ZoneVariant::daylight()) } @@ -215,7 +230,7 @@ pub mod ffi { /// /// Returns null if the `zone_variant` field is empty. #[diplomat::rust_link(icu::timezone::ZoneVariant::standard, FnInStruct)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField, compact)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField, compact)] #[diplomat::attr(auto, getter)] pub fn is_standard_time(&self) -> Option { Some(self.0.zone_variant? == icu_timezone::ZoneVariant::standard()) @@ -225,7 +240,7 @@ pub mod ffi { /// /// Returns null if the `zone_variant` field is empty. #[diplomat::rust_link(icu::timezone::ZoneVariant::daylight, FnInStruct)] - #[diplomat::rust_link(icu::timezone::CustomTimeZone::zone_variant, StructField, compact)] + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::zone_variant, StructField, compact)] #[diplomat::attr(auto, getter)] pub fn is_daylight_time(&self) -> Option { Some(self.0.zone_variant? == icu_timezone::ZoneVariant::daylight()) @@ -233,14 +248,14 @@ pub mod ffi { } } -impl From for ffi::CustomTimeZone { +impl From for ffi::TimeZoneInfo { fn from(other: icu_timezone::TimeZoneInfo) -> Self { Self(other) } } -impl From for icu_timezone::TimeZoneInfo { - fn from(other: ffi::CustomTimeZone) -> Self { +impl From for icu_timezone::TimeZoneInfo { + fn from(other: ffi::TimeZoneInfo) -> Self { other.0 } } diff --git a/ffi/capi/src/zone_offset_calculator.rs b/ffi/capi/src/zone_offset_calculator.rs deleted file mode 100644 index 0243a7e3b20..00000000000 --- a/ffi/capi/src/zone_offset_calculator.rs +++ /dev/null @@ -1,35 +0,0 @@ -// 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 ). - -#[diplomat::bridge] -#[diplomat::abi_rename = "icu4x_{0}_mv1"] -#[diplomat::attr(auto, namespace = "icu4x")] -pub mod ffi { - use alloc::boxed::Box; - - use crate::errors::ffi::DataError; - use crate::provider::ffi::DataProvider; - - /// An object capable of computing UTC offsets from a timezone. - /// - /// This can be used via `maybe_calculate_zone_variant()` on [`CustomTimeZone`]. - /// - /// [`CustomTimeZone`]: crate::timezone::ffi::CustomTimeZone - #[diplomat::opaque] - #[diplomat::rust_link(icu::timezone::ZoneOffsetCalculator, Struct)] - pub struct ZoneOffsetCalculator(pub icu_timezone::ZoneOffsetCalculator); - - impl ZoneOffsetCalculator { - #[diplomat::rust_link(icu::timezone::ZoneOffsetCalculator::new, FnInStruct)] - #[diplomat::attr(supports = fallible_constructors, constructor)] - pub fn create(provider: &DataProvider) -> Result, DataError> { - Ok(Box::new(ZoneOffsetCalculator(call_constructor!( - icu_timezone::ZoneOffsetCalculator::new [r => Ok(r)], - icu_timezone::ZoneOffsetCalculator::try_new_with_any_provider, - icu_timezone::ZoneOffsetCalculator::try_new_with_buffer_provider, - provider, - )?))) - } - } -} diff --git a/ffi/capi/src/zoned_formatter.rs b/ffi/capi/src/zoned_formatter.rs index 1b38dfe91e1..36d69f14e7d 100644 --- a/ffi/capi/src/zoned_formatter.rs +++ b/ffi/capi/src/zoned_formatter.rs @@ -15,7 +15,7 @@ pub mod ffi { use crate::{ datetime::ffi::DateTime, datetime::ffi::IsoDateTime, datetime_formatter::ffi::DateTimeLength, errors::ffi::Error, locale_core::ffi::Locale, - provider::ffi::DataProvider, timezone::ffi::CustomTimeZone, + provider::ffi::DataProvider, timezone::ffi::TimeZoneInfo, }; use writeable::TryWriteable; @@ -59,11 +59,11 @@ pub mod ffi { ))) } - /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string. + /// Formats a [`IsoDateTime`] and [`TimeZoneInfo`] to a string. pub fn format_iso_datetime_with_custom_time_zone( &self, datetime: &IsoDateTime, - time_zone: &CustomTimeZone, + time_zone: &TimeZoneInfo, write: &mut diplomat_runtime::DiplomatWrite, ) { let greg = icu_calendar::DateTime::new_from_iso(datetime.0, icu_calendar::Gregorian); @@ -112,11 +112,11 @@ pub mod ffi { )?))) } - /// Formats a [`DateTime`] and [`CustomTimeZone`] to a string. + /// Formats a [`DateTime`] and [`TimeZoneInfo`] to a string. pub fn format_datetime_with_custom_time_zone( &self, datetime: &DateTime, - time_zone: &CustomTimeZone, + time_zone: &TimeZoneInfo, write: &mut diplomat_runtime::DiplomatWrite, ) -> Result<(), Error> { let zdt = icu_timezone::CustomZonedDateTime { @@ -128,11 +128,11 @@ pub mod ffi { Ok(()) } - /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string. + /// Formats a [`IsoDateTime`] and [`TimeZoneInfo`] to a string. pub fn format_iso_datetime_with_custom_time_zone( &self, datetime: &IsoDateTime, - time_zone: &CustomTimeZone, + time_zone: &TimeZoneInfo, write: &mut diplomat_runtime::DiplomatWrite, ) -> Result<(), Error> { let zdt = icu_timezone::CustomZonedDateTime { diff --git a/ffi/capi/tests/missing_apis.txt b/ffi/capi/tests/missing_apis.txt index 7d8542f2be2..14aabf29fd7 100644 --- a/ffi/capi/tests/missing_apis.txt +++ b/ffi/capi/tests/missing_apis.txt @@ -209,7 +209,6 @@ icu::properties::props::GeneralCategoryGroup::union#FnInStruct icu::properties::props::GeneralCategoryOutOfBoundsError#Struct icu::segmenter::SentenceBreakOptions#Struct icu::segmenter::WordBreakOptions#Struct -icu::timezone::CustomTimeZone::new_with_bcp47_id#FnInStruct icu::timezone::CustomZonedDateTime#Struct icu::timezone::CustomZonedDateTime::from_str#FnInStruct icu::timezone::CustomZonedDateTime::to_calendar#FnInStruct diff --git a/tutorials/cpp/datetime.cpp b/tutorials/cpp/datetime.cpp index 64b5db99814..f05d8b9276a 100644 --- a/tutorials/cpp/datetime.cpp +++ b/tutorials/cpp/datetime.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,8 +62,8 @@ int main() { return 1; } - std::unique_ptr time_zone = CustomTimeZone::unknown(); - time_zone->try_set_offset_seconds(-18000).ok().value(); + std::unique_ptr time_zone = TimeZoneInfo::unknown(); + time_zone->try_set_offset_str("-05:00").ok().value(); int32_t offset = time_zone->offset_seconds().value(); if (offset != -18000) { std::cout << "GMT offset doesn't parse" << std::endl; From a503202356a40eb101a077e2b5ef972a80eea327 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 14:40:06 -0700 Subject: [PATCH 05/21] check --- components/datetime/src/input.rs | 6 ++--- components/datetime/src/neo_marker.rs | 12 ++++----- components/datetime/src/time_zone.rs | 36 ++++++--------------------- components/timezone/README.md | 10 +++++--- 4 files changed, 23 insertions(+), 41 deletions(-) diff --git a/components/datetime/src/input.rs b/components/datetime/src/input.rs index 86a990bd7ad..f9fc7cb951f 100644 --- a/components/datetime/src/input.rs +++ b/components/datetime/src/input.rs @@ -28,9 +28,9 @@ pub(crate) struct ExtractedInput { pub(crate) second: Option, pub(crate) nanosecond: Option, pub(crate) time_zone_id: Option, - pub(crate) offset: Option>, - pub(crate) zone_variant: Option>, - pub(crate) local_time: Option, Time)>>, + pub(crate) offset: Option, + pub(crate) zone_variant: Option, + pub(crate) local_time: Option<(Date, Time)>, } impl ExtractedInput { diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 1be01de4832..9095c6975a0 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -914,21 +914,21 @@ impl From for Option { } } -impl From for Option> { +impl From for Option { #[inline] fn from(_: NeverField) -> Self { None } } -impl From for Option> { +impl From for Option { #[inline] fn from(_: NeverField) -> Self { None } } -impl From for Option, Time)>> { +impl From for Option<(Date, Time)> { #[inline] fn from(_: NeverField) -> Self { None @@ -1053,11 +1053,11 @@ pub trait ZoneMarkers: private::Sealed { /// Marker for resolving the time zone id input field. type TimeZoneIdInput: Into>; /// Marker for resolving the time zone offset input field. - type TimeZoneOffsetInput: Into>>; + type TimeZoneOffsetInput: Into>; /// Marker for resolving the time zone variant input field. - type TimeZoneVariantInput: Into>>; + type TimeZoneVariantInput: Into>; /// Marker for resolving the time zone metazone input field. - type TimeZoneLocalTimeInput: Into, Time)>>>; + type TimeZoneLocalTimeInput: Into, Time)>>; /// Marker for loading core time zone data. type EssentialsV1Marker: DataMarker>; /// Marker for loading location names for time zone formatting diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index ad2f4cea891..f2f177ac9c5 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -11,7 +11,6 @@ use crate::{ }; use core::fmt; use fixed_decimal::FixedDecimal; -use icu_calendar::{Date, DateTime, Iso, Time}; use icu_decimal::FixedDecimalFormatter; use icu_timezone::{provider::MetazoneId, TimeZoneBcp47Id, UtcOffset, ZoneVariant}; use writeable::Writeable; @@ -218,24 +217,23 @@ impl ExtractedInput { fn zone_variant_or_guess( &self, time_zone_id: TimeZoneBcp47Id, - local_time: Option<(Date, Time)>, offset_period: &icu_timezone::provider::ZoneOffsetPeriodV1, ) -> ZoneVariant { - if let Some(zv) = self.zone_variant.flatten() { + if let Some(zv) = self.zone_variant { return zv; } - let Some(offset) = self.offset.flatten() else { + let Some(offset) = self.offset else { return ZoneVariant::standard(); }; let dst_offset = { match offset_period.0.get0(&time_zone_id) { Some(cursor) => { - let offsets = if let Some((date, time)) = local_time { + let offsets = if let Some((date, time)) = self.local_time { let mut offsets = None; let minutes_since_local_unix_epoch = - DateTime { date, time }.minutes_since_local_unix_epoch(); + icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); for (minutes, id) in cursor.iter1_copied().rev() { if minutes_since_local_unix_epoch <= ::from_unaligned(*minutes) @@ -270,15 +268,14 @@ impl ExtractedInput { fn metazone( &self, time_zone_id: TimeZoneBcp47Id, - local_time: Option<(Date, Time)>, metazone_period: &icu_timezone::provider::MetazonePeriodV1, ) -> Option { match metazone_period.0.get0(&time_zone_id) { Some(cursor) => { - if let Some((date, time)) = local_time { + if let Some((date, time)) = self.local_time { let mut metazone_id = None; let minutes_since_local_unix_epoch = - DateTime { date, time }.minutes_since_local_unix_epoch(); + icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); for (minutes, id) in cursor.iter1() { if minutes_since_local_unix_epoch >= ::from_unaligned(*minutes) @@ -427,9 +424,6 @@ impl FormatTimeZone for GenericNonLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let Some(local_time) = input.local_time else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_generic_long.as_ref(), _ => data_payloads.mz_generic_short.as_ref(), @@ -439,7 +433,6 @@ impl FormatTimeZone for GenericNonLocationFormat { let metazone_id = input.metazone( time_zone_id, - local_time, icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, ); @@ -474,12 +467,8 @@ impl FormatTimeZone for SpecificNonLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let Some(local_time) = input.local_time else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; let zone_variant = input.zone_variant_or_guess( time_zone_id, - local_time, icu_timezone::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, ); @@ -492,7 +481,6 @@ impl FormatTimeZone for SpecificNonLocationFormat { let metazone_id = input.metazone( time_zone_id, - local_time, icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, ); @@ -528,7 +516,7 @@ impl FormatTimeZone for LocalizedOffsetFormat { data_payloads: TimeZoneDataPayloadsBorrowed, fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(Some(offset)) = input.offset else { + let Some(offset) = input.offset else { return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); }; let Some(essentials) = data_payloads.essentials else { @@ -650,9 +638,6 @@ impl FormatTimeZone for SpecificLocationFormat { data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(local_time) = input.local_time else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; @@ -662,7 +647,6 @@ impl FormatTimeZone for SpecificLocationFormat { let zone_variant = input.zone_variant_or_guess( time_zone_id, - local_time, icu_timezone::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, ); @@ -700,9 +684,6 @@ impl FormatTimeZone for GenericPartialLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let Some(local_time) = input.local_time else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; let Some(locations) = data_payloads.locations else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); @@ -716,7 +697,6 @@ impl FormatTimeZone for GenericPartialLocationFormat { let metazone_id = input.metazone( time_zone_id, - local_time, icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, ); @@ -767,7 +747,7 @@ impl FormatTimeZone for Iso8601Format { _data_payloads: TimeZoneDataPayloadsBorrowed, _fdf: Option<&FixedDecimalFormatter>, ) -> Result, fmt::Error> { - let Some(Some(offset)) = input.offset else { + let Some(offset) = input.offset else { return Ok(Err(FormatTimeZoneError::MissingInputField("zone_offset"))); }; self.format_infallible(sink, offset).map(|()| Ok(())) diff --git a/components/timezone/README.md b/components/timezone/README.md index d88d38563b7..6936bdb87d6 100644 --- a/components/timezone/README.md +++ b/components/timezone/README.md @@ -93,11 +93,13 @@ use icu::timezone::TimeZoneBcp47Id; use icu::timezone::TimeZoneIdMapper; use tinystr::{tinystr, TinyAsciiStr}; -// Create a time zone for America/Chicago at UTC-6: -let mut time_zone = TimeZoneInfo::new_with_offset("-0600".parse().unwrap()); let mapper = TimeZoneIdMapper::new(); -time_zone.time_zone_id = - mapper.as_borrowed().iana_to_bcp47("America/Chicago"); +// Create a time zone for America/Chicago at UTC-6: +let mut time_zone = TimeZoneInfo { + time_zone_id: mapper.as_borrowed().iana_to_bcp47("America/Chicago"), + offset: Some("-0600".parse().unwrap()), + ..TimeZoneInfo::unknown() +}; // Alternatively, set it directly from the BCP-47 ID assert_eq!(time_zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); From a363450d6f9989989a7c8573fb864fb64b3cf038 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 14:57:01 -0700 Subject: [PATCH 06/21] move data --- components/datetime/src/provider/mod.rs | 4 + .../datetime/src/provider/time_zones.rs | 105 +++++++++++++++++- components/datetime/src/time_zone.rs | 17 +-- components/timezone/src/provider.rs | 103 +---------------- .../data/metazone_period_v1_marker.rs.data | 20 ++-- provider/data/datetime/data/mod.rs | 6 + .../data/zone_offset_period_v1_marker.rs.data | 20 ++-- provider/data/datetime/fingerprints.csv | 2 + .../metazone_period_v1_marker.rs.data | 20 ++-- provider/data/datetime/stubdata/mod.rs | 6 + .../zone_offset_period_v1_marker.rs.data | 20 ++-- provider/data/timezone/data/mod.rs | 6 - provider/data/timezone/fingerprints.csv | 2 - provider/data/timezone/stubdata/mod.rs | 6 - provider/registry/src/lib.rs | 6 +- provider/source/src/time_zones/convert.rs | 1 - provider/source/src/time_zones/mod.rs | 1 - 17 files changed, 174 insertions(+), 171 deletions(-) rename provider/data/{timezone => datetime}/data/metazone_period_v1_marker.rs.data (94%) rename provider/data/{timezone => datetime}/data/zone_offset_period_v1_marker.rs.data (96%) rename provider/data/{timezone => datetime}/stubdata/metazone_period_v1_marker.rs.data (94%) rename provider/data/{timezone => datetime}/stubdata/zone_offset_period_v1_marker.rs.data (96%) diff --git a/components/datetime/src/provider/mod.rs b/components/datetime/src/provider/mod.rs index 1c5bc01c075..0004daf25ec 100644 --- a/components/datetime/src/provider/mod.rs +++ b/components/datetime/src/provider/mod.rs @@ -49,9 +49,11 @@ const _: () = { impl_locations_v1_marker!(Baked); impl_metazone_generic_names_long_v1_marker!(Baked); impl_metazone_generic_names_short_v1_marker!(Baked); + impl_metazone_period_v1_marker!(Baked); impl_metazone_specific_names_long_v1_marker!(Baked); impl_metazone_specific_names_short_v1_marker!(Baked); impl_time_zone_essentials_v1_marker!(Baked); + impl_zone_offset_period_v1_marker!(Baked); impl_weekday_names_v1_marker!(Baked); impl_day_period_names_v1_marker!(Baked); @@ -110,9 +112,11 @@ pub const MARKERS: &[DataMarkerInfo] = &[ time_zones::LocationsV1Marker::INFO, time_zones::MetazoneGenericNamesLongV1Marker::INFO, time_zones::MetazoneGenericNamesShortV1Marker::INFO, + time_zones::MetazonePeriodV1Marker::INFO, time_zones::MetazoneSpecificNamesLongV1Marker::INFO, time_zones::MetazoneSpecificNamesShortV1Marker::INFO, time_zones::TimeZoneEssentialsV1Marker::INFO, + time_zones::ZoneOffsetPeriodV1Marker::INFO, neo::WeekdayNamesV1Marker::INFO, neo::DayPeriodNamesV1Marker::INFO, neo::GluePatternV1Marker::INFO, diff --git a/components/datetime/src/provider/time_zones.rs b/components/datetime/src/provider/time_zones.rs index c438aa74e37..8368372ebd0 100644 --- a/components/datetime/src/provider/time_zones.rs +++ b/components/datetime/src/provider/time_zones.rs @@ -7,9 +7,13 @@ use alloc::borrow::Cow; use icu_pattern::{DoublePlaceholderPattern, SinglePlaceholderPattern}; use icu_provider::prelude::*; -use zerovec::{ZeroMap, ZeroMap2d}; +use tinystr::TinyAsciiStr; +use zerovec::{ + ule::{AsULE, ULE}, + ZeroMap, ZeroMap2d, ZeroSlice, ZeroVec, +}; -pub use icu_timezone::provider::{MetazoneId, TimeZoneBcp47Id}; +pub use icu_timezone::provider::TimeZoneBcp47Id; use icu_timezone::ZoneVariant; /// Time zone type aliases for cleaner code @@ -170,3 +174,100 @@ pub struct MetazoneSpecificNamesV1<'data> { #[cfg_attr(feature = "serde", serde(borrow))] pub overrides: ZeroMap2d<'data, TimeZoneBcp47Id, ZoneVariant, str>, } + +/// Metazone ID in a compact format +/// +///
+/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, +/// including in SemVer minor releases. While the serde representation of data structs is guaranteed +/// to be stable, their Rust representation might not be. Use with caution. +///
+#[repr(transparent)] +#[derive(Debug, Clone, Copy, Eq, Ord, PartialEq, PartialOrd, yoke::Yokeable, ULE, Hash)] +#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] +#[cfg_attr(feature = "datagen", databake(path = icu_datetime::provider::time_zones))] +#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +pub struct MetazoneId(pub TinyAsciiStr<4>); + +impl AsULE for MetazoneId { + type ULE = Self; + + #[inline] + fn to_unaligned(self) -> Self::ULE { + self + } + + #[inline] + fn from_unaligned(unaligned: Self::ULE) -> Self { + unaligned + } +} + +impl<'a> zerovec::maps::ZeroMapKV<'a> for MetazoneId { + type Container = ZeroVec<'a, MetazoneId>; + type Slice = ZeroSlice; + type GetType = MetazoneId; + type OwnedType = MetazoneId; +} + +/// An ICU4X mapping to the metazones at a given period. +/// See CLDR-JSON metaZones.json for more context. +/// +///
+/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, +/// including in SemVer minor releases. While the serde representation of data structs is guaranteed +/// to be stable, their Rust representation might not be. Use with caution. +///
+#[icu_provider::data_struct(marker( + MetazonePeriodV1Marker, + "time_zone/metazone_period@1", + singleton +))] +#[derive(PartialEq, Debug, Clone, Default)] +#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] +#[cfg_attr(feature = "datagen", databake(path = icu_datetime::provider::time_zones))] +#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +#[yoke(prove_covariance_manually)] +pub struct MetazonePeriodV1<'data>( + /// The default mapping between period and metazone id. The second level key is a wall-clock time represented as + /// the number of minutes since the local unix epoch. It represents when the metazone started to be used. + #[cfg_attr(feature = "serde", serde(borrow))] + pub ZeroMap2d<'data, TimeZoneBcp47Id, IsoMinutesSinceEpoch, Option>, +); + +/// Storage type for storing UTC offsets as eights of an hour. +pub type EighthsOfHourOffset = i8; +/// Storage type for storing `DateTime` as minutes since the UNIX epoch. +pub type IsoMinutesSinceEpoch = i32; + +/// An ICU4X mapping to the time zone offsets at a given period. +/// +///
+/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, +/// including in SemVer minor releases. While the serde representation of data structs is guaranteed +/// to be stable, their Rust representation might not be. Use with caution. +///
+#[icu_provider::data_struct(marker( + ZoneOffsetPeriodV1Marker, + "time_zone/offset_period@1", + singleton +))] +#[derive(PartialEq, Debug, Clone, Default)] +#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] +#[cfg_attr(feature = "datagen", databake(path = icu_datetime::provider::time_zones))] +#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +#[yoke(prove_covariance_manually)] +pub struct ZoneOffsetPeriodV1<'data>( + /// The default mapping between period and offsets. The second level key is a wall-clock time represented as + /// the number of minutes since the local unix epoch. It represents when the offsets ended to be used. + /// + /// The values are the standard offset, and the daylight offset *relative to the standard offset*. As such, + /// if the second value is 0, there is no daylight time. + #[cfg_attr(feature = "serde", serde(borrow))] + pub ZeroMap2d< + 'data, + TimeZoneBcp47Id, + IsoMinutesSinceEpoch, + (EighthsOfHourOffset, EighthsOfHourOffset), + >, +); diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index f2f177ac9c5..0ac4ea8861c 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -4,6 +4,7 @@ //! A formatter specifically for the time zone. +use crate::provider::time_zones::MetazoneId; use crate::{ fields::{FieldLength, TimeZone}, input::ExtractedInput, @@ -12,7 +13,7 @@ use crate::{ use core::fmt; use fixed_decimal::FixedDecimal; use icu_decimal::FixedDecimalFormatter; -use icu_timezone::{provider::MetazoneId, TimeZoneBcp47Id, UtcOffset, ZoneVariant}; +use icu_timezone::{TimeZoneBcp47Id, UtcOffset, ZoneVariant}; use writeable::Writeable; /// All time zone styles that this crate can format @@ -217,7 +218,7 @@ impl ExtractedInput { fn zone_variant_or_guess( &self, time_zone_id: TimeZoneBcp47Id, - offset_period: &icu_timezone::provider::ZoneOffsetPeriodV1, + offset_period: &crate::provider::time_zones::ZoneOffsetPeriodV1, ) -> ZoneVariant { if let Some(zv) = self.zone_variant { return zv; @@ -268,7 +269,7 @@ impl ExtractedInput { fn metazone( &self, time_zone_id: TimeZoneBcp47Id, - metazone_period: &icu_timezone::provider::MetazonePeriodV1, + metazone_period: &crate::provider::time_zones::MetazonePeriodV1, ) -> Option { match metazone_period.0.get0(&time_zone_id) { Some(cursor) => { @@ -433,7 +434,7 @@ impl FormatTimeZone for GenericNonLocationFormat { let metazone_id = input.metazone( time_zone_id, - icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, + crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, ); let Some(name) = metazone_id.and_then(|mz| { @@ -469,7 +470,7 @@ impl FormatTimeZone for SpecificNonLocationFormat { }; let zone_variant = input.zone_variant_or_guess( time_zone_id, - icu_timezone::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, + crate::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, ); let Some(names) = (match self.0 { @@ -481,7 +482,7 @@ impl FormatTimeZone for SpecificNonLocationFormat { let metazone_id = input.metazone( time_zone_id, - icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, + crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, ); let Some(name) = metazone_id.and_then(|mz| { @@ -647,7 +648,7 @@ impl FormatTimeZone for SpecificLocationFormat { let zone_variant = input.zone_variant_or_guess( time_zone_id, - icu_timezone::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, + crate::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, ); if let Some(location) = locations.locations.get(&time_zone_id) { @@ -697,7 +698,7 @@ impl FormatTimeZone for GenericPartialLocationFormat { let metazone_id = input.metazone( time_zone_id, - icu_timezone::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, + crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, ); let Some(location) = locations.locations.get(&time_zone_id) else { diff --git a/components/timezone/src/provider.rs b/components/timezone/src/provider.rs index 968184f9b78..c023d0ef6a6 100644 --- a/components/timezone/src/provider.rs +++ b/components/timezone/src/provider.rs @@ -19,7 +19,7 @@ use core::ops::Deref; use icu_provider::prelude::*; use tinystr::TinyAsciiStr; use zerovec::ule::{AsULE, ULE}; -use zerovec::{ZeroMap2d, ZeroSlice, ZeroVec}; +use zerovec::{ZeroSlice, ZeroVec}; pub mod names; pub mod windows; @@ -45,19 +45,15 @@ const _: () = { make_provider!(Baked); impl_bcp47_to_iana_map_v1_marker!(Baked); impl_iana_to_bcp47_map_v3_marker!(Baked); - impl_metazone_period_v1_marker!(Baked); impl_windows_zones_to_bcp47_map_v1_marker!(Baked); - impl_zone_offset_period_v1_marker!(Baked); }; #[cfg(feature = "datagen")] /// The latest minimum set of markers required by this component. pub const MARKERS: &[DataMarkerInfo] = &[ - MetazonePeriodV1Marker::INFO, names::Bcp47ToIanaMapV1Marker::INFO, names::IanaToBcp47MapV3Marker::INFO, windows::WindowsZonesToBcp47MapV1Marker::INFO, - ZoneOffsetPeriodV1Marker::INFO, ]; /// TimeZone ID in BCP47 format @@ -112,100 +108,3 @@ impl<'a> zerovec::maps::ZeroMapKV<'a> for TimeZoneBcp47Id { type GetType = TimeZoneBcp47Id; type OwnedType = TimeZoneBcp47Id; } - -/// Metazone ID in a compact format -/// -///
-/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. While the serde representation of data structs is guaranteed -/// to be stable, their Rust representation might not be. Use with caution. -///
-#[repr(transparent)] -#[derive(Debug, Clone, Copy, Eq, Ord, PartialEq, PartialOrd, yoke::Yokeable, ULE, Hash)] -#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] -#[cfg_attr(feature = "datagen", databake(path = icu_timezone::provider))] -#[cfg_attr(feature = "serde", derive(serde::Deserialize))] -pub struct MetazoneId(pub TinyAsciiStr<4>); - -impl AsULE for MetazoneId { - type ULE = Self; - - #[inline] - fn to_unaligned(self) -> Self::ULE { - self - } - - #[inline] - fn from_unaligned(unaligned: Self::ULE) -> Self { - unaligned - } -} - -impl<'a> zerovec::maps::ZeroMapKV<'a> for MetazoneId { - type Container = ZeroVec<'a, MetazoneId>; - type Slice = ZeroSlice; - type GetType = MetazoneId; - type OwnedType = MetazoneId; -} - -/// An ICU4X mapping to the metazones at a given period. -/// See CLDR-JSON metaZones.json for more context. -/// -///
-/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. While the serde representation of data structs is guaranteed -/// to be stable, their Rust representation might not be. Use with caution. -///
-#[icu_provider::data_struct(marker( - MetazonePeriodV1Marker, - "time_zone/metazone_period@1", - singleton -))] -#[derive(PartialEq, Debug, Clone, Default)] -#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] -#[cfg_attr(feature = "datagen", databake(path = icu_timezone::provider))] -#[cfg_attr(feature = "serde", derive(serde::Deserialize))] -#[yoke(prove_covariance_manually)] -pub struct MetazonePeriodV1<'data>( - /// The default mapping between period and metazone id. The second level key is a wall-clock time represented as - /// the number of minutes since the local unix epoch. It represents when the metazone started to be used. - #[cfg_attr(feature = "serde", serde(borrow))] - pub ZeroMap2d<'data, TimeZoneBcp47Id, IsoMinutesSinceEpoch, Option>, -); - -/// Storage type for storing UTC offsets as eights of an hour. -pub type EighthsOfHourOffset = i8; -/// Storage type for storing `DateTime` as minutes since the UNIX epoch. -pub type IsoMinutesSinceEpoch = i32; - -/// An ICU4X mapping to the time zone offsets at a given period. -/// -///
-/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. While the serde representation of data structs is guaranteed -/// to be stable, their Rust representation might not be. Use with caution. -///
-#[icu_provider::data_struct(marker( - ZoneOffsetPeriodV1Marker, - "time_zone/offset_period@1", - singleton -))] -#[derive(PartialEq, Debug, Clone, Default)] -#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] -#[cfg_attr(feature = "datagen", databake(path = icu_timezone::provider))] -#[cfg_attr(feature = "serde", derive(serde::Deserialize))] -#[yoke(prove_covariance_manually)] -pub struct ZoneOffsetPeriodV1<'data>( - /// The default mapping between period and offsets. The second level key is a wall-clock time represented as - /// the number of minutes since the local unix epoch. It represents when the offsets ended to be used. - /// - /// The values are the standard offset, and the daylight offset *relative to the standard offset*. As such, - /// if the second value is 0, there is no daylight time. - #[cfg_attr(feature = "serde", serde(borrow))] - pub ZeroMap2d< - 'data, - TimeZoneBcp47Id, - IsoMinutesSinceEpoch, - (EighthsOfHourOffset, EighthsOfHourOffset), - >, -); diff --git a/provider/data/timezone/data/metazone_period_v1_marker.rs.data b/provider/data/datetime/data/metazone_period_v1_marker.rs.data similarity index 94% rename from provider/data/timezone/data/metazone_period_v1_marker.rs.data rename to provider/data/datetime/data/metazone_period_v1_marker.rs.data index 61f472883ec..bb597013143 100644 --- a/provider/data/timezone/data/metazone_period_v1_marker.rs.data +++ b/provider/data/datetime/data/metazone_period_v1_marker.rs.data @@ -16,18 +16,18 @@ macro_rules! __impl_metazone_period_v1_marker { #[clippy::msrv = "1.71.1"] impl $provider { #[doc(hidden)] - pub const SINGLETON_METAZONE_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::timezone::provider::MetazonePeriodV1(unsafe { + pub const SINGLETON_METAZONE_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::datetime::provider::time_zones::MetazonePeriodV1(unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"adalv\0\0\0aedxb\0\0\0afkbl\0\0\0aganu\0\0\0aiaxa\0\0\0altia\0\0\0amevn\0\0\0ancur\0\0\0aolad\0\0\0aqcas\0\0\0aqdav\0\0\0aqddu\0\0\0aqmaw\0\0\0aqmcm\0\0\0aqplm\0\0\0aqrot\0\0\0aqsyw\0\0\0aqtrl\0\0\0aqvos\0\0\0arbue\0\0\0arcor\0\0\0arctc\0\0\0arirj\0\0\0arjuj\0\0\0arluq\0\0\0armdz\0\0\0arrgl\0\0\0arsla\0\0\0artuc\0\0\0aruaq\0\0\0arush\0\0\0asppg\0\0\0atvie\0\0\0auadl\0\0\0aubhq\0\0\0aubne\0\0\0audrw\0\0\0aueuc\0\0\0auhba\0\0\0auldc\0\0\0auldh\0\0\0aumel\0\0\0aumqi\0\0\0auper\0\0\0ausyd\0\0\0awaua\0\0\0azbak\0\0\0basjj\0\0\0bbbgi\0\0\0bddac\0\0\0bebru\0\0\0bfoua\0\0\0bgsof\0\0\0bhbah\0\0\0bibjm\0\0\0bjptn\0\0\0bmbda\0\0\0bnbwn\0\0\0bolpb\0\0\0bqkra\0\0\0braux\0\0\0brbel\0\0\0brbvb\0\0\0brcgb\0\0\0brcgr\0\0\0brern\0\0\0brfen\0\0\0brfor\0\0\0brmao\0\0\0brmcz\0\0\0brpvh\0\0\0brrbr\0\0\0brrec\0\0\0brsao\0\0\0brssa\0\0\0brstm\0\0\0bsnas\0\0\0btthi\0\0\0bwgbe\0\0\0bymsq\0\0\0bzbze\0\0\0cacfq\0\0\0caedm\0\0\0cafne\0\0\0caglb\0\0\0cagoo\0\0\0cahal\0\0\0caiql\0\0\0camon\0\0\0careb\0\0\0careg\0\0\0casjf\0\0\0cator\0\0\0cavan\0\0\0cawnp\0\0\0caybx\0\0\0caycb\0\0\0cayda\0\0\0caydq\0\0\0cayek\0\0\0cayev\0\0\0cayxy\0\0\0cayyn\0\0\0cayzs\0\0\0cccck\0\0\0cdfbm\0\0\0cdfih\0\0\0cfbgf\0\0\0cgbzv\0\0\0chzrh\0\0\0ciabj\0\0\0ckrar\0\0\0clipc\0\0\0clpuq\0\0\0clscl\0\0\0cmdla\0\0\0cnsha\0\0\0cnurc\0\0\0cobog\0\0\0crsjo\0\0\0cuhav\0\0\0cvrai\0\0\0cxxch\0\0\0cyfmg\0\0\0cynic\0\0\0czprg\0\0\0deber\0\0\0debsngn\0djjib\0\0\0dkcph\0\0\0dmdom\0\0\0dosdq\0\0\0dzalg\0\0\0ecgps\0\0\0ecgye\0\0\0eetll\0\0\0egcai\0\0\0eheai\0\0\0erasm\0\0\0esceu\0\0\0eslpa\0\0\0esmad\0\0\0etadd\0\0\0fihel\0\0\0fimhq\0\0\0fjsuv\0\0\0fkpsy\0\0\0fmksa\0\0\0fmpni\0\0\0fmtkk\0\0\0fotho\0\0\0frpar\0\0\0galbv\0\0\0gazastrpgblon\0\0\0gdgnd\0\0\0getbs\0\0\0gfcay\0\0\0gggci\0\0\0ghacc\0\0\0gigib\0\0\0gldkshvnglgoh\0\0\0globy\0\0\0glthu\0\0\0gmbjl\0\0\0gmt\0\0\0\0\0gncky\0\0\0gpbbr\0\0\0gpmsb\0\0\0gpsbh\0\0\0gqssg\0\0\0grath\0\0\0gsgrv\0\0\0gtgua\0\0\0gugum\0\0\0gwoxb\0\0\0gygeo\0\0\0hebron\0\0hkhkg\0\0\0hntgu\0\0\0hrzag\0\0\0htpap\0\0\0hubud\0\0\0iddjj\0\0\0idjkt\0\0\0idmak\0\0\0idpnk\0\0\0iedub\0\0\0imdgs\0\0\0inccu\0\0\0iodga\0\0\0iqbgw\0\0\0irthr\0\0\0isrey\0\0\0itrom\0\0\0jeruslm\0jesth\0\0\0jmkin\0\0\0joamm\0\0\0jptyo\0\0\0kenbo\0\0\0kgfru\0\0\0khpnh\0\0\0kicxi\0\0\0kipho\0\0\0kitrw\0\0\0kmyva\0\0\0knbas\0\0\0kpfnj\0\0\0krsel\0\0\0kwkwi\0\0\0kygec\0\0\0kzaau\0\0\0kzakx\0\0\0kzala\0\0\0kzguw\0\0\0kzksn\0\0\0kzkzo\0\0\0kzura\0\0\0lavte\0\0\0lbbey\0\0\0lccas\0\0\0livdz\0\0\0lkcmb\0\0\0lrmlw\0\0\0lsmsu\0\0\0ltvno\0\0\0lulux\0\0\0lvrix\0\0\0lytip\0\0\0macas\0\0\0mcmon\0\0\0mdkiv\0\0\0metgd\0\0\0mgtnr\0\0\0mhkwa\0\0\0mhmaj\0\0\0mkskp\0\0\0mlbko\0\0\0mmrgn\0\0\0mnhvd\0\0\0mnuln\0\0\0momfm\0\0\0mpspn\0\0\0mqfdf\0\0\0mrnkc\0\0\0msmni\0\0\0mtmla\0\0\0muplu\0\0\0mvmle\0\0\0mwblz\0\0\0mxchi\0\0\0mxcjs\0\0\0mxcun\0\0\0mxhmo\0\0\0mxmam\0\0\0mxmex\0\0\0mxmid\0\0\0mxmty\0\0\0mxmzt\0\0\0mxoji\0\0\0mxpvr\0\0\0mxtij\0\0\0mykch\0\0\0mykul\0\0\0mzmpm\0\0\0nawdh\0\0\0ncnou\0\0\0nenim\0\0\0nfnlk\0\0\0nglos\0\0\0nimga\0\0\0nlams\0\0\0noosl\0\0\0npktm\0\0\0nrinu\0\0\0nuiue\0\0\0nzakl\0\0\0nzcht\0\0\0ommct\0\0\0papty\0\0\0pelim\0\0\0pfgmr\0\0\0pfnhv\0\0\0pfppt\0\0\0pgpom\0\0\0pgraw\0\0\0phmnl\0\0\0pkkhi\0\0\0plwaw\0\0\0pmmqc\0\0\0pnpcn\0\0\0prsju\0\0\0ptfnc\0\0\0ptlis\0\0\0ptpdl\0\0\0pwror\0\0\0pyasu\0\0\0qadoh\0\0\0rereu\0\0\0robuh\0\0\0rsbeg\0\0\0ruasf\0\0\0ruchita\0rudyr\0\0\0rugdx\0\0\0ruikt\0\0\0rukgd\0\0\0rukhndg\0rukra\0\0\0rukuf\0\0\0rumow\0\0\0runoz\0\0\0ruoms\0\0\0ruovb\0\0\0rupkc\0\0\0rurtw\0\0\0rusred\0\0ruuly\0\0\0ruunera\0ruuus\0\0\0ruvog\0\0\0ruvvo\0\0\0ruyek\0\0\0ruyks\0\0\0rwkgl\0\0\0saruh\0\0\0sbhir\0\0\0scmaw\0\0\0sdkrt\0\0\0sesto\0\0\0sgsin\0\0\0shshn\0\0\0silju\0\0\0sjlyr\0\0\0skbts\0\0\0slfna\0\0\0smsai\0\0\0sndkr\0\0\0somgq\0\0\0srpbm\0\0\0ssjub\0\0\0sttms\0\0\0svsal\0\0\0sxphi\0\0\0sydam\0\0\0szqmn\0\0\0tcgdt\0\0\0tdndj\0\0\0tfpfr\0\0\0tglfw\0\0\0thbkk\0\0\0tjdyu\0\0\0tkfko\0\0\0tldil\0\0\0tmasb\0\0\0tntun\0\0\0totbu\0\0\0trist\0\0\0ttpos\0\0\0tvfun\0\0\0twtpe\0\0\0tzdar\0\0\0uaiev\0\0\0uasip\0\0\0ugkla\0\0\0umawk\0\0\0ummdy\0\0\0usadk\0\0\0usaeg\0\0\0usanc\0\0\0usboi\0\0\0uschi\0\0\0usden\0\0\0usdet\0\0\0ushnl\0\0\0usind\0\0\0usinvev\0usjnu\0\0\0usknx\0\0\0uslax\0\0\0uslui\0\0\0usmnm\0\0\0usmoc\0\0\0usmtm\0\0\0usndcnt\0usndnsl\0usnyc\0\0\0usoea\0\0\0usome\0\0\0usphx\0\0\0ussit\0\0\0ustel\0\0\0uswlz\0\0\0uswsq\0\0\0usxul\0\0\0usyak\0\0\0uymvd\0\0\0uzskd\0\0\0uztas\0\0\0vavat\0\0\0vcsvd\0\0\0veccs\0\0\0vgtov\0\0\0vistt\0\0\0vnsgn\0\0\0vuvli\0\0\0wfmau\0\0\0wsapw\0\0\0yeade\0\0\0ytmam\0\0\0zajnb\0\0\0zmlun\0\0\0zwhre\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0\x05\0\0\0\x06\0\0\0\x08\0\0\0\t\0\0\0\n\0\0\0\x1B\0\0\0\x1C\0\0\0\x1D\0\0\0\x1E\0\0\0\x1F\0\0\0!\0\0\0\"\0\0\0#\0\0\0$\0\0\0%\0\0\0&\0\0\0(\0\0\0,\0\0\x001\0\0\x003\0\0\0<\0\0\0?\0\0\0B\0\0\0D\0\0\0H\0\0\0M\0\0\0O\0\0\0Q\0\0\0R\0\0\0S\0\0\0T\0\0\0U\0\0\0V\0\0\0W\0\0\0X\0\0\0Y\0\0\0[\0\0\0\\\0\0\0]\0\0\0^\0\0\0_\0\0\0`\0\0\0b\0\0\0c\0\0\0d\0\0\0f\0\0\0g\0\0\0h\0\0\0i\0\0\0k\0\0\0l\0\0\0m\0\0\0n\0\0\0o\0\0\0p\0\0\0q\0\0\0r\0\0\0s\0\0\0t\0\0\0u\0\0\0v\0\0\0y\0\0\0z\0\0\0{\0\0\0|\0\0\0}\0\0\0~\0\0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\0\0\x15\x01\0\0\x17\x01\0\0\x18\x01\0\0\x1A\x01\0\0\x1B\x01\0\0\x1C\x01\0\0\x1D\x01\0\0\x1E\x01\0\0\x1F\x01\0\0 \x01\0\0!\x01\0\0\"\x01\0\0$\x01\0\0&\x01\0\0(\x01\0\0)\x01\0\0*\x01\0\0+\x01\0\0,\x01\0\0-\x01\0\0.\x01\0\0/\x01\0\x001\x01\0\x002\x01\0\x003\x01\0\x004\x01\0\x005\x01\0\x007\x01\0\08\x01\0\09\x01\0\0:\x01\0\0;\x01\0\0<\x01\0\0=\x01\0\0@\x01\0\0A\x01\0\0B\x01\0\0C\x01\0\0G\x01\0\0K\x01\0\0N\x01\0\0P\x01\0\0R\x01\0\0W\x01\0\0[\x01\0\0\\\x01\0\0]\x01\0\0^\x01\0\0_\x01\0\0b\x01\0\0d\x01\0\0e\x01\0\0i\x01\0\0j\x01\0\0l\x01\0\0s\x01\0\0v\x01\0\0w\x01\0\0y\x01\0\0z\x01\0\0{\x01\0\0}\x01\0\0~\x01\0\0\x7F\x01\0\0\x80\x01\0\0\x81\x01\0\0\x82\x01\0\0\x83\x01\0\0\x85\x01\0\0\x87\x01\0\0\x88\x01\0\0\x89\x01\0\0\x8A\x01\0\0\x8B\x01\0\0\x8C\x01\0\0\x8D\x01\0\0\x8E\x01\0\0\x91\x01\0\0\x95\x01\0\0\x9B\x01\0\0\x9C\x01\0\0\x9D\x01\0\0\x9E\x01\0\0\xA1\x01\0\0\xA2\x01\0\0\xA3\x01\0\0\xA6\x01\0\0\xA8\x01\0\0\xA9\x01\0\0\xAB\x01\0\0\xAD\x01\0\0\xAE\x01\0\0\xB2\x01\0\0\xB3\x01\0\0\xB4\x01\0\0\xB5\x01\0\0\xB6\x01\0\0\xBD\x01\0\0\xBE\x01\0\0\xBF\x01\0\0\xC0\x01\0\0\xC1\x01\0\0\xC2\x01\0\0\xC3\x01\0\0\xC4\x01\0\0\xC5\x01\0\0\xC6\x01\0\0\xC7\x01\0\0\xC8\x01\0\0\xC9\x01\0\0\xCA\x01\0\0\xCB\x01\0\0\xCC\x01\0\0\xCD\x01\0\0\xCF\x01\0\0\xD0\x01\0\0\xD2\x01\0\0\xD3\x01\0\0\xD4\x01\0\0\xD5\x01\0\0\xD9\x01\0\0\xDC\x01\0\0\xDD\x01\0\0\xDE\x01\0\0\xE0\x01\0\0\xE1\x01\0\0\xE2\x01\0\0\xE3\x01\0\0\xE4\x01\0\0\xE7\x01\0\0\xEA\x01\0\0\xEB\x01\0\0\xEC\x01\0\0\xF0\x01\0\0\xF3\x01\0\0\xF4\x01\0\0\xF8\x01\0\0\xFB\x01\0\0\xFE\x01\0\0\xFF\x01\0\0\0\x02\0\0\x01\x02\0\0\x02\x02\0\0\x03\x02\0\0\x04\x02\0\0\x07\x02\0\0\x08\x02\0\0\t\x02\0\0\n\x02\0\0\x0C\x02\0\0\r\x02\0\0\x0E\x02\0\0\x0F\x02\0\0\x10\x02\0\0\x11\x02\0\0\x14\x02\0\0\x15\x02\0\0\x16\x02\0\0\x17\x02\0\0\x18\x02\0\0\x19\x02\0\0\x1A\x02\0\0\x1B\x02\0\0\x1C\x02\0\0\x1D\x02\0\0\x1E\x02\0\0 \x02\0\0#\x02\0\0&\x02\0\0'\x02\0\0(\x02\0\0)\x02\0\0*\x02\0\0-\x02\0\0.\x02\0\0/\x02\0\x000\x02\0\x001\x02\0\x003\x02\0\x004\x02\0\x007\x02\0\09\x02\0\0:\x02\0\0;\x02\0\0?\x02\0\0@\x02\0\0A\x02\0\0B\x02\0\0C\x02\0\0E\x02\0\0J\x02\0\0K\x02\0\0L\x02\0\0N\x02\0\0P\x02\0\0S\x02\0\0U\x02\0\0V\x02\0\0W\x02\0\0X\x02\0\0Y\x02\0\0[\x02\0\0\\\x02\0\0]\x02\0\0`\x02\0\0c\x02\0\0d\x02\0\0g\x02\0\0i\x02\0\0k\x02\0\0o\x02\0\0q\x02\0\0s\x02\0\0t\x02\0\0w\x02\0\0y\x02\0\0z\x02\0\0|\x02\0\0~\x02\0\0\x81\x02\0\0\x85\x02\0\0\x87\x02\0\0\x88\x02\0\0\x89\x02\0\0\x8D\x02\0\0\x8F\x02\0\0\x90\x02\0\0\x91\x02\0\0\x92\x02\0\0\x93\x02\0\0\x94\x02\0\0\x95\x02\0\0\x96\x02\0\0\x97\x02\0\0\x98\x02\0\0\x99\x02\0\0\x9A\x02\0\0\x9B\x02\0\0\x9C\x02\0\0\x9D\x02\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0pY\xAE\0\0\0\0\0\0\0\0\0\0\0\0\0\xF8]?\x01\x84eB\x01x\xA0O\x01\\2R\x01 \xA3w\x01\xFC\xBB\x82\x01\xF0Y\x87\x01\xA0\xE2\x8A\x01\xF4M\x8F\x01\xC0\xBA\x92\x01\x01X\x97\x01\xEC\xE0\x9A\x01\x81W\x9F\x01l\xE0\xA2\x01\x01W\xA7\x01\xC0\xCF\xAA\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x14\xF2b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\xF3\xAE\0\0\0\0\x000\xF3\xAE\0\xF42\x14\x01\x10\x9E\x14\x01\0\0\0\0\x18\xD4\xA9\0pM\xAB\0\xF42\x14\x01\x10\x9E\x14\x01\0\0\0\0p\xA4\xAE\0\0\0\0\0\x18\x18\xA2\0\x10\xDA\xAB\0\x94\xC7\xEE\0\x94\x1E\xF2\0T-\x14\x01\xF0b\x15\x01Xf1\x01\xF08?\x01\0\0\0\0\xB0\xF2\xB6\0P\xC5\x16\x01\0\0\0\0\xF42\x14\x01\x10\x9E\x14\x01\0\0\0\x000\xF3\xAE\0\0\0\0\x000\xF3\xAE\0\xF42\x14\x01\xB0v\x14\x01\0\0\0\0\x18\xD4\xA9\0pM\xAB\0T-\x14\x01\xF0b\x15\x01\0\0\0\0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0\0\0\0\0D\x1B\xAF\0\xA4\xEC\"\x01\0\0\0\0\0\0\0\0\xE47 \0\xA4\xAD&\0\0\0\0\0d\xAE\x1A\0\0\0\0\0\x84e\xF7\0\0\0\0\0\xD8\xD4o\x01\xB8\xFA\x87\x01\xD8\xAB\x89\x01\0\0\0\0\0\x1B\xB7\0\0\0\0\0@d\x0F\x01\0\0\0\0\0\0\0\0\xA4\xEC\"\x01\xC4\xB0/\x01\0\0\0\0\xBC\xA6o\0\0\0\0\0\0\0\0\0\xBC\xA6o\0\0\0\0\0\xA4\xEC\"\x01\0\0\0\0\xA4\xEC\"\x01@v*\x01\0\0\0\0\x84\xD3>\0\xA4\xEC\"\x01\xC4\xB0/\x01\0\0\0\0\xE0\xD6G\x01\xBC\xA6o\0\0\0\0\0\0\0\0\0xG^\08Gb\08\xDD\xAD\0\0\0\0\08\xDD\xAD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0@\xB2+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01euce\x01gulf\x01afgh\x01atla\x01atla\x01euce\0\0\0\0\0\x01arme\x01atla\x01afwe\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01davi\x01dumo\x01maws\x01neze\x01arge\x01chil\x01roth\x01syow\x01mgmt\x01vost\x01arge\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arge\x01arge\0\0\0\0\0\x01samo\x01euce\x01auce\x01auce\x01auea\x01auce\x01aucw\x01auea\x01auea\x01auea\x01loho\x01auea\x01auea\x01auwe\x01auea\x01atla\0\0\0\0\0\x01azer\x01euce\x01atla\0\0\0\0\0\x01bang\x01euce\x01mgmt\x01euea\x01gulf\x01arab\x01afce\x01afwe\x01atla\x01brun\x01boli\x01atla\x01bras\x01bras\x01amaz\x01amaz\x01amaz\x01acre\x01amaz\x01acre\x01noro\x01bras\x01amaz\x01bras\x01amaz\x01acre\x01amaz\x01acre\x01bras\x01bras\x01bras\x01amaz\x01bras\x01amea\x01indi\x01bhut\x01afce\x01mosc\x01euea\x01eufe\x01mosc\x01amce\x01ammo\x01ammo\x01ampa\x01ammo\x01atla\x01atla\0\0\0\0\0\x01atla\x01atla\x01amea\x01amce\x01amea\x01atla\x01amce\x01amea\x01amce\x01amea\x01amce\x01amce\x01newf\x01amea\x01ampa\x01amce\x01atla\x01ammo\x01amce\x01amea\x01amce\x01ammo\x01ampa\x01yuko\x01ampa\x01ammo\x01amce\x01amea\x01amce\x01ampa\x01ammo\x01ampa\x01yuko\x01ammo\x01amce\x01amea\x01coco\x01afce\x01afwe\x01afwe\x01afwe\x01euce\x01mgmt\x01cook\x01east\x01chil\x01chil\x01afwe\x01chin\0\0\0\0\0\x01colo\x01amce\x01cuba\x01cave\x01chri\x01euea\x01euea\x01euce\x01euce\x01euce\x01afea\x01euce\x01atla\0\0\0\0\0\x01atla\x01amea\x01atla\x01euwe\x01euce\x01euwe\x01euce\x01ecua\x01gala\x01ecua\x01mosc\x01euea\x01euea\0\0\0\0\0\x01euwe\x01afea\x01euwe\x01euce\x01euwe\x01euce\x01afea\x01euea\x01euea\x01fiji\x01falk\x01kosr\x01pona\x01truk\x01euwe\x01euce\x01afwe\x01isra\x01euea\0\0\0\0\0\x01mgmt\x01atla\0\0\0\0\0\x01geor\x01frgu\0\0\0\0\0\x01mgmt\x01mgmt\x01euce\x01grwe\x01mgmt\x01grwe\x01gree\0\0\0\0\0\x01grea\x01gree\x01atla\x01mgmt\x01mgmt\x01mgmt\x01atla\x01atla\x01atla\x01afwe\x01euea\x01soge\x01amce\x01guam\x01cham\0\0\0\0\0\x01mgmt\x01guya\x01isra\x01euea\x01hoko\x01amce\x01euce\x01amea\x01euce\x01inea\x01inwe\x01ince\x01ince\x01inwe\0\0\0\0\0\x01mgmt\0\0\0\0\0\x01mgmt\x01indi\x01inoc\x01arab\x01iran\x01mgmt\x01euce\x01isra\0\0\0\0\0\x01mgmt\x01amea\x01euea\x01japa\x01afea\0\0\0\0\0\x01kyrg\x01indo\x01liis\x01phis\x01giis\x01afea\x01atla\x01kore\x01pyon\x01kore\x01kore\x01arab\x01amea\0\0\0\0\0\x01aqta\x01kawe\x01kaza\0\0\0\0\0\x01aqto\x01kawe\x01kaza\x01alam\x01kaea\x01kaza\x01kawe\x01kaza\x01kaea\x01kaza\0\0\0\0\0\x01qyzy\x01kaea\x01kawe\x01kaza\0\0\0\0\0\0\0\0\0\0\x01kawe\x01kaza\x01indo\x01euea\x01atla\x01euce\x01indi\x01lank\x01indi\0\0\0\0\0\x01mgmt\x01afso\x01mosc\x01euea\x01euce\x01euea\x01euce\x01mosc\x01euea\x01euea\x01euce\x01euea\x01euce\x01euea\x01euce\x01euea\x01euwe\x01euce\x01euwe\x01euce\x01mosc\x01euea\x01euce\x01afea\0\0\0\0\0\x01mais\x01mais\x01euce\x01mgmt\x01myan\x01hovd\x01mong\x01maca\x01chin\x01noma\x01cham\x01atla\x01mgmt\x01atla\x01euce\x01maur\x01mald\x01afce\x01amce\x01mepa\x01amce\x01amce\x01mepa\x01amce\x01ammo\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01mepa\x01amce\x01amce\x01amce\x01amea\x01amce\x01amce\x01mepa\x01amce\x01ammo\x01amce\x01ammo\x01amce\x01ampa\0\0\0\0\0\x01mala\0\0\0\0\0\x01mala\x01afce\x01afso\x01afce\x01afwe\x01afce\x01neca\x01afwe\x01norf\x01afwe\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01amce\x01euce\x01euce\x01nepa\x01naur\x01niue\x01neze\x01chat\x01gulf\x01amea\x01peru\x01gamb\x01marq\x01tahi\x01pang\x01pang\x01phil\0\0\0\0\0\x01paki\x01euce\x01atla\x01pimi\x01pitc\x01atla\x01euwe\x01euce\x01euwe\x01euce\x01euwe\x01azor\x01euwe\x01azor\x01pala\x01para\x01gulf\x01arab\x01reun\x01euea\x01euce\x01mosc\x01yaku\x01irku\x01yaku\x01anad\x01maga\x01anad\x01maga\x01irku\x01mosc\x01euea\x01eufe\x01euea\x01yaku\x01vlad\x01yaku\x01kras\0\0\0\0\0\x01mosc\x01euea\x01sama\x01mosc\x01euea\x01mosc\x01kras\x01novo\x01kras\x01omsk\x01novo\x01kamc\x01mosc\x01maga\x01mosc\x01yaku\x01maga\x01vlad\x01sakh\x01volg\x01vlad\0\0\0\0\0\x01yeka\x01yaku\x01afce\x01arab\x01solo\x01seyc\x01afce\x01afea\x01afce\x01euce\x01sing\x01mgmt\x01euce\x01euce\x01euce\x01mgmt\x01euce\x01mgmt\x01afea\0\0\0\0\0\x01suri\x01afce\x01afea\x01afce\x01mgmt\x01afwe\x01mgmt\x01amce\x01atla\x01euea\x01afso\x01amea\x01atla\x01amea\x01afwe\x01frso\x01mgmt\x01indo\0\0\0\0\0\x01taji\x01toke\x01eati\x01ince\x01eati\0\0\0\0\0\x01turk\x01euce\x01tong\x01euea\0\0\0\0\0\x01euea\0\0\0\0\0\x01atla\x01tuva\x01taip\x01afea\x01mosc\x01euea\x01mosc\x01euea\x01mosc\x01euea\x01mosc\x01afea\x01wake\0\0\0\0\0\x01samo\0\0\0\0\0\x01haal\x01amea\x01amce\x01amea\0\0\0\0\0\x01alas\x01ammo\x01amce\x01ammo\x01amea\0\0\0\0\0\x01haal\x01amea\x01amea\x01ampa\x01ampa\x01alas\x01amce\x01amea\x01amce\x01ampa\x01amea\x01amce\x01amea\x01amea\x01amce\x01amce\x01amea\x01ampa\x01alas\x01ampa\x01alas\x01ammo\x01amce\x01ammo\x01amce\x01amea\x01amea\x01amce\x01amea\0\0\0\0\0\x01alas\x01ammo\x01ampa\x01alas\x01amea\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01ammo\x01amce\x01alas\x01urug\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01uzbe\0\0\0\0\0\x01uzbe\x01euce\x01atla\x01vene\x01atla\x01atla\x01indo\x01vanu\x01wall\x01apia\x01arab\x01afea\x01afso\x01afce\x01afce") }) }); } #[clippy::msrv = "1.71.1"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.id.locale.is_default() { Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(Self::SINGLETON_METAZONE_PERIOD_V1_MARKER), metadata: Default::default() }) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -35,7 +35,7 @@ macro_rules! __impl_metazone_period_v1_marker { ($ provider : ty , ITER) => { __impl_metazone_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } @@ -44,12 +44,12 @@ macro_rules! __impl_metazone_period_v1_marker { ($ provider : ty , DRY) => { __impl_metazone_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -57,17 +57,17 @@ macro_rules! __impl_metazone_period_v1_marker { ($ provider : ty , DRY , ITER) => { __impl_metazone_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } diff --git a/provider/data/datetime/data/mod.rs b/provider/data/datetime/data/mod.rs index b59e9db22e3..1a0d38444ba 100644 --- a/provider/data/datetime/data/mod.rs +++ b/provider/data/datetime/data/mod.rs @@ -46,6 +46,8 @@ include!("time_zone_essentials_v1_marker.rs.data"); include!("metazone_generic_names_long_v1_marker.rs.data"); include!("metazone_generic_names_short_v1_marker.rs.data"); include!("locations_v1_marker.rs.data"); +include!("metazone_period_v1_marker.rs.data"); +include!("zone_offset_period_v1_marker.rs.data"); include!("metazone_specific_names_long_v1_marker.rs.data"); include!("metazone_specific_names_short_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like @@ -124,6 +126,8 @@ macro_rules! impl_data_provider { impl_metazone_generic_names_long_v1_marker!($provider); impl_metazone_generic_names_short_v1_marker!($provider); impl_locations_v1_marker!($provider); + impl_metazone_period_v1_marker!($provider); + impl_zone_offset_period_v1_marker!($provider); impl_metazone_specific_names_long_v1_marker!($provider); impl_metazone_specific_names_short_v1_marker!($provider); }; @@ -182,6 +186,8 @@ macro_rules! impl_any_provider { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), diff --git a/provider/data/timezone/data/zone_offset_period_v1_marker.rs.data b/provider/data/datetime/data/zone_offset_period_v1_marker.rs.data similarity index 96% rename from provider/data/timezone/data/zone_offset_period_v1_marker.rs.data rename to provider/data/datetime/data/zone_offset_period_v1_marker.rs.data index b17a8cd029c..8331ffe3ff6 100644 --- a/provider/data/timezone/data/zone_offset_period_v1_marker.rs.data +++ b/provider/data/datetime/data/zone_offset_period_v1_marker.rs.data @@ -16,18 +16,18 @@ macro_rules! __impl_zone_offset_period_v1_marker { #[clippy::msrv = "1.71.1"] impl $provider { #[doc(hidden)] - pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::timezone::provider::ZoneOffsetPeriodV1(unsafe { + pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::datetime::provider::time_zones::ZoneOffsetPeriodV1(unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"adalv\0\0\0aedxb\0\0\0afkbl\0\0\0aganu\0\0\0aiaxa\0\0\0altia\0\0\0amevn\0\0\0ancur\0\0\0aolad\0\0\0aqcas\0\0\0aqdav\0\0\0aqddu\0\0\0aqmaw\0\0\0aqmcm\0\0\0aqplm\0\0\0aqrot\0\0\0aqsyw\0\0\0aqtrl\0\0\0aqvos\0\0\0arbue\0\0\0arcor\0\0\0arctc\0\0\0arirj\0\0\0arjuj\0\0\0arluq\0\0\0armdz\0\0\0arrgl\0\0\0arsla\0\0\0artuc\0\0\0aruaq\0\0\0arush\0\0\0asppg\0\0\0atvie\0\0\0auadl\0\0\0aubhq\0\0\0aubne\0\0\0audrw\0\0\0aueuc\0\0\0auhba\0\0\0auldc\0\0\0auldh\0\0\0aumel\0\0\0aumqi\0\0\0auper\0\0\0ausyd\0\0\0awaua\0\0\0azbak\0\0\0basjj\0\0\0bbbgi\0\0\0bddac\0\0\0bebru\0\0\0bfoua\0\0\0bgsof\0\0\0bhbah\0\0\0bibjm\0\0\0bjptn\0\0\0bmbda\0\0\0bnbwn\0\0\0bolpb\0\0\0bqkra\0\0\0braux\0\0\0brbel\0\0\0brbvb\0\0\0brcgb\0\0\0brcgr\0\0\0brern\0\0\0brfen\0\0\0brfor\0\0\0brmao\0\0\0brmcz\0\0\0brpvh\0\0\0brrbr\0\0\0brrec\0\0\0brsao\0\0\0brssa\0\0\0brstm\0\0\0bsnas\0\0\0btthi\0\0\0bwgbe\0\0\0bymsq\0\0\0bzbze\0\0\0cacfq\0\0\0caedm\0\0\0cafne\0\0\0caglb\0\0\0cagoo\0\0\0cahal\0\0\0caiql\0\0\0camon\0\0\0careb\0\0\0careg\0\0\0casjf\0\0\0cator\0\0\0cavan\0\0\0cawnp\0\0\0caybx\0\0\0caycb\0\0\0cayda\0\0\0caydq\0\0\0cayek\0\0\0cayev\0\0\0cayxy\0\0\0cayyn\0\0\0cayzs\0\0\0cccck\0\0\0cdfbm\0\0\0cdfih\0\0\0cfbgf\0\0\0cgbzv\0\0\0chzrh\0\0\0ciabj\0\0\0ckrar\0\0\0clipc\0\0\0clpuq\0\0\0clscl\0\0\0cmdla\0\0\0cnsha\0\0\0cnurc\0\0\0cobog\0\0\0crsjo\0\0\0cuhav\0\0\0cvrai\0\0\0cxxch\0\0\0cyfmg\0\0\0cynic\0\0\0czprg\0\0\0deber\0\0\0debsngn\0djjib\0\0\0dkcph\0\0\0dmdom\0\0\0dosdq\0\0\0dzalg\0\0\0ecgps\0\0\0ecgye\0\0\0eetll\0\0\0egcai\0\0\0eheai\0\0\0erasm\0\0\0esceu\0\0\0eslpa\0\0\0esmad\0\0\0etadd\0\0\0fihel\0\0\0fimhq\0\0\0fjsuv\0\0\0fkpsy\0\0\0fmksa\0\0\0fmpni\0\0\0fmtkk\0\0\0fotho\0\0\0frpar\0\0\0galbv\0\0\0gazastrpgblon\0\0\0gdgnd\0\0\0getbs\0\0\0gfcay\0\0\0gggci\0\0\0ghacc\0\0\0gigib\0\0\0gldkshvnglgoh\0\0\0globy\0\0\0glthu\0\0\0gmbjl\0\0\0gmt\0\0\0\0\0gncky\0\0\0gpbbr\0\0\0gpmsb\0\0\0gpsbh\0\0\0gqssg\0\0\0grath\0\0\0gsgrv\0\0\0gtgua\0\0\0gugum\0\0\0gwoxb\0\0\0gygeo\0\0\0hebron\0\0hkhkg\0\0\0hntgu\0\0\0hrzag\0\0\0htpap\0\0\0hubud\0\0\0iddjj\0\0\0idjkt\0\0\0idmak\0\0\0idpnk\0\0\0iedub\0\0\0imdgs\0\0\0inccu\0\0\0iodga\0\0\0iqbgw\0\0\0irthr\0\0\0isrey\0\0\0itrom\0\0\0jeruslm\0jesth\0\0\0jmkin\0\0\0joamm\0\0\0jptyo\0\0\0kenbo\0\0\0kgfru\0\0\0khpnh\0\0\0kicxi\0\0\0kipho\0\0\0kitrw\0\0\0kmyva\0\0\0knbas\0\0\0kpfnj\0\0\0krsel\0\0\0kwkwi\0\0\0kygec\0\0\0kzaau\0\0\0kzakx\0\0\0kzala\0\0\0kzguw\0\0\0kzksn\0\0\0kzkzo\0\0\0kzura\0\0\0lavte\0\0\0lbbey\0\0\0lccas\0\0\0livdz\0\0\0lkcmb\0\0\0lrmlw\0\0\0lsmsu\0\0\0ltvno\0\0\0lulux\0\0\0lvrix\0\0\0lytip\0\0\0macas\0\0\0mcmon\0\0\0mdkiv\0\0\0metgd\0\0\0mgtnr\0\0\0mhkwa\0\0\0mhmaj\0\0\0mkskp\0\0\0mlbko\0\0\0mmrgn\0\0\0mnhvd\0\0\0mnuln\0\0\0momfm\0\0\0mpspn\0\0\0mqfdf\0\0\0mrnkc\0\0\0msmni\0\0\0mtmla\0\0\0muplu\0\0\0mvmle\0\0\0mwblz\0\0\0mxchi\0\0\0mxcjs\0\0\0mxcun\0\0\0mxhmo\0\0\0mxmam\0\0\0mxmex\0\0\0mxmid\0\0\0mxmty\0\0\0mxmzt\0\0\0mxoji\0\0\0mxpvr\0\0\0mxtij\0\0\0mykch\0\0\0mykul\0\0\0mzmpm\0\0\0nawdh\0\0\0ncnou\0\0\0nenim\0\0\0nfnlk\0\0\0nglos\0\0\0nimga\0\0\0nlams\0\0\0noosl\0\0\0npktm\0\0\0nrinu\0\0\0nuiue\0\0\0nzakl\0\0\0nzcht\0\0\0ommct\0\0\0papty\0\0\0pelim\0\0\0pfgmr\0\0\0pfnhv\0\0\0pfppt\0\0\0pgpom\0\0\0pgraw\0\0\0phmnl\0\0\0pkkhi\0\0\0plwaw\0\0\0pmmqc\0\0\0pnpcn\0\0\0prsju\0\0\0ptfnc\0\0\0ptlis\0\0\0ptpdl\0\0\0pwror\0\0\0pyasu\0\0\0qadoh\0\0\0rereu\0\0\0robuh\0\0\0rsbeg\0\0\0ruasf\0\0\0rubax\0\0\0ruchita\0rudyr\0\0\0rugdx\0\0\0ruikt\0\0\0rukgd\0\0\0rukhndg\0rukra\0\0\0rukuf\0\0\0rukvx\0\0\0rumow\0\0\0runoz\0\0\0ruoms\0\0\0ruovb\0\0\0rupkc\0\0\0rurtw\0\0\0rusred\0\0rutof\0\0\0ruuly\0\0\0ruunera\0ruuus\0\0\0ruvog\0\0\0ruvvo\0\0\0ruyek\0\0\0ruyks\0\0\0rwkgl\0\0\0saruh\0\0\0sbhir\0\0\0scmaw\0\0\0sdkrt\0\0\0sesto\0\0\0sgsin\0\0\0shshn\0\0\0silju\0\0\0sjlyr\0\0\0skbts\0\0\0slfna\0\0\0smsai\0\0\0sndkr\0\0\0somgq\0\0\0srpbm\0\0\0ssjub\0\0\0sttms\0\0\0svsal\0\0\0sxphi\0\0\0sydam\0\0\0szqmn\0\0\0tcgdt\0\0\0tdndj\0\0\0tfpfr\0\0\0tglfw\0\0\0thbkk\0\0\0tjdyu\0\0\0tkfko\0\0\0tldil\0\0\0tmasb\0\0\0tntun\0\0\0totbu\0\0\0trist\0\0\0ttpos\0\0\0tvfun\0\0\0twtpe\0\0\0tzdar\0\0\0uaiev\0\0\0uasip\0\0\0ugkla\0\0\0umawk\0\0\0ummdy\0\0\0usadk\0\0\0usaeg\0\0\0usanc\0\0\0usboi\0\0\0uschi\0\0\0usden\0\0\0usdet\0\0\0ushnl\0\0\0usind\0\0\0usinvev\0usjnu\0\0\0usknx\0\0\0uslax\0\0\0uslui\0\0\0usmnm\0\0\0usmoc\0\0\0usmtm\0\0\0usndcnt\0usndnsl\0usnyc\0\0\0usoea\0\0\0usome\0\0\0usphx\0\0\0ussit\0\0\0ustel\0\0\0uswlz\0\0\0uswsq\0\0\0usxul\0\0\0usyak\0\0\0utc\0\0\0\0\0utce01\0\0utce02\0\0utce03\0\0utce04\0\0utce05\0\0utce06\0\0utce07\0\0utce08\0\0utce09\0\0utce10\0\0utce11\0\0utce12\0\0utce13\0\0utce14\0\0utcw01\0\0utcw02\0\0utcw03\0\0utcw04\0\0utcw05\0\0utcw06\0\0utcw07\0\0utcw08\0\0utcw09\0\0utcw10\0\0utcw11\0\0utcw12\0\0uymvd\0\0\0uzskd\0\0\0uztas\0\0\0vavat\0\0\0vcsvd\0\0\0veccs\0\0\0vgtov\0\0\0vistt\0\0\0vnsgn\0\0\0vuvli\0\0\0wfmau\0\0\0wsapw\0\0\0yeade\0\0\0ytmam\0\0\0zajnb\0\0\0zmlun\0\0\0zwhre\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91\x01\0\0\x92\x01\0\0\x95\x01\0\0\x97\x01\0\0\x9A\x01\0\0\x9B\x01\0\0\x9C\x01\0\0\x9E\x01\0\0\x9F\x01\0\0\xA1\x01\0\0\xA3\x01\0\0\xA4\x01\0\0\xA6\x01\0\0\xA7\x01\0\0\xAC\x01\0\0\xAF\x01\0\0\xB1\x01\0\0\xB3\x01\0\0\xB5\x01\0\0\xB6\x01\0\0\xB8\x01\0\0\xB9\x01\0\0\xBE\x01\0\0\xC5\x01\0\0\xC8\x01\0\0\xCA\x01\0\0\xCF\x01\0\0\xD0\x01\0\0\xD5\x01\0\0\xD6\x01\0\0\xDA\x01\0\0\xDC\x01\0\0\xDF\x01\0\0\xE0\x01\0\0\xE3\x01\0\0\xE6\x01\0\0\xE8\x01\0\0\xED\x01\0\0\xEF\x01\0\0\xF0\x01\0\0\xF1\x01\0\0\xF3\x01\0\0\xF6\x01\0\0\xF7\x01\0\0\0\x02\0\0\x04\x02\0\0\x05\x02\0\0\n\x02\0\0\x0B\x02\0\0\x0F\x02\0\0\x10\x02\0\0\x12\x02\0\0\x15\x02\0\0\x19\x02\0\0\x1E\x02\0\0\x1F\x02\0\0 \x02\0\0!\x02\0\0\"\x02\0\0#\x02\0\0$\x02\0\0%\x02\0\0&\x02\0\0)\x02\0\0*\x02\0\0,\x02\0\0.\x02\0\x000\x02\0\x003\x02\0\08\x02\0\0:\x02\0\0<\x02\0\0>\x02\0\0?\x02\0\0B\x02\0\0C\x02\0\0D\x02\0\0E\x02\0\0G\x02\0\0H\x02\0\0L\x02\0\0M\x02\0\0O\x02\0\0R\x02\0\0W\x02\0\0X\x02\0\0[\x02\0\0\\\x02\0\0`\x02\0\0c\x02\0\0f\x02\0\0g\x02\0\0h\x02\0\0m\x02\0\0n\x02\0\0q\x02\0\0t\x02\0\0u\x02\0\0v\x02\0\0w\x02\0\0z\x02\0\0|\x02\0\0}\x02\0\0~\x02\0\0\x85\x02\0\0\x8D\x02\0\0\x93\x02\0\0\x9A\x02\0\0\xA3\x02\0\0\xAD\x02\0\0\xB5\x02\0\0\xB6\x02\0\0\xB7\x02\0\0\xB8\x02\0\0\xBA\x02\0\0\xBE\x02\0\0\xC0\x02\0\0\xC1\x02\0\0\xC7\x02\0\0\xC9\x02\0\0\xD0\x02\0\0\xD8\x02\0\0\xDF\x02\0\0\xE2\x02\0\0\xE6\x02\0\0\xE8\x02\0\0\xE9\x02\0\0\xEB\x02\0\0\xEC\x02\0\0\xEE\x02\0\0\xEF\x02\0\0\xF0\x02\0\0\xF3\x02\0\0\xF6\x02\0\0\xF8\x02\0\0\xFA\x02\0\0\xFD\x02\0\0\xFE\x02\0\0\xFF\x02\0\0\x04\x03\0\0\x06\x03\0\0\x07\x03\0\0\x08\x03\0\0\r\x03\0\0\x12\x03\0\0\x16\x03\0\0\x19\x03\0\0\x1B\x03\0\0\x1F\x03\0\0#\x03\0\0&\x03\0\0(\x03\0\0-\x03\0\0/\x03\0\x003\x03\0\x004\x03\0\x006\x03\0\x007\x03\0\0:\x03\0\0<\x03\0\0=\x03\0\0B\x03\0\0C\x03\0\0L\x03\0\0N\x03\0\0P\x03\0\0R\x03\0\0T\x03\0\0U\x03\0\0V\x03\0\0W\x03\0\0X\x03\0\0Y\x03\0\0[\x03\0\0\\\x03\0\0]\x03\0\0^\x03\0\0_\x03\0\0a\x03\0\0c\x03\0\0f\x03\0\0h\x03\0\0k\x03\0\0m\x03\0\0n\x03\0\0r\x03\0\0v\x03\0\0z\x03\0\0{\x03\0\0~\x03\0\0\x80\x03\0\0\x81\x03\0\0\x86\x03\0\0\x88\x03\0\0\x90\x03\0\0\x98\x03\0\0\x9E\x03\0\0\xA4\x03\0\0\xAA\x03\0\0\xAF\x03\0\0\xB4\x03\0\0\xBD\x03\0\0\xC2\x03\0\0\xCA\x03\0\0\xD1\x03\0\0\xD6\x03\0\0\xDB\x03\0\0\xE0\x03\0\0\xE8\x03\0\0\xED\x03\0\0\xF5\x03\0\0\xFA\x03\0\0\x02\x04\0\0\t\x04\0\0\x10\x04\0\0\x18\x04\0\0!\x04\0\0&\x04\0\0+\x04\0\x000\x04\0\x001\x04\0\x002\x04\0\x003\x04\0\x004\x04\0\08\x04\0\0:\x04\0\0<\x04\0\0=\x04\0\0?\x04\0\0A\x04\0\0C\x04\0\0D\x04\0\0G\x04\0\0H\x04\0\0I\x04\0\0K\x04\0\0O\x04\0\0R\x04\0\0T\x04\0\0U\x04\0\0X\x04\0\0Y\x04\0\0]\x04\0\0`\x04\0\0a\x04\0\0b\x04\0\0c\x04\0\0g\x04\0\0i\x04\0\0l\x04\0\0o\x04\0\0q\x04\0\0t\x04\0\0\x80\x04\0\0\x81\x04\0\0\x82\x04\0\0\x84\x04\0\0\x85\x04\0\0\x89\x04\0\0\x93\x04\0\0\x94\x04\0\0\x95\x04\0\0\x96\x04\0\0\x9B\x04\0\0\xA1\x04\0\0\xA6\x04\0\0\xA9\x04\0\0\xAA\x04\0\0\xAB\x04\0\0\xAF\x04\0\0\xB0\x04\0\0\xB3\x04\0\0\xB6\x04\0\0\xBA\x04\0\0\xBD\x04\0\0\xBE\x04\0\0\xC2\x04\0\0\xC4\x04\0\0\xC6\x04\0\0\xCB\x04\0\0\xCD\x04\0\0\xCF\x04\0\0\xD0\x04\0\0\xD5\x04\0\0\xDA\x04\0\0\xDB\x04\0\0\xDD\x04\0\0\xE0\x04\0\0\xE5\x04\0\0\xEA\x04\0\0\xEC\x04\0\0\xED\x04\0\0\xEE\x04\0\0\xEF\x04\0\0\xF0\x04\0\0\xF1\x04\0\0\xF2\x04\0\0\xF3\x04\0\0\xF4\x04\0\0\xF5\x04\0\0\xF6\x04\0\0\xF7\x04\0\0\xF8\x04\0\0\xF9\x04\0\0\xFA\x04\0\0\xFB\x04\0\0\xFC\x04\0\0\xFD\x04\0\0\xFE\x04\0\0\xFF\x04\0\0\0\x05\0\0\x01\x05\0\0\x02\x05\0\0\x03\x05\0\0\x04\x05\0\0\x05\x05\0\0\x06\x05\0\0\x07\x05\0\0\x08\x05\0\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\xC8\x08\xC0\0\xC0\x08\xC8\0\xC8\0\xD0\0\xD8\x004\0\x10\0\x08\0\x08\0\x08\0\x08\0\x08\x08\0\0\xAC\0\xB0\x04\xB0\0\xC8\x08\xD0\x08\xE0\x08\xE0\0\xE8\0\xE0\x08\x08\0@\x08@\x000\0\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xF0\0\xF8\08\0\x10\x08\x10\0\x10\x08\x18\0\x10\x08\x10\x08\x10\0\x10\x08\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\x18\0\x08\0\x08\x08\xE0\0\xD8\x04\xD8\0\xE0\0\xD8\x08\xE0\0\0\x08\0\0\x08\x08\x08\0\0\x08\0\0\x08\0\xD8\0\xD0\x08\xD0\0\xD8\x08\xD8\0\x18\x08\x10\x08\x10\0\x18\x08\x10\x08\x10\x08\xF8\0\0\x08\0\0\0\x08\x08\0\x18\0\0\x08\0\0\x08\0\x08\x08\0\0\0\x08\x08\x08\x08\0\x08\x08\x18\0\x10\x08\x10\0\x10\x08\x10\x08\x10\0\x10\x08`\x08`\0\xE0\0\xE8\x08\xE8\0\xE0\x08\xE8\0`\0X\0X\0P\0\0\0\0\x08\x08\x08\x08\0\x08\x08\x08\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\0\x08\0\0\0\x08\xE0\0 \x08\x18\0 \x08\x18\x08 \0\xE8\0\x08\0\0\x08\0\0\0\x08\0\0\x08\0\x08\x08\xE8\0\xE8\x08\0\0\xE8\0\xE8\x08\xF0\0\xF0\x08\xF0\0\xF0\x08\xF0\0\xF8\x08\xF0\x08\xE0\x08\0\0\0\0\0\0\xE0\0\xE0\0\xE0\0\x08\0\x10\x08\x10\0\x10\x08\xF0\0\xD0\x08\xD0\0P\x08P\0\xF8\0\0\0\xE2\0\xE8\0\xE0\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08@\x08@\0\xD0\x08\xD0\0\x08\0\x08\x08\xD8\x08\x08\x08\x08\0\x08\x08H\08\0@\0@\08\0\0\x08\x08\0\0\x08\0\0\0\x08,\0(\x000\0\x18\0\x18\x08\x18\0\x1C\0 \x08 \0\x1C\x08\x1C\0\0\0\x08\x08\x08\0\x08\x08\x10\x08\x08\0\0\x08\0\0\0\x08\xD8\0\xD8\x08\xD8\0\x10\x08\x10\0\x18\0H\0\x18\x000\x08(\x000\x08(\x080\08\0\xAB\0\xB0\0p\0\xA0\0\xA8\0h\0`\0\x18\0\xE0\0H\0D\0H\0H\x08H\0\x18\0\xD8\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x08(\x000\x080\x000\x08(\x080\0(\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x080\0(\0(\0(\x080\0(\x08(\x000\x08(\x08 \x080\0(\0(\0(\x080\0(\x08(\0(\x08 \x08(\08\0\x10\x08\xE0\0\x08\0\x08\x08,\x004\x000\0,\0\xFB\0\0\0\x10\0\x18\x08\x10\0\x08\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\x08\x10\x08\x10\0\x10\x08\x10\0\x18\x08\x10\x08\x10\0\x08\x08\x08\0\x10\0\x08\0\x10\0\x08\0\x10\0\0\x08\0\0\x08\0\0\x08\0\0\0\x08\x08\0\x08\x08\x08\0\x08\x08\x18\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\0\xA0\0`\0`\0\x08\0\x08\x08\0\x004\x000\08\x088\08\0@\x08@\0@\x08@\0P\x08P\0\xE0\0\xE0\x08\xE0\0\0\0\xE0\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08 \x08 \0(\0\x10\0\xD0\0\xD0\x08\xC8\x08\xC8\0\xD0\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xC8\x08\xD0\0\xD8\0\xD0\x08\xD8\0\xC8\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xD0\x08\xD0\0\xD0\x08\xD0\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD0\0\xD0\x08\xD0\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xD0\x08\xC8\x08\xD0\0\xC0\0\xC0\x08\xC0\0\xC0\x08@\0<\0@\0\x10\0\x10\0\x08\x08\x10\0X\x08X\0\x08\0\\\0\\\x08\\\0X\0X\x08\x08\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD8\0\xD0\0\xD8\0\xD0\x08\xD0\0\x08\0\x08\x08\x08\0\x08\x08,\0.\0\\\0`\0\xA8\0`\x08f\x08 \0\xD8\0\xD8\x08\xD8\0\xB8\0\xB4\0\xB0\0P\0P\0X\0@\x08@\0(\0(\x08(\0\x08\0\x08\x08\xE0\0\xE8\0\xE8\x08\xBC\0\xC0\0\xE0\0\0\0\0\x08\0\0\0\x08\x08\0\0\x08\x08\x08\0\x08\xF8\0\xF8\x08\0\x08\xF8\x08H\0\xE0\0\xE8\0\xE0\x08 \0\x18\0 \0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\x08\x08 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \08\x088\08\x080\x080\08\x000\08\0H\x08@\x08H\0P\0@\0H\0h\x08`\x08X\x08`\0X\0`\0X\x08P\x08X\0`\0P\0X\0@\x088\x08@\0H\0@\0\x18\x08\x10\x08\x10\0\x18\0\x10\0H\x08H\0P\x08H\x08@\x08P\0X\0P\0H\08\x080\x088\0@\08\0 \x08\x18\0 \x08\x18\x08\x10\x08 \0\x18\0 \0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0\x18\x08\x10\x08\x18\0 \0\x18\08\x080\x088\x000\08\x000\x08(\x080\08\x000\08\x088\08\x080\x080\08\x000\08\0`\x08X\x08`\0X\0`\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0X\x08P\x08X\0`\0X\08\x088\08\x080\x080\08\x000\08\0 \x08\x18\x08\x10\x08\x18\0 \0\x18\0 \0H\0X\x08P\x08X\0`\0X\0P\0X\x08X\0X\x08P\x08P\0X\0P\0X\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0\x18\0P\x08H\x08P\0X\0P\0(\x08 \x08(\x000\0(\0H\x08@\x08H\0P\0H\0\x10\0\x18\0X\0 \0\x10\x08\x10\0\x18\0\x10\0\x08\0\x08\x08<\0@\0\0\0\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\0\0\x08\x08\x08\0\x08\x08\0\0\x18\0\xE4\0\xE8\0\x10\x08\x10\0\x18\0\x10\0\0\0\x08\0\0\0\xD0\x08\xD0\0\xE0\0\x10\x08\x10\0\x18\0\x10\0\xD8\0\xD8\x08\xE0\0\xD8\x08\x08\0\x08\x08\x08\0(\0\0\08\x000\x08(\x080\x08(\0\xA8\0h\0H\0@\0H\0(\x08 \x08(\0\x08\x08\x08\0h\0h\x08h\0\x10\x08\x10\0\x18\x08\x18\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x18\0\xE0\0`\0@\x08@\0\x18\0\x18\x08\x10\x08\x18\x08\x10\x08\x18\x08\x18\0\x10\0\x10\x08\x18\x08\x18\0\x18\x08\x10\x08 \0\x18\0\x18\0`\0\xA8\0\xA8\x08\xB0\0\xB0\x08\xA8\x08\xB0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD8\x08\xB0\x08\xB8\0\xB8\x08\xB0\x08\xB8\x08\xC8\x08\xC8\0\xC8\x08\xD0\x08\xC8\x08\xD8\0\xD8\x08\xD8\0\xD8\x08\xB0\0\xD8\x08\xD8\0\xD8\x08\xD8\x08\xD8\0\xD8\x08\xC0\x08\xC0\0\xC0\x08\xB8\x08\xD0\x08\xD8\0\xD0\x08\xC0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\x08\xD8\x08\xC0\x08\xC0\0\xB8\x08\xC0\0\xB8\x08\xC8\x08\xD0\x08\xC8\x08\xD0\x08\xD8\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xA8\x08\xB8\0\xB8\x08\xA8\x08\xB8\x08\xC8\0\xC0\x08\xB8\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xD0\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xC8\x08\xD0\x08\xB8\x08\0\0\x08\0\x10\0\x18\0 \0(\x000\08\0@\0H\0P\0X\0`\0h\0p\0\xF8\0\xF0\0\xE8\0\xE0\0\xD8\0\xD0\0\xC8\0\xC0\0\xB8\0\xB0\0\xA8\0\xA0\0\xE8\x08\xE8\0\xE8\x08\xE8\0(\0(\x080\0(\x08(\x000\x08(\x08(\0\x08\x08\x08\0\x08\x08\xE0\0\xE0\0\xDC\0\xE0\0\xE0\0\xE0\0@\08\0X\x08X\0`\0\xA8\x08\xA8\0h\x08h\0\x18\0\x18\0\x10\0\x10\0\x10\0") }) }); } #[clippy::msrv = "1.71.1"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.id.locale.is_default() { Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(Self::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER), metadata: Default::default() }) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -35,7 +35,7 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } @@ -44,12 +44,12 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -57,17 +57,17 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } diff --git a/provider/data/datetime/fingerprints.csv b/provider/data/datetime/fingerprints.csv index 341596b80e2..c0828cc9a4e 100644 --- a/provider/data/datetime/fingerprints.csv +++ b/provider/data/datetime/fingerprints.csv @@ -35814,6 +35814,8 @@ time_zone/locations@1, zh-Hant, 9144B, 8985B, 26eed758c6fb3d8d time_zone/locations@1, zh-MO, -> zh-HK time_zone/locations@1, zh-SG, 9247B, 9088B, dbf3a8f8eb62d828 time_zone/locations@1, zu, 9086B, 8927B, cebb6ba6c35f2d98 +time_zone/metazone_period@1, , 11097B, 11009B, dcfa50fb39ebd549 +time_zone/offset_period@1, , 13374B, 13286B, 397b18d3f2345411 time_zone/specific_long@1, , 948B, 190 identifiers time_zone/specific_long@1, , 1638778B, 1605415B, 185 unique payloads time_zone/specific_long@1, af, 6872B, 6692B, 92b73e3a6b592d73 diff --git a/provider/data/timezone/stubdata/metazone_period_v1_marker.rs.data b/provider/data/datetime/stubdata/metazone_period_v1_marker.rs.data similarity index 94% rename from provider/data/timezone/stubdata/metazone_period_v1_marker.rs.data rename to provider/data/datetime/stubdata/metazone_period_v1_marker.rs.data index 61f472883ec..bb597013143 100644 --- a/provider/data/timezone/stubdata/metazone_period_v1_marker.rs.data +++ b/provider/data/datetime/stubdata/metazone_period_v1_marker.rs.data @@ -16,18 +16,18 @@ macro_rules! __impl_metazone_period_v1_marker { #[clippy::msrv = "1.71.1"] impl $provider { #[doc(hidden)] - pub const SINGLETON_METAZONE_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::timezone::provider::MetazonePeriodV1(unsafe { + pub const SINGLETON_METAZONE_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::datetime::provider::time_zones::MetazonePeriodV1(unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"adalv\0\0\0aedxb\0\0\0afkbl\0\0\0aganu\0\0\0aiaxa\0\0\0altia\0\0\0amevn\0\0\0ancur\0\0\0aolad\0\0\0aqcas\0\0\0aqdav\0\0\0aqddu\0\0\0aqmaw\0\0\0aqmcm\0\0\0aqplm\0\0\0aqrot\0\0\0aqsyw\0\0\0aqtrl\0\0\0aqvos\0\0\0arbue\0\0\0arcor\0\0\0arctc\0\0\0arirj\0\0\0arjuj\0\0\0arluq\0\0\0armdz\0\0\0arrgl\0\0\0arsla\0\0\0artuc\0\0\0aruaq\0\0\0arush\0\0\0asppg\0\0\0atvie\0\0\0auadl\0\0\0aubhq\0\0\0aubne\0\0\0audrw\0\0\0aueuc\0\0\0auhba\0\0\0auldc\0\0\0auldh\0\0\0aumel\0\0\0aumqi\0\0\0auper\0\0\0ausyd\0\0\0awaua\0\0\0azbak\0\0\0basjj\0\0\0bbbgi\0\0\0bddac\0\0\0bebru\0\0\0bfoua\0\0\0bgsof\0\0\0bhbah\0\0\0bibjm\0\0\0bjptn\0\0\0bmbda\0\0\0bnbwn\0\0\0bolpb\0\0\0bqkra\0\0\0braux\0\0\0brbel\0\0\0brbvb\0\0\0brcgb\0\0\0brcgr\0\0\0brern\0\0\0brfen\0\0\0brfor\0\0\0brmao\0\0\0brmcz\0\0\0brpvh\0\0\0brrbr\0\0\0brrec\0\0\0brsao\0\0\0brssa\0\0\0brstm\0\0\0bsnas\0\0\0btthi\0\0\0bwgbe\0\0\0bymsq\0\0\0bzbze\0\0\0cacfq\0\0\0caedm\0\0\0cafne\0\0\0caglb\0\0\0cagoo\0\0\0cahal\0\0\0caiql\0\0\0camon\0\0\0careb\0\0\0careg\0\0\0casjf\0\0\0cator\0\0\0cavan\0\0\0cawnp\0\0\0caybx\0\0\0caycb\0\0\0cayda\0\0\0caydq\0\0\0cayek\0\0\0cayev\0\0\0cayxy\0\0\0cayyn\0\0\0cayzs\0\0\0cccck\0\0\0cdfbm\0\0\0cdfih\0\0\0cfbgf\0\0\0cgbzv\0\0\0chzrh\0\0\0ciabj\0\0\0ckrar\0\0\0clipc\0\0\0clpuq\0\0\0clscl\0\0\0cmdla\0\0\0cnsha\0\0\0cnurc\0\0\0cobog\0\0\0crsjo\0\0\0cuhav\0\0\0cvrai\0\0\0cxxch\0\0\0cyfmg\0\0\0cynic\0\0\0czprg\0\0\0deber\0\0\0debsngn\0djjib\0\0\0dkcph\0\0\0dmdom\0\0\0dosdq\0\0\0dzalg\0\0\0ecgps\0\0\0ecgye\0\0\0eetll\0\0\0egcai\0\0\0eheai\0\0\0erasm\0\0\0esceu\0\0\0eslpa\0\0\0esmad\0\0\0etadd\0\0\0fihel\0\0\0fimhq\0\0\0fjsuv\0\0\0fkpsy\0\0\0fmksa\0\0\0fmpni\0\0\0fmtkk\0\0\0fotho\0\0\0frpar\0\0\0galbv\0\0\0gazastrpgblon\0\0\0gdgnd\0\0\0getbs\0\0\0gfcay\0\0\0gggci\0\0\0ghacc\0\0\0gigib\0\0\0gldkshvnglgoh\0\0\0globy\0\0\0glthu\0\0\0gmbjl\0\0\0gmt\0\0\0\0\0gncky\0\0\0gpbbr\0\0\0gpmsb\0\0\0gpsbh\0\0\0gqssg\0\0\0grath\0\0\0gsgrv\0\0\0gtgua\0\0\0gugum\0\0\0gwoxb\0\0\0gygeo\0\0\0hebron\0\0hkhkg\0\0\0hntgu\0\0\0hrzag\0\0\0htpap\0\0\0hubud\0\0\0iddjj\0\0\0idjkt\0\0\0idmak\0\0\0idpnk\0\0\0iedub\0\0\0imdgs\0\0\0inccu\0\0\0iodga\0\0\0iqbgw\0\0\0irthr\0\0\0isrey\0\0\0itrom\0\0\0jeruslm\0jesth\0\0\0jmkin\0\0\0joamm\0\0\0jptyo\0\0\0kenbo\0\0\0kgfru\0\0\0khpnh\0\0\0kicxi\0\0\0kipho\0\0\0kitrw\0\0\0kmyva\0\0\0knbas\0\0\0kpfnj\0\0\0krsel\0\0\0kwkwi\0\0\0kygec\0\0\0kzaau\0\0\0kzakx\0\0\0kzala\0\0\0kzguw\0\0\0kzksn\0\0\0kzkzo\0\0\0kzura\0\0\0lavte\0\0\0lbbey\0\0\0lccas\0\0\0livdz\0\0\0lkcmb\0\0\0lrmlw\0\0\0lsmsu\0\0\0ltvno\0\0\0lulux\0\0\0lvrix\0\0\0lytip\0\0\0macas\0\0\0mcmon\0\0\0mdkiv\0\0\0metgd\0\0\0mgtnr\0\0\0mhkwa\0\0\0mhmaj\0\0\0mkskp\0\0\0mlbko\0\0\0mmrgn\0\0\0mnhvd\0\0\0mnuln\0\0\0momfm\0\0\0mpspn\0\0\0mqfdf\0\0\0mrnkc\0\0\0msmni\0\0\0mtmla\0\0\0muplu\0\0\0mvmle\0\0\0mwblz\0\0\0mxchi\0\0\0mxcjs\0\0\0mxcun\0\0\0mxhmo\0\0\0mxmam\0\0\0mxmex\0\0\0mxmid\0\0\0mxmty\0\0\0mxmzt\0\0\0mxoji\0\0\0mxpvr\0\0\0mxtij\0\0\0mykch\0\0\0mykul\0\0\0mzmpm\0\0\0nawdh\0\0\0ncnou\0\0\0nenim\0\0\0nfnlk\0\0\0nglos\0\0\0nimga\0\0\0nlams\0\0\0noosl\0\0\0npktm\0\0\0nrinu\0\0\0nuiue\0\0\0nzakl\0\0\0nzcht\0\0\0ommct\0\0\0papty\0\0\0pelim\0\0\0pfgmr\0\0\0pfnhv\0\0\0pfppt\0\0\0pgpom\0\0\0pgraw\0\0\0phmnl\0\0\0pkkhi\0\0\0plwaw\0\0\0pmmqc\0\0\0pnpcn\0\0\0prsju\0\0\0ptfnc\0\0\0ptlis\0\0\0ptpdl\0\0\0pwror\0\0\0pyasu\0\0\0qadoh\0\0\0rereu\0\0\0robuh\0\0\0rsbeg\0\0\0ruasf\0\0\0ruchita\0rudyr\0\0\0rugdx\0\0\0ruikt\0\0\0rukgd\0\0\0rukhndg\0rukra\0\0\0rukuf\0\0\0rumow\0\0\0runoz\0\0\0ruoms\0\0\0ruovb\0\0\0rupkc\0\0\0rurtw\0\0\0rusred\0\0ruuly\0\0\0ruunera\0ruuus\0\0\0ruvog\0\0\0ruvvo\0\0\0ruyek\0\0\0ruyks\0\0\0rwkgl\0\0\0saruh\0\0\0sbhir\0\0\0scmaw\0\0\0sdkrt\0\0\0sesto\0\0\0sgsin\0\0\0shshn\0\0\0silju\0\0\0sjlyr\0\0\0skbts\0\0\0slfna\0\0\0smsai\0\0\0sndkr\0\0\0somgq\0\0\0srpbm\0\0\0ssjub\0\0\0sttms\0\0\0svsal\0\0\0sxphi\0\0\0sydam\0\0\0szqmn\0\0\0tcgdt\0\0\0tdndj\0\0\0tfpfr\0\0\0tglfw\0\0\0thbkk\0\0\0tjdyu\0\0\0tkfko\0\0\0tldil\0\0\0tmasb\0\0\0tntun\0\0\0totbu\0\0\0trist\0\0\0ttpos\0\0\0tvfun\0\0\0twtpe\0\0\0tzdar\0\0\0uaiev\0\0\0uasip\0\0\0ugkla\0\0\0umawk\0\0\0ummdy\0\0\0usadk\0\0\0usaeg\0\0\0usanc\0\0\0usboi\0\0\0uschi\0\0\0usden\0\0\0usdet\0\0\0ushnl\0\0\0usind\0\0\0usinvev\0usjnu\0\0\0usknx\0\0\0uslax\0\0\0uslui\0\0\0usmnm\0\0\0usmoc\0\0\0usmtm\0\0\0usndcnt\0usndnsl\0usnyc\0\0\0usoea\0\0\0usome\0\0\0usphx\0\0\0ussit\0\0\0ustel\0\0\0uswlz\0\0\0uswsq\0\0\0usxul\0\0\0usyak\0\0\0uymvd\0\0\0uzskd\0\0\0uztas\0\0\0vavat\0\0\0vcsvd\0\0\0veccs\0\0\0vgtov\0\0\0vistt\0\0\0vnsgn\0\0\0vuvli\0\0\0wfmau\0\0\0wsapw\0\0\0yeade\0\0\0ytmam\0\0\0zajnb\0\0\0zmlun\0\0\0zwhre\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0\x05\0\0\0\x06\0\0\0\x08\0\0\0\t\0\0\0\n\0\0\0\x1B\0\0\0\x1C\0\0\0\x1D\0\0\0\x1E\0\0\0\x1F\0\0\0!\0\0\0\"\0\0\0#\0\0\0$\0\0\0%\0\0\0&\0\0\0(\0\0\0,\0\0\x001\0\0\x003\0\0\0<\0\0\0?\0\0\0B\0\0\0D\0\0\0H\0\0\0M\0\0\0O\0\0\0Q\0\0\0R\0\0\0S\0\0\0T\0\0\0U\0\0\0V\0\0\0W\0\0\0X\0\0\0Y\0\0\0[\0\0\0\\\0\0\0]\0\0\0^\0\0\0_\0\0\0`\0\0\0b\0\0\0c\0\0\0d\0\0\0f\0\0\0g\0\0\0h\0\0\0i\0\0\0k\0\0\0l\0\0\0m\0\0\0n\0\0\0o\0\0\0p\0\0\0q\0\0\0r\0\0\0s\0\0\0t\0\0\0u\0\0\0v\0\0\0y\0\0\0z\0\0\0{\0\0\0|\0\0\0}\0\0\0~\0\0\0\x81\0\0\0\x82\0\0\0\x83\0\0\0\x84\0\0\0\x86\0\0\0\x87\0\0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\0\x1C\x01\0\0\x1D\x01\0\0\x1E\x01\0\0\x1F\x01\0\0 \x01\0\0!\x01\0\0\"\x01\0\0$\x01\0\0&\x01\0\0(\x01\0\0)\x01\0\0*\x01\0\0+\x01\0\0,\x01\0\0-\x01\0\0.\x01\0\0/\x01\0\x001\x01\0\x002\x01\0\x003\x01\0\x004\x01\0\x005\x01\0\x007\x01\0\08\x01\0\09\x01\0\0:\x01\0\0;\x01\0\0<\x01\0\0=\x01\0\0@\x01\0\0A\x01\0\0B\x01\0\0C\x01\0\0G\x01\0\0K\x01\0\0N\x01\0\0P\x01\0\0R\x01\0\0W\x01\0\0[\x01\0\0\\\x01\0\0]\x01\0\0^\x01\0\0_\x01\0\0b\x01\0\0d\x01\0\0e\x01\0\0i\x01\0\0j\x01\0\0l\x01\0\0s\x01\0\0v\x01\0\0w\x01\0\0y\x01\0\0z\x01\0\0{\x01\0\0}\x01\0\0~\x01\0\0\x7F\x01\0\0\x80\x01\0\0\x81\x01\0\0\x82\x01\0\0\x83\x01\0\0\x85\x01\0\0\x87\x01\0\0\x88\x01\0\0\x89\x01\0\0\x8A\x01\0\0\x8B\x01\0\0\x8C\x01\0\0\x8D\x01\0\0\x8E\x01\0\0\x91\x01\0\0\x95\x01\0\0\x9B\x01\0\0\x9C\x01\0\0\x9D\x01\0\0\x9E\x01\0\0\xA1\x01\0\0\xA2\x01\0\0\xA3\x01\0\0\xA6\x01\0\0\xA8\x01\0\0\xA9\x01\0\0\xAB\x01\0\0\xAD\x01\0\0\xAE\x01\0\0\xB2\x01\0\0\xB3\x01\0\0\xB4\x01\0\0\xB5\x01\0\0\xB6\x01\0\0\xBD\x01\0\0\xBE\x01\0\0\xBF\x01\0\0\xC0\x01\0\0\xC1\x01\0\0\xC2\x01\0\0\xC3\x01\0\0\xC4\x01\0\0\xC5\x01\0\0\xC6\x01\0\0\xC7\x01\0\0\xC8\x01\0\0\xC9\x01\0\0\xCA\x01\0\0\xCB\x01\0\0\xCC\x01\0\0\xCD\x01\0\0\xCF\x01\0\0\xD0\x01\0\0\xD2\x01\0\0\xD3\x01\0\0\xD4\x01\0\0\xD5\x01\0\0\xD9\x01\0\0\xDC\x01\0\0\xDD\x01\0\0\xDE\x01\0\0\xE0\x01\0\0\xE1\x01\0\0\xE2\x01\0\0\xE3\x01\0\0\xE4\x01\0\0\xE7\x01\0\0\xEA\x01\0\0\xEB\x01\0\0\xEC\x01\0\0\xF0\x01\0\0\xF3\x01\0\0\xF4\x01\0\0\xF8\x01\0\0\xFB\x01\0\0\xFE\x01\0\0\xFF\x01\0\0\0\x02\0\0\x01\x02\0\0\x02\x02\0\0\x03\x02\0\0\x04\x02\0\0\x07\x02\0\0\x08\x02\0\0\t\x02\0\0\n\x02\0\0\x0C\x02\0\0\r\x02\0\0\x0E\x02\0\0\x0F\x02\0\0\x10\x02\0\0\x11\x02\0\0\x14\x02\0\0\x15\x02\0\0\x16\x02\0\0\x17\x02\0\0\x18\x02\0\0\x19\x02\0\0\x1A\x02\0\0\x1B\x02\0\0\x1C\x02\0\0\x1D\x02\0\0\x1E\x02\0\0 \x02\0\0#\x02\0\0&\x02\0\0'\x02\0\0(\x02\0\0)\x02\0\0*\x02\0\0-\x02\0\0.\x02\0\0/\x02\0\x000\x02\0\x001\x02\0\x003\x02\0\x004\x02\0\x007\x02\0\09\x02\0\0:\x02\0\0;\x02\0\0?\x02\0\0@\x02\0\0A\x02\0\0B\x02\0\0C\x02\0\0E\x02\0\0J\x02\0\0K\x02\0\0L\x02\0\0N\x02\0\0P\x02\0\0S\x02\0\0U\x02\0\0V\x02\0\0W\x02\0\0X\x02\0\0Y\x02\0\0[\x02\0\0\\\x02\0\0]\x02\0\0`\x02\0\0c\x02\0\0d\x02\0\0g\x02\0\0i\x02\0\0k\x02\0\0o\x02\0\0q\x02\0\0s\x02\0\0t\x02\0\0w\x02\0\0y\x02\0\0z\x02\0\0|\x02\0\0~\x02\0\0\x81\x02\0\0\x85\x02\0\0\x87\x02\0\0\x88\x02\0\0\x89\x02\0\0\x8D\x02\0\0\x8F\x02\0\0\x90\x02\0\0\x91\x02\0\0\x92\x02\0\0\x93\x02\0\0\x94\x02\0\0\x95\x02\0\0\x96\x02\0\0\x97\x02\0\0\x98\x02\0\0\x99\x02\0\0\x9A\x02\0\0\x9B\x02\0\0\x9C\x02\0\0\x9D\x02\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0pY\xAE\0\0\0\0\0\0\0\0\0\0\0\0\0\xF8]?\x01\x84eB\x01x\xA0O\x01\\2R\x01 \xA3w\x01\xFC\xBB\x82\x01\xF0Y\x87\x01\xA0\xE2\x8A\x01\xF4M\x8F\x01\xC0\xBA\x92\x01\x01X\x97\x01\xEC\xE0\x9A\x01\x81W\x9F\x01l\xE0\xA2\x01\x01W\xA7\x01\xC0\xCF\xAA\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x14\xF2b\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\xF3\xAE\0\0\0\0\x000\xF3\xAE\0\xF42\x14\x01\x10\x9E\x14\x01\0\0\0\0\x18\xD4\xA9\0pM\xAB\0\xF42\x14\x01\x10\x9E\x14\x01\0\0\0\0p\xA4\xAE\0\0\0\0\0\x18\x18\xA2\0\x10\xDA\xAB\0\x94\xC7\xEE\0\x94\x1E\xF2\0T-\x14\x01\xF0b\x15\x01Xf1\x01\xF08?\x01\0\0\0\0\xB0\xF2\xB6\0P\xC5\x16\x01\0\0\0\0\xF42\x14\x01\x10\x9E\x14\x01\0\0\0\x000\xF3\xAE\0\0\0\0\x000\xF3\xAE\0\xF42\x14\x01\xB0v\x14\x01\0\0\0\0\x18\xD4\xA9\0pM\xAB\0T-\x14\x01\xF0b\x15\x01\0\0\0\0\x10\x9E\x14\x01\0\0\0\0\x10\xF9n\0\0\0\0\0\0\0\0\0\0\0\0\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\0\xA4\xAD&\0\0\0\0\0d\xAE\x1A\0\0\0\0\0\x84e\xF7\0\0\0\0\0\xD8\xD4o\x01\xB8\xFA\x87\x01\xD8\xAB\x89\x01\0\0\0\0\0\x1B\xB7\0\0\0\0\0@d\x0F\x01\0\0\0\0\0\0\0\0\xA4\xEC\"\x01\xC4\xB0/\x01\0\0\0\0\xBC\xA6o\0\0\0\0\0\0\0\0\0\xBC\xA6o\0\0\0\0\0\xA4\xEC\"\x01\0\0\0\0\xA4\xEC\"\x01@v*\x01\0\0\0\0\x84\xD3>\0\xA4\xEC\"\x01\xC4\xB0/\x01\0\0\0\0\xE0\xD6G\x01\xBC\xA6o\0\0\0\0\0\0\0\0\0xG^\08Gb\08\xDD\xAD\0\0\0\0\08\xDD\xAD\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0@\xB2+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01euce\x01gulf\x01afgh\x01atla\x01atla\x01euce\0\0\0\0\0\x01arme\x01atla\x01afwe\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01case\x01auwe\x01davi\x01dumo\x01maws\x01neze\x01arge\x01chil\x01roth\x01syow\x01mgmt\x01vost\x01arge\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arge\x01arge\x01arge\x01arge\x01arwe\x01arge\x01arge\x01arwe\x01arge\x01arwe\x01arge\x01arge\x01arge\0\0\0\0\0\x01samo\x01euce\x01auce\x01auce\x01auea\x01auce\x01aucw\x01auea\x01auea\x01auea\x01loho\x01auea\x01auea\x01auwe\x01auea\x01atla\0\0\0\0\0\x01azer\x01euce\x01atla\0\0\0\0\0\x01bang\x01euce\x01mgmt\x01euea\x01gulf\x01arab\x01afce\x01afwe\x01atla\x01brun\x01boli\x01atla\x01bras\x01bras\x01amaz\x01amaz\x01amaz\x01acre\x01amaz\x01acre\x01noro\x01bras\x01amaz\x01bras\x01amaz\x01acre\x01amaz\x01acre\x01bras\x01bras\x01bras\x01amaz\x01bras\x01amea\x01indi\x01bhut\x01afce\x01mosc\x01euea\x01eufe\x01mosc\x01amce\x01ammo\x01ammo\x01ampa\x01ammo\x01atla\x01atla\0\0\0\0\0\x01atla\x01atla\x01amea\x01amce\x01amea\x01atla\x01amce\x01amea\x01amce\x01amea\x01amce\x01amce\x01newf\x01amea\x01ampa\x01amce\x01atla\x01ammo\x01amce\x01amea\x01amce\x01ammo\x01ampa\x01yuko\x01ampa\x01ammo\x01amce\x01amea\x01amce\x01ampa\x01ammo\x01ampa\x01yuko\x01ammo\x01amce\x01amea\x01coco\x01afce\x01afwe\x01afwe\x01afwe\x01euce\x01mgmt\x01cook\x01east\x01chil\x01chil\x01afwe\x01chin\0\0\0\0\0\x01colo\x01amce\x01cuba\x01cave\x01chri\x01euea\x01euea\x01euce\x01euce\x01euce\x01afea\x01euce\x01atla\0\0\0\0\0\x01atla\x01amea\x01atla\x01euwe\x01euce\x01euwe\x01euce\x01ecua\x01gala\x01ecua\x01mosc\x01euea\x01euea\0\0\0\0\0\x01euwe\x01afea\x01euwe\x01euce\x01euwe\x01euce\x01afea\x01euea\x01euea\x01fiji\x01falk\x01kosr\x01pona\x01truk\x01euwe\x01euce\x01afwe\x01isra\x01euea\0\0\0\0\0\x01mgmt\x01atla\0\0\0\0\0\x01geor\x01frgu\0\0\0\0\0\x01mgmt\x01mgmt\x01euce\x01grwe\x01mgmt\x01grwe\x01gree\0\0\0\0\0\x01grea\x01gree\x01atla\x01mgmt\x01mgmt\x01mgmt\x01atla\x01atla\x01atla\x01afwe\x01euea\x01soge\x01amce\x01guam\x01cham\0\0\0\0\0\x01mgmt\x01guya\x01isra\x01euea\x01hoko\x01amce\x01euce\x01amea\x01euce\x01inea\x01inwe\x01ince\x01ince\x01inwe\0\0\0\0\0\x01mgmt\0\0\0\0\0\x01mgmt\x01indi\x01inoc\x01arab\x01iran\x01mgmt\x01euce\x01isra\0\0\0\0\0\x01mgmt\x01amea\x01euea\x01japa\x01afea\0\0\0\0\0\x01kyrg\x01indo\x01liis\x01phis\x01giis\x01afea\x01atla\x01kore\x01pyon\x01kore\x01kore\x01arab\x01amea\0\0\0\0\0\x01aqta\x01kawe\x01kaza\0\0\0\0\0\x01aqto\x01kawe\x01kaza\x01alam\x01kaea\x01kaza\x01kawe\x01kaza\x01kaea\x01kaza\0\0\0\0\0\x01qyzy\x01kaea\x01kawe\x01kaza\0\0\0\0\0\0\0\0\0\0\x01kawe\x01kaza\x01indo\x01euea\x01atla\x01euce\x01indi\x01lank\x01indi\0\0\0\0\0\x01mgmt\x01afso\x01mosc\x01euea\x01euce\x01euea\x01euce\x01mosc\x01euea\x01euea\x01euce\x01euea\x01euce\x01euea\x01euce\x01euea\x01euwe\x01euce\x01euwe\x01euce\x01mosc\x01euea\x01euce\x01afea\0\0\0\0\0\x01mais\x01mais\x01euce\x01mgmt\x01myan\x01hovd\x01mong\x01maca\x01chin\x01noma\x01cham\x01atla\x01mgmt\x01atla\x01euce\x01maur\x01mald\x01afce\x01amce\x01mepa\x01amce\x01amce\x01mepa\x01amce\x01ammo\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01mepa\x01amce\x01amce\x01amce\x01amea\x01amce\x01amce\x01mepa\x01amce\x01ammo\x01amce\x01ammo\x01amce\x01ampa\0\0\0\0\0\x01mala\0\0\0\0\0\x01mala\x01afce\x01afso\x01afce\x01afwe\x01afce\x01neca\x01afwe\x01norf\x01afwe\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01amce\x01euce\x01euce\x01nepa\x01naur\x01niue\x01neze\x01chat\x01gulf\x01amea\x01peru\x01gamb\x01marq\x01tahi\x01pang\x01pang\x01phil\0\0\0\0\0\x01paki\x01euce\x01atla\x01pimi\x01pitc\x01atla\x01euwe\x01euce\x01euwe\x01euce\x01euwe\x01azor\x01euwe\x01azor\x01pala\x01para\x01gulf\x01arab\x01reun\x01euea\x01euce\x01mosc\x01yaku\x01irku\x01yaku\x01anad\x01maga\x01anad\x01maga\x01irku\x01mosc\x01euea\x01eufe\x01euea\x01yaku\x01vlad\x01yaku\x01kras\0\0\0\0\0\x01mosc\x01euea\x01sama\x01mosc\x01euea\x01mosc\x01kras\x01novo\x01kras\x01omsk\x01novo\x01kamc\x01mosc\x01maga\x01mosc\x01yaku\x01maga\x01vlad\x01sakh\x01volg\x01vlad\0\0\0\0\0\x01yeka\x01yaku\x01afce\x01arab\x01solo\x01seyc\x01afce\x01afea\x01afce\x01euce\x01sing\x01mgmt\x01euce\x01euce\x01euce\x01mgmt\x01euce\x01mgmt\x01afea\0\0\0\0\0\x01suri\x01afce\x01afea\x01afce\x01mgmt\x01afwe\x01mgmt\x01amce\x01atla\x01euea\x01afso\x01amea\x01atla\x01amea\x01afwe\x01frso\x01mgmt\x01indo\0\0\0\0\0\x01taji\x01toke\x01eati\x01ince\x01eati\0\0\0\0\0\x01turk\x01euce\x01tong\x01euea\0\0\0\0\0\x01euea\0\0\0\0\0\x01atla\x01tuva\x01taip\x01afea\x01mosc\x01euea\x01mosc\x01euea\x01mosc\x01euea\x01mosc\x01afea\x01wake\0\0\0\0\0\x01samo\0\0\0\0\0\x01haal\x01amea\x01amce\x01amea\0\0\0\0\0\x01alas\x01ammo\x01amce\x01ammo\x01amea\0\0\0\0\0\x01haal\x01amea\x01amea\x01ampa\x01ampa\x01alas\x01amce\x01amea\x01amce\x01ampa\x01amea\x01amce\x01amea\x01amea\x01amce\x01amce\x01amea\x01ampa\x01alas\x01ampa\x01alas\x01ammo\x01amce\x01ammo\x01amce\x01amea\x01amea\x01amce\x01amea\0\0\0\0\0\x01alas\x01ammo\x01ampa\x01alas\x01amea\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01amce\x01amea\x01ammo\x01amce\x01alas\x01urug\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01uzbe\0\0\0\0\0\x01uzbe\x01euce\x01atla\x01vene\x01atla\x01atla\x01indo\x01vanu\x01wall\x01apia\x01arab\x01afea\x01afso\x01afce\x01afce") }) }); } #[clippy::msrv = "1.71.1"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.id.locale.is_default() { Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(Self::SINGLETON_METAZONE_PERIOD_V1_MARKER), metadata: Default::default() }) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -35,7 +35,7 @@ macro_rules! __impl_metazone_period_v1_marker { ($ provider : ty , ITER) => { __impl_metazone_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } @@ -44,12 +44,12 @@ macro_rules! __impl_metazone_period_v1_marker { ($ provider : ty , DRY) => { __impl_metazone_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -57,17 +57,17 @@ macro_rules! __impl_metazone_period_v1_marker { ($ provider : ty , DRY , ITER) => { __impl_metazone_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } diff --git a/provider/data/datetime/stubdata/mod.rs b/provider/data/datetime/stubdata/mod.rs index b59e9db22e3..1a0d38444ba 100644 --- a/provider/data/datetime/stubdata/mod.rs +++ b/provider/data/datetime/stubdata/mod.rs @@ -46,6 +46,8 @@ include!("time_zone_essentials_v1_marker.rs.data"); include!("metazone_generic_names_long_v1_marker.rs.data"); include!("metazone_generic_names_short_v1_marker.rs.data"); include!("locations_v1_marker.rs.data"); +include!("metazone_period_v1_marker.rs.data"); +include!("zone_offset_period_v1_marker.rs.data"); include!("metazone_specific_names_long_v1_marker.rs.data"); include!("metazone_specific_names_short_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like @@ -124,6 +126,8 @@ macro_rules! impl_data_provider { impl_metazone_generic_names_long_v1_marker!($provider); impl_metazone_generic_names_short_v1_marker!($provider); impl_locations_v1_marker!($provider); + impl_metazone_period_v1_marker!($provider); + impl_zone_offset_period_v1_marker!($provider); impl_metazone_specific_names_long_v1_marker!($provider); impl_metazone_specific_names_short_v1_marker!($provider); }; @@ -182,6 +186,8 @@ macro_rules! impl_any_provider { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), diff --git a/provider/data/timezone/stubdata/zone_offset_period_v1_marker.rs.data b/provider/data/datetime/stubdata/zone_offset_period_v1_marker.rs.data similarity index 96% rename from provider/data/timezone/stubdata/zone_offset_period_v1_marker.rs.data rename to provider/data/datetime/stubdata/zone_offset_period_v1_marker.rs.data index b17a8cd029c..8331ffe3ff6 100644 --- a/provider/data/timezone/stubdata/zone_offset_period_v1_marker.rs.data +++ b/provider/data/datetime/stubdata/zone_offset_period_v1_marker.rs.data @@ -16,18 +16,18 @@ macro_rules! __impl_zone_offset_period_v1_marker { #[clippy::msrv = "1.71.1"] impl $provider { #[doc(hidden)] - pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::timezone::provider::ZoneOffsetPeriodV1(unsafe { + pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::datetime::provider::time_zones::ZoneOffsetPeriodV1(unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"adalv\0\0\0aedxb\0\0\0afkbl\0\0\0aganu\0\0\0aiaxa\0\0\0altia\0\0\0amevn\0\0\0ancur\0\0\0aolad\0\0\0aqcas\0\0\0aqdav\0\0\0aqddu\0\0\0aqmaw\0\0\0aqmcm\0\0\0aqplm\0\0\0aqrot\0\0\0aqsyw\0\0\0aqtrl\0\0\0aqvos\0\0\0arbue\0\0\0arcor\0\0\0arctc\0\0\0arirj\0\0\0arjuj\0\0\0arluq\0\0\0armdz\0\0\0arrgl\0\0\0arsla\0\0\0artuc\0\0\0aruaq\0\0\0arush\0\0\0asppg\0\0\0atvie\0\0\0auadl\0\0\0aubhq\0\0\0aubne\0\0\0audrw\0\0\0aueuc\0\0\0auhba\0\0\0auldc\0\0\0auldh\0\0\0aumel\0\0\0aumqi\0\0\0auper\0\0\0ausyd\0\0\0awaua\0\0\0azbak\0\0\0basjj\0\0\0bbbgi\0\0\0bddac\0\0\0bebru\0\0\0bfoua\0\0\0bgsof\0\0\0bhbah\0\0\0bibjm\0\0\0bjptn\0\0\0bmbda\0\0\0bnbwn\0\0\0bolpb\0\0\0bqkra\0\0\0braux\0\0\0brbel\0\0\0brbvb\0\0\0brcgb\0\0\0brcgr\0\0\0brern\0\0\0brfen\0\0\0brfor\0\0\0brmao\0\0\0brmcz\0\0\0brpvh\0\0\0brrbr\0\0\0brrec\0\0\0brsao\0\0\0brssa\0\0\0brstm\0\0\0bsnas\0\0\0btthi\0\0\0bwgbe\0\0\0bymsq\0\0\0bzbze\0\0\0cacfq\0\0\0caedm\0\0\0cafne\0\0\0caglb\0\0\0cagoo\0\0\0cahal\0\0\0caiql\0\0\0camon\0\0\0careb\0\0\0careg\0\0\0casjf\0\0\0cator\0\0\0cavan\0\0\0cawnp\0\0\0caybx\0\0\0caycb\0\0\0cayda\0\0\0caydq\0\0\0cayek\0\0\0cayev\0\0\0cayxy\0\0\0cayyn\0\0\0cayzs\0\0\0cccck\0\0\0cdfbm\0\0\0cdfih\0\0\0cfbgf\0\0\0cgbzv\0\0\0chzrh\0\0\0ciabj\0\0\0ckrar\0\0\0clipc\0\0\0clpuq\0\0\0clscl\0\0\0cmdla\0\0\0cnsha\0\0\0cnurc\0\0\0cobog\0\0\0crsjo\0\0\0cuhav\0\0\0cvrai\0\0\0cxxch\0\0\0cyfmg\0\0\0cynic\0\0\0czprg\0\0\0deber\0\0\0debsngn\0djjib\0\0\0dkcph\0\0\0dmdom\0\0\0dosdq\0\0\0dzalg\0\0\0ecgps\0\0\0ecgye\0\0\0eetll\0\0\0egcai\0\0\0eheai\0\0\0erasm\0\0\0esceu\0\0\0eslpa\0\0\0esmad\0\0\0etadd\0\0\0fihel\0\0\0fimhq\0\0\0fjsuv\0\0\0fkpsy\0\0\0fmksa\0\0\0fmpni\0\0\0fmtkk\0\0\0fotho\0\0\0frpar\0\0\0galbv\0\0\0gazastrpgblon\0\0\0gdgnd\0\0\0getbs\0\0\0gfcay\0\0\0gggci\0\0\0ghacc\0\0\0gigib\0\0\0gldkshvnglgoh\0\0\0globy\0\0\0glthu\0\0\0gmbjl\0\0\0gmt\0\0\0\0\0gncky\0\0\0gpbbr\0\0\0gpmsb\0\0\0gpsbh\0\0\0gqssg\0\0\0grath\0\0\0gsgrv\0\0\0gtgua\0\0\0gugum\0\0\0gwoxb\0\0\0gygeo\0\0\0hebron\0\0hkhkg\0\0\0hntgu\0\0\0hrzag\0\0\0htpap\0\0\0hubud\0\0\0iddjj\0\0\0idjkt\0\0\0idmak\0\0\0idpnk\0\0\0iedub\0\0\0imdgs\0\0\0inccu\0\0\0iodga\0\0\0iqbgw\0\0\0irthr\0\0\0isrey\0\0\0itrom\0\0\0jeruslm\0jesth\0\0\0jmkin\0\0\0joamm\0\0\0jptyo\0\0\0kenbo\0\0\0kgfru\0\0\0khpnh\0\0\0kicxi\0\0\0kipho\0\0\0kitrw\0\0\0kmyva\0\0\0knbas\0\0\0kpfnj\0\0\0krsel\0\0\0kwkwi\0\0\0kygec\0\0\0kzaau\0\0\0kzakx\0\0\0kzala\0\0\0kzguw\0\0\0kzksn\0\0\0kzkzo\0\0\0kzura\0\0\0lavte\0\0\0lbbey\0\0\0lccas\0\0\0livdz\0\0\0lkcmb\0\0\0lrmlw\0\0\0lsmsu\0\0\0ltvno\0\0\0lulux\0\0\0lvrix\0\0\0lytip\0\0\0macas\0\0\0mcmon\0\0\0mdkiv\0\0\0metgd\0\0\0mgtnr\0\0\0mhkwa\0\0\0mhmaj\0\0\0mkskp\0\0\0mlbko\0\0\0mmrgn\0\0\0mnhvd\0\0\0mnuln\0\0\0momfm\0\0\0mpspn\0\0\0mqfdf\0\0\0mrnkc\0\0\0msmni\0\0\0mtmla\0\0\0muplu\0\0\0mvmle\0\0\0mwblz\0\0\0mxchi\0\0\0mxcjs\0\0\0mxcun\0\0\0mxhmo\0\0\0mxmam\0\0\0mxmex\0\0\0mxmid\0\0\0mxmty\0\0\0mxmzt\0\0\0mxoji\0\0\0mxpvr\0\0\0mxtij\0\0\0mykch\0\0\0mykul\0\0\0mzmpm\0\0\0nawdh\0\0\0ncnou\0\0\0nenim\0\0\0nfnlk\0\0\0nglos\0\0\0nimga\0\0\0nlams\0\0\0noosl\0\0\0npktm\0\0\0nrinu\0\0\0nuiue\0\0\0nzakl\0\0\0nzcht\0\0\0ommct\0\0\0papty\0\0\0pelim\0\0\0pfgmr\0\0\0pfnhv\0\0\0pfppt\0\0\0pgpom\0\0\0pgraw\0\0\0phmnl\0\0\0pkkhi\0\0\0plwaw\0\0\0pmmqc\0\0\0pnpcn\0\0\0prsju\0\0\0ptfnc\0\0\0ptlis\0\0\0ptpdl\0\0\0pwror\0\0\0pyasu\0\0\0qadoh\0\0\0rereu\0\0\0robuh\0\0\0rsbeg\0\0\0ruasf\0\0\0rubax\0\0\0ruchita\0rudyr\0\0\0rugdx\0\0\0ruikt\0\0\0rukgd\0\0\0rukhndg\0rukra\0\0\0rukuf\0\0\0rukvx\0\0\0rumow\0\0\0runoz\0\0\0ruoms\0\0\0ruovb\0\0\0rupkc\0\0\0rurtw\0\0\0rusred\0\0rutof\0\0\0ruuly\0\0\0ruunera\0ruuus\0\0\0ruvog\0\0\0ruvvo\0\0\0ruyek\0\0\0ruyks\0\0\0rwkgl\0\0\0saruh\0\0\0sbhir\0\0\0scmaw\0\0\0sdkrt\0\0\0sesto\0\0\0sgsin\0\0\0shshn\0\0\0silju\0\0\0sjlyr\0\0\0skbts\0\0\0slfna\0\0\0smsai\0\0\0sndkr\0\0\0somgq\0\0\0srpbm\0\0\0ssjub\0\0\0sttms\0\0\0svsal\0\0\0sxphi\0\0\0sydam\0\0\0szqmn\0\0\0tcgdt\0\0\0tdndj\0\0\0tfpfr\0\0\0tglfw\0\0\0thbkk\0\0\0tjdyu\0\0\0tkfko\0\0\0tldil\0\0\0tmasb\0\0\0tntun\0\0\0totbu\0\0\0trist\0\0\0ttpos\0\0\0tvfun\0\0\0twtpe\0\0\0tzdar\0\0\0uaiev\0\0\0uasip\0\0\0ugkla\0\0\0umawk\0\0\0ummdy\0\0\0usadk\0\0\0usaeg\0\0\0usanc\0\0\0usboi\0\0\0uschi\0\0\0usden\0\0\0usdet\0\0\0ushnl\0\0\0usind\0\0\0usinvev\0usjnu\0\0\0usknx\0\0\0uslax\0\0\0uslui\0\0\0usmnm\0\0\0usmoc\0\0\0usmtm\0\0\0usndcnt\0usndnsl\0usnyc\0\0\0usoea\0\0\0usome\0\0\0usphx\0\0\0ussit\0\0\0ustel\0\0\0uswlz\0\0\0uswsq\0\0\0usxul\0\0\0usyak\0\0\0utc\0\0\0\0\0utce01\0\0utce02\0\0utce03\0\0utce04\0\0utce05\0\0utce06\0\0utce07\0\0utce08\0\0utce09\0\0utce10\0\0utce11\0\0utce12\0\0utce13\0\0utce14\0\0utcw01\0\0utcw02\0\0utcw03\0\0utcw04\0\0utcw05\0\0utcw06\0\0utcw07\0\0utcw08\0\0utcw09\0\0utcw10\0\0utcw11\0\0utcw12\0\0uymvd\0\0\0uzskd\0\0\0uztas\0\0\0vavat\0\0\0vcsvd\0\0\0veccs\0\0\0vgtov\0\0\0vistt\0\0\0vnsgn\0\0\0vuvli\0\0\0wfmau\0\0\0wsapw\0\0\0yeade\0\0\0ytmam\0\0\0zajnb\0\0\0zmlun\0\0\0zwhre\0\0\0") }, unsafe { zerovec::ZeroVec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\0\0\x97\x01\0\0\x9A\x01\0\0\x9B\x01\0\0\x9C\x01\0\0\x9E\x01\0\0\x9F\x01\0\0\xA1\x01\0\0\xA3\x01\0\0\xA4\x01\0\0\xA6\x01\0\0\xA7\x01\0\0\xAC\x01\0\0\xAF\x01\0\0\xB1\x01\0\0\xB3\x01\0\0\xB5\x01\0\0\xB6\x01\0\0\xB8\x01\0\0\xB9\x01\0\0\xBE\x01\0\0\xC5\x01\0\0\xC8\x01\0\0\xCA\x01\0\0\xCF\x01\0\0\xD0\x01\0\0\xD5\x01\0\0\xD6\x01\0\0\xDA\x01\0\0\xDC\x01\0\0\xDF\x01\0\0\xE0\x01\0\0\xE3\x01\0\0\xE6\x01\0\0\xE8\x01\0\0\xED\x01\0\0\xEF\x01\0\0\xF0\x01\0\0\xF1\x01\0\0\xF3\x01\0\0\xF6\x01\0\0\xF7\x01\0\0\0\x02\0\0\x04\x02\0\0\x05\x02\0\0\n\x02\0\0\x0B\x02\0\0\x0F\x02\0\0\x10\x02\0\0\x12\x02\0\0\x15\x02\0\0\x19\x02\0\0\x1E\x02\0\0\x1F\x02\0\0 \x02\0\0!\x02\0\0\"\x02\0\0#\x02\0\0$\x02\0\0%\x02\0\0&\x02\0\0)\x02\0\0*\x02\0\0,\x02\0\0.\x02\0\x000\x02\0\x003\x02\0\08\x02\0\0:\x02\0\0<\x02\0\0>\x02\0\0?\x02\0\0B\x02\0\0C\x02\0\0D\x02\0\0E\x02\0\0G\x02\0\0H\x02\0\0L\x02\0\0M\x02\0\0O\x02\0\0R\x02\0\0W\x02\0\0X\x02\0\0[\x02\0\0\\\x02\0\0`\x02\0\0c\x02\0\0f\x02\0\0g\x02\0\0h\x02\0\0m\x02\0\0n\x02\0\0q\x02\0\0t\x02\0\0u\x02\0\0v\x02\0\0w\x02\0\0z\x02\0\0|\x02\0\0}\x02\0\0~\x02\0\0\x85\x02\0\0\x8D\x02\0\0\x93\x02\0\0\x9A\x02\0\0\xA3\x02\0\0\xAD\x02\0\0\xB5\x02\0\0\xB6\x02\0\0\xB7\x02\0\0\xB8\x02\0\0\xBA\x02\0\0\xBE\x02\0\0\xC0\x02\0\0\xC1\x02\0\0\xC7\x02\0\0\xC9\x02\0\0\xD0\x02\0\0\xD8\x02\0\0\xDF\x02\0\0\xE2\x02\0\0\xE6\x02\0\0\xE8\x02\0\0\xE9\x02\0\0\xEB\x02\0\0\xEC\x02\0\0\xEE\x02\0\0\xEF\x02\0\0\xF0\x02\0\0\xF3\x02\0\0\xF6\x02\0\0\xF8\x02\0\0\xFA\x02\0\0\xFD\x02\0\0\xFE\x02\0\0\xFF\x02\0\0\x04\x03\0\0\x06\x03\0\0\x07\x03\0\0\x08\x03\0\0\r\x03\0\0\x12\x03\0\0\x16\x03\0\0\x19\x03\0\0\x1B\x03\0\0\x1F\x03\0\0#\x03\0\0&\x03\0\0(\x03\0\0-\x03\0\0/\x03\0\x003\x03\0\x004\x03\0\x006\x03\0\x007\x03\0\0:\x03\0\0<\x03\0\0=\x03\0\0B\x03\0\0C\x03\0\0L\x03\0\0N\x03\0\0P\x03\0\0R\x03\0\0T\x03\0\0U\x03\0\0V\x03\0\0W\x03\0\0X\x03\0\0Y\x03\0\0[\x03\0\0\\\x03\0\0]\x03\0\0^\x03\0\0_\x03\0\0a\x03\0\0c\x03\0\0f\x03\0\0h\x03\0\0k\x03\0\0m\x03\0\0n\x03\0\0r\x03\0\0v\x03\0\0z\x03\0\0{\x03\0\0~\x03\0\0\x80\x03\0\0\x81\x03\0\0\x86\x03\0\0\x88\x03\0\0\x90\x03\0\0\x98\x03\0\0\x9E\x03\0\0\xA4\x03\0\0\xAA\x03\0\0\xAF\x03\0\0\xB4\x03\0\0\xBD\x03\0\0\xC2\x03\0\0\xCA\x03\0\0\xD1\x03\0\0\xD6\x03\0\0\xDB\x03\0\0\xE0\x03\0\0\xE8\x03\0\0\xED\x03\0\0\xF5\x03\0\0\xFA\x03\0\0\x02\x04\0\0\t\x04\0\0\x10\x04\0\0\x18\x04\0\0!\x04\0\0&\x04\0\0+\x04\0\x000\x04\0\x001\x04\0\x002\x04\0\x003\x04\0\x004\x04\0\08\x04\0\0:\x04\0\0<\x04\0\0=\x04\0\0?\x04\0\0A\x04\0\0C\x04\0\0D\x04\0\0G\x04\0\0H\x04\0\0I\x04\0\0K\x04\0\0O\x04\0\0R\x04\0\0T\x04\0\0U\x04\0\0X\x04\0\0Y\x04\0\0]\x04\0\0`\x04\0\0a\x04\0\0b\x04\0\0c\x04\0\0g\x04\0\0i\x04\0\0l\x04\0\0o\x04\0\0q\x04\0\0t\x04\0\0\x80\x04\0\0\x81\x04\0\0\x82\x04\0\0\x84\x04\0\0\x85\x04\0\0\x89\x04\0\0\x93\x04\0\0\x94\x04\0\0\x95\x04\0\0\x96\x04\0\0\x9B\x04\0\0\xA1\x04\0\0\xA6\x04\0\0\xA9\x04\0\0\xAA\x04\0\0\xAB\x04\0\0\xAF\x04\0\0\xB0\x04\0\0\xB3\x04\0\0\xB6\x04\0\0\xBA\x04\0\0\xBD\x04\0\0\xBE\x04\0\0\xC2\x04\0\0\xC4\x04\0\0\xC6\x04\0\0\xCB\x04\0\0\xCD\x04\0\0\xCF\x04\0\0\xD0\x04\0\0\xD5\x04\0\0\xDA\x04\0\0\xDB\x04\0\0\xDD\x04\0\0\xE0\x04\0\0\xE5\x04\0\0\xEA\x04\0\0\xEC\x04\0\0\xED\x04\0\0\xEE\x04\0\0\xEF\x04\0\0\xF0\x04\0\0\xF1\x04\0\0\xF2\x04\0\0\xF3\x04\0\0\xF4\x04\0\0\xF5\x04\0\0\xF6\x04\0\0\xF7\x04\0\0\xF8\x04\0\0\xF9\x04\0\0\xFA\x04\0\0\xFB\x04\0\0\xFC\x04\0\0\xFD\x04\0\0\xFE\x04\0\0\xFF\x04\0\0\0\x05\0\0\x01\x05\0\0\x02\x05\0\0\x03\x05\0\0\x04\x05\0\0\x05\x05\0\0\x06\x05\0\0\x07\x05\0\0\x08\x05\0\0\x0C\x05\0\0\x11\x05\0\0\x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\0\xC8\0\xD0\0\xD8\x004\0\x10\0\x08\0\x08\0\x08\0\x08\0\x08\x08\0\0\xAC\0\xB0\x04\xB0\0\xC8\x08\xD0\x08\xE0\x08\xE0\0\xE8\0\xE0\x08\x08\0@\x08@\x000\0\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xF0\0\xF8\08\0\x10\x08\x10\0\x10\x08\x18\0\x10\x08\x10\x08\x10\0\x10\x08\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\x18\0\x08\0\x08\x08\xE0\0\xD8\x04\xD8\0\xE0\0\xD8\x08\xE0\0\0\x08\0\0\x08\x08\x08\0\0\x08\0\0\x08\0\xD8\0\xD0\x08\xD0\0\xD8\x08\xD8\0\x18\x08\x10\x08\x10\0\x18\x08\x10\x08\x10\x08\xF8\0\0\x08\0\0\0\x08\x08\0\x18\0\0\x08\0\0\x08\0\x08\x08\0\0\0\x08\x08\x08\x08\0\x08\x08\x18\0\x10\x08\x10\0\x10\x08\x10\x08\x10\0\x10\x08`\x08`\0\xE0\0\xE8\x08\xE8\0\xE0\x08\xE8\0`\0X\0X\0P\0\0\0\0\x08\x08\x08\x08\0\x08\x08\x08\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\0\x08\0\0\0\x08\xE0\0 \x08\x18\0 \x08\x18\x08 \0\xE8\0\x08\0\0\x08\0\0\0\x08\0\0\x08\0\x08\x08\xE8\0\xE8\x08\0\0\xE8\0\xE8\x08\xF0\0\xF0\x08\xF0\0\xF0\x08\xF0\0\xF8\x08\xF0\x08\xE0\x08\0\0\0\0\0\0\xE0\0\xE0\0\xE0\0\x08\0\x10\x08\x10\0\x10\x08\xF0\0\xD0\x08\xD0\0P\x08P\0\xF8\0\0\0\xE2\0\xE8\0\xE0\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08@\x08@\0\xD0\x08\xD0\0\x08\0\x08\x08\xD8\x08\x08\x08\x08\0\x08\x08H\08\0@\0@\08\0\0\x08\x08\0\0\x08\0\0\0\x08,\0(\x000\0\x18\0\x18\x08\x18\0\x1C\0 \x08 \0\x1C\x08\x1C\0\0\0\x08\x08\x08\0\x08\x08\x10\x08\x08\0\0\x08\0\0\0\x08\xD8\0\xD8\x08\xD8\0\x10\x08\x10\0\x18\0H\0\x18\x000\x08(\x000\x08(\x080\08\0\xAB\0\xB0\0p\0\xA0\0\xA8\0h\0`\0\x18\0\xE0\0H\0D\0H\0H\x08H\0\x18\0\xD8\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x08(\x000\x080\x000\x08(\x080\0(\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x080\0(\0(\0(\x080\0(\x08(\x000\x08(\x08 \x080\0(\0(\0(\x080\0(\x08(\0(\x08 \x08(\08\0\x10\x08\xE0\0\x08\0\x08\x08,\x004\x000\0,\0\xFB\0\0\0\x10\0\x18\x08\x10\0\x08\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\x08\x10\x08\x10\0\x10\x08\x10\0\x18\x08\x10\x08\x10\0\x08\x08\x08\0\x10\0\x08\0\x10\0\x08\0\x10\0\0\x08\0\0\x08\0\0\x08\0\0\0\x08\x08\0\x08\x08\x08\0\x08\x08\x18\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\0\xA0\0`\0`\0\x08\0\x08\x08\0\x004\x000\08\x088\08\0@\x08@\0@\x08@\0P\x08P\0\xE0\0\xE0\x08\xE0\0\0\0\xE0\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08 \x08 \0(\0\x10\0\xD0\0\xD0\x08\xC8\x08\xC8\0\xD0\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xC8\x08\xD0\0\xD8\0\xD0\x08\xD8\0\xC8\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xD0\x08\xD0\0\xD0\x08\xD0\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD0\0\xD0\x08\xD0\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xD0\x08\xC8\x08\xD0\0\xC0\0\xC0\x08\xC0\0\xC0\x08@\0<\0@\0\x10\0\x10\0\x08\x08\x10\0X\x08X\0\x08\0\\\0\\\x08\\\0X\0X\x08\x08\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD8\0\xD0\0\xD8\0\xD0\x08\xD0\0\x08\0\x08\x08\x08\0\x08\x08,\0.\0\\\0`\0\xA8\0`\x08f\x08 \0\xD8\0\xD8\x08\xD8\0\xB8\0\xB4\0\xB0\0P\0P\0X\0@\x08@\0(\0(\x08(\0\x08\0\x08\x08\xE0\0\xE8\0\xE8\x08\xBC\0\xC0\0\xE0\0\0\0\0\x08\0\0\0\x08\x08\0\0\x08\x08\x08\0\x08\xF8\0\xF8\x08\0\x08\xF8\x08H\0\xE0\0\xE8\0\xE0\x08 \0\x18\0 \0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\x08\x08 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \08\x088\08\x080\x080\08\x000\08\0H\x08@\x08H\0P\0@\0H\0h\x08`\x08X\x08`\0X\0`\0X\x08P\x08X\0`\0P\0X\0@\x088\x08@\0H\0@\0\x18\x08\x10\x08\x10\0\x18\0\x10\0H\x08H\0P\x08H\x08@\x08P\0X\0P\0H\08\x080\x088\0@\08\0 \x08\x18\0 \x08\x18\x08\x10\x08 \0\x18\0 \0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0\x18\x08\x10\x08\x18\0 \0\x18\08\x080\x088\x000\08\x000\x08(\x080\08\x000\08\x088\08\x080\x080\08\x000\08\0`\x08X\x08`\0X\0`\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0X\x08P\x08X\0`\0X\08\x088\08\x080\x080\08\x000\08\0 \x08\x18\x08\x10\x08\x18\0 \0\x18\0 \0H\0X\x08P\x08X\0`\0X\0P\0X\x08X\0X\x08P\x08P\0X\0P\0X\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0\x18\0P\x08H\x08P\0X\0P\0(\x08 \x08(\x000\0(\0H\x08@\x08H\0P\0H\0\x10\0\x18\0X\0 \0\x10\x08\x10\0\x18\0\x10\0\x08\0\x08\x08<\0@\0\0\0\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\0\0\x08\x08\x08\0\x08\x08\0\0\x18\0\xE4\0\xE8\0\x10\x08\x10\0\x18\0\x10\0\0\0\x08\0\0\0\xD0\x08\xD0\0\xE0\0\x10\x08\x10\0\x18\0\x10\0\xD8\0\xD8\x08\xE0\0\xD8\x08\x08\0\x08\x08\x08\0(\0\0\08\x000\x08(\x080\x08(\0\xA8\0h\0H\0@\0H\0(\x08 \x08(\0\x08\x08\x08\0h\0h\x08h\0\x10\x08\x10\0\x18\x08\x18\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x18\0\xE0\0`\0@\x08@\0\x18\0\x18\x08\x10\x08\x18\x08\x10\x08\x18\x08\x18\0\x10\0\x10\x08\x18\x08\x18\0\x18\x08\x10\x08 \0\x18\0\x18\0`\0\xA8\0\xA8\x08\xB0\0\xB0\x08\xA8\x08\xB0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD8\x08\xB0\x08\xB8\0\xB8\x08\xB0\x08\xB8\x08\xC8\x08\xC8\0\xC8\x08\xD0\x08\xC8\x08\xD8\0\xD8\x08\xD8\0\xD8\x08\xB0\0\xD8\x08\xD8\0\xD8\x08\xD8\x08\xD8\0\xD8\x08\xC0\x08\xC0\0\xC0\x08\xB8\x08\xD0\x08\xD8\0\xD0\x08\xC0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\x08\xD8\x08\xC0\x08\xC0\0\xB8\x08\xC0\0\xB8\x08\xC8\x08\xD0\x08\xC8\x08\xD0\x08\xD8\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xA8\x08\xB8\0\xB8\x08\xA8\x08\xB8\x08\xC8\0\xC0\x08\xB8\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xD0\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xC8\x08\xD0\x08\xB8\x08\0\0\x08\0\x10\0\x18\0 \0(\x000\08\0@\0H\0P\0X\0`\0h\0p\0\xF8\0\xF0\0\xE8\0\xE0\0\xD8\0\xD0\0\xC8\0\xC0\0\xB8\0\xB0\0\xA8\0\xA0\0\xE8\x08\xE8\0\xE8\x08\xE8\0(\0(\x080\0(\x08(\x000\x08(\x08(\0\x08\x08\x08\0\x08\x08\xE0\0\xE0\0\xDC\0\xE0\0\xE0\0\xE0\0@\08\0X\x08X\0`\0\xA8\x08\xA8\0h\x08h\0\x18\0\x18\0\x10\0\x10\0\x10\0") }) }); } #[clippy::msrv = "1.71.1"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.id.locale.is_default() { Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(Self::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER), metadata: Default::default() }) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -35,7 +35,7 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } @@ -44,12 +44,12 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -57,17 +57,17 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } diff --git a/provider/data/timezone/data/mod.rs b/provider/data/timezone/data/mod.rs index cc03811c850..e531c05f9f9 100644 --- a/provider/data/timezone/data/mod.rs +++ b/provider/data/timezone/data/mod.rs @@ -1,8 +1,6 @@ // @generated include!("bcp47_to_iana_map_v1_marker.rs.data"); include!("iana_to_bcp47_map_v3_marker.rs.data"); -include!("metazone_period_v1_marker.rs.data"); -include!("zone_offset_period_v1_marker.rs.data"); include!("windows_zones_to_bcp47_map_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like /// `impl_core_helloworld_v1` to add implementations. @@ -35,8 +33,6 @@ macro_rules! impl_data_provider { make_provider!($provider); impl_bcp47_to_iana_map_v1_marker!($provider); impl_iana_to_bcp47_map_v3_marker!($provider); - impl_metazone_period_v1_marker!($provider); - impl_zone_offset_period_v1_marker!($provider); impl_windows_zones_to_bcp47_map_v1_marker!($provider); }; } @@ -49,8 +45,6 @@ macro_rules! impl_any_provider { match marker.path.hashed() { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), - h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), - h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), } diff --git a/provider/data/timezone/fingerprints.csv b/provider/data/timezone/fingerprints.csv index 0be79008b72..c1ced2df8ad 100644 --- a/provider/data/timezone/fingerprints.csv +++ b/provider/data/timezone/fingerprints.csv @@ -1,5 +1,3 @@ time_zone/bcp47_to_iana@1, , 7630B, 7609B, 7efd2629d86e0cdc time_zone/iana_to_bcp47@3, , 9551B, 9509B, ef97860b5f688e6d -time_zone/metazone_period@1, , 11097B, 11009B, dcfa50fb39ebd549 -time_zone/offset_period@1, , 13374B, 13286B, 397b18d3f2345411 time_zone/windows_zones_to_bcp47@1, , 8634B, 8591B, 90b7fe3f9cadf5bd diff --git a/provider/data/timezone/stubdata/mod.rs b/provider/data/timezone/stubdata/mod.rs index cc03811c850..e531c05f9f9 100644 --- a/provider/data/timezone/stubdata/mod.rs +++ b/provider/data/timezone/stubdata/mod.rs @@ -1,8 +1,6 @@ // @generated include!("bcp47_to_iana_map_v1_marker.rs.data"); include!("iana_to_bcp47_map_v3_marker.rs.data"); -include!("metazone_period_v1_marker.rs.data"); -include!("zone_offset_period_v1_marker.rs.data"); include!("windows_zones_to_bcp47_map_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like /// `impl_core_helloworld_v1` to add implementations. @@ -35,8 +33,6 @@ macro_rules! impl_data_provider { make_provider!($provider); impl_bcp47_to_iana_map_v1_marker!($provider); impl_iana_to_bcp47_map_v3_marker!($provider); - impl_metazone_period_v1_marker!($provider); - impl_zone_offset_period_v1_marker!($provider); impl_windows_zones_to_bcp47_map_v1_marker!($provider); }; } @@ -49,8 +45,6 @@ macro_rules! impl_any_provider { match marker.path.hashed() { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), - h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), - h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), } diff --git a/provider/registry/src/lib.rs b/provider/registry/src/lib.rs index e1bfe7428af..87bdac1114a 100644 --- a/provider/registry/src/lib.rs +++ b/provider/registry/src/lib.rs @@ -37,12 +37,14 @@ macro_rules! registry( icu::collator::provider::CollationMetadataV1Marker = "collator/meta@1", icu::collator::provider::CollationReorderingV1Marker = "collator/reord@1", icu::collator::provider::CollationSpecialPrimariesV1Marker = "collator/prim@1", + icu::datetime::provider::time_zones::LocationsV1Marker = "time_zone/locations@1", icu::datetime::provider::time_zones::MetazoneGenericNamesLongV1Marker = "time_zone/generic_long@1", icu::datetime::provider::time_zones::MetazoneGenericNamesShortV1Marker = "time_zone/generic_short@1", + icu::datetime::provider::time_zones::MetazonePeriodV1Marker = "time_zone/metazone_period@1", icu::datetime::provider::time_zones::MetazoneSpecificNamesLongV1Marker = "time_zone/specific_long@1", icu::datetime::provider::time_zones::MetazoneSpecificNamesShortV1Marker = "time_zone/specific_short@1", icu::datetime::provider::time_zones::TimeZoneEssentialsV1Marker = "time_zone/essentials@1", - icu::datetime::provider::time_zones::LocationsV1Marker = "time_zone/locations@1", + icu::datetime::provider::time_zones::ZoneOffsetPeriodV1Marker = "time_zone/offset_period@1", icu::decimal::provider::DecimalSymbolsV1Marker = "decimal/symbols@1", icu::list::provider::AndListV2Marker = "list/and@2", icu::list::provider::OrListV2Marker = "list/or@2", @@ -193,11 +195,9 @@ macro_rules! registry( icu::segmenter::provider::SentenceBreakDataV2Marker = "segmenter/sentence@2", icu::segmenter::provider::WordBreakDataOverrideV1Marker = "segmenter/word/override@1", icu::segmenter::provider::WordBreakDataV2Marker = "segmenter/word@2", - icu::timezone::provider::MetazonePeriodV1Marker = "time_zone/metazone_period@1", icu::timezone::provider::names::Bcp47ToIanaMapV1Marker = "time_zone/bcp47_to_iana@1", icu::timezone::provider::names::IanaToBcp47MapV3Marker = "time_zone/iana_to_bcp47@3", icu::timezone::provider::windows::WindowsZonesToBcp47MapV1Marker = "time_zone/windows_zones_to_bcp47@1", - icu::timezone::provider::ZoneOffsetPeriodV1Marker = "time_zone/offset_period@1", icu::datetime::provider::neo::WeekdayNamesV1Marker = "datetime/names/weekdays@1", icu::datetime::provider::neo::DayPeriodNamesV1Marker = "datetime/names/dayperiods@1", icu::datetime::provider::neo::GluePatternV1Marker = "datetime/patterns/glue@1", diff --git a/provider/source/src/time_zones/convert.rs b/provider/source/src/time_zones/convert.rs index e28c193e535..f4244e42cd7 100644 --- a/provider/source/src/time_zones/convert.rs +++ b/provider/source/src/time_zones/convert.rs @@ -10,7 +10,6 @@ use cldr_serde::time_zones::time_zone_names::*; use icu::calendar::DateTime; use icu::calendar::Iso; use icu::datetime::provider::time_zones::*; -use icu::timezone::provider::*; use icu::timezone::UtcOffset; use icu::timezone::ZoneVariant; use icu_provider::prelude::*; diff --git a/provider/source/src/time_zones/mod.rs b/provider/source/src/time_zones/mod.rs index 4a2c5e7e878..cd3b4f40f79 100644 --- a/provider/source/src/time_zones/mod.rs +++ b/provider/source/src/time_zones/mod.rs @@ -6,7 +6,6 @@ use crate::cldr_serde; use crate::IterableDataProviderCached; use crate::SourceDataProvider; use icu::datetime::provider::time_zones::*; -use icu::timezone::provider::*; use icu_locale_core::subtags::Region; use icu_provider::prelude::*; use std::collections::BTreeMap; From 570c40dc676c3e60dccec2a1b2926e0e1ebc653c Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 16:01:29 -0700 Subject: [PATCH 07/21] ugh --- components/datetime/src/format/neo.rs | 134 +++++++++++++----- components/datetime/src/neo.rs | 24 ++++ components/datetime/src/neo_marker.rs | 66 +++++++++ .../datetime/src/provider/time_zones.rs | 4 + components/datetime/src/time_zone.rs | 45 +++--- 5 files changed, 221 insertions(+), 52 deletions(-) diff --git a/components/datetime/src/format/neo.rs b/components/datetime/src/format/neo.rs index 473d406ff9c..ee1ad68d74c 100644 --- a/components/datetime/src/format/neo.rs +++ b/components/datetime/src/format/neo.rs @@ -65,6 +65,8 @@ impl_holder_trait!(tz::MzGenericLongV1Marker); impl_holder_trait!(tz::MzGenericShortV1Marker); impl_holder_trait!(tz::MzSpecificLongV1Marker); impl_holder_trait!(tz::MzSpecificShortV1Marker); +impl_holder_trait!(tz::MzPeriodV1Marker); +impl_holder_trait!(tz::OffsetsV1Marker); #[non_exhaustive] pub enum MaybePayloadError2 { @@ -417,6 +419,8 @@ pub trait DateTimeNamesMarker { type ZoneGenericShort: DateTimeNamesHolderTrait; type ZoneSpecificLong: DateTimeNamesHolderTrait; type ZoneSpecificShort: DateTimeNamesHolderTrait; + type MetazoneLookup: DateTimeNamesHolderTrait; + type Offsets: DateTimeNamesHolderTrait; } #[derive(Debug)] @@ -433,6 +437,8 @@ impl DateTimeNamesMarker for DateMarker { type ZoneGenericShort = NeverMarker<()>; type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } #[derive(Debug)] @@ -449,6 +455,8 @@ impl DateTimeNamesMarker for TimeMarker { type ZoneGenericShort = NeverMarker<()>; type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } #[derive(Debug)] @@ -465,6 +473,8 @@ impl DateTimeNamesMarker for DateTimeMarker { type ZoneGenericShort = NeverMarker<()>; type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } #[derive(Debug)] @@ -481,6 +491,8 @@ impl DateTimeNamesMarker for ZonedDateTimeMarker { type ZoneGenericShort = tz::MzGenericShortV1Marker; type ZoneSpecificLong = tz::MzSpecificLongV1Marker; type ZoneSpecificShort = tz::MzSpecificShortV1Marker; + type MetazoneLookup = tz::MzPeriodV1Marker; + type Offsets = tz::OffsetsV1Marker; } impl From> for RawDateTimeNames { @@ -496,6 +508,8 @@ impl From> for RawDateTimeNames { mz_generic_short: (), mz_specific_long: (), mz_specific_short: (), + mz_periods: (), + offsets: (), fixed_decimal_formatter: other.fixed_decimal_formatter, _marker: PhantomData, } @@ -515,6 +529,8 @@ impl From> for RawDateTimeNames { mz_generic_short: (), mz_specific_long: (), mz_specific_short: (), + mz_periods: (), + offsets: (), fixed_decimal_formatter: other.fixed_decimal_formatter, _marker: PhantomData, } @@ -549,6 +565,8 @@ pub(crate) struct RawDateTimeNames { mz_specific_short: >::Container<()>, + mz_periods: >::Container<()>, + offsets: >::Container<()>, // TODO(#4340): Make the FixedDecimalFormatter optional fixed_decimal_formatter: Option, _marker: PhantomData, @@ -585,6 +603,8 @@ pub(crate) struct RawDateTimeNamesBorrowed<'l> { mz_generic_short: OptionalNames<(), &'l tz::MzGenericV1<'l>>, mz_specific_long: OptionalNames<(), &'l tz::MzSpecificV1<'l>>, mz_specific_short: OptionalNames<(), &'l tz::MzSpecificV1<'l>>, + mz_periods: OptionalNames<(), &'l tz::MzPeriodV1<'l>>, + offsets: OptionalNames<(), &'l tz::OffsetsV1<'l>>, pub(crate) fixed_decimal_formatter: Option<&'l FixedDecimalFormatter>, } @@ -1101,10 +1121,11 @@ impl TypedDateTimeNames { provider: &P, ) -> Result<&mut Self, SingleLoadError> where - P: DataProvider + ?Sized, + P: DataProvider + DataProvider + ?Sized, { self.inner.load_time_zone_generic_long_names( &tz::MzGenericLongV1Marker::bind(provider), + &tz::MzPeriodV1Marker::bind(provider), &self.locale, )?; Ok(self) @@ -1176,10 +1197,11 @@ impl TypedDateTimeNames { provider: &P, ) -> Result<&mut Self, SingleLoadError> where - P: DataProvider + ?Sized, + P: DataProvider + DataProvider + ?Sized, { self.inner.load_time_zone_generic_short_names( &tz::MzGenericShortV1Marker::bind(provider), + &tz::MzPeriodV1Marker::bind(provider), &self.locale, )?; Ok(self) @@ -1251,10 +1273,15 @@ impl TypedDateTimeNames { provider: &P, ) -> Result<&mut Self, SingleLoadError> where - P: DataProvider + ?Sized, + P: DataProvider + + DataProvider + + DataProvider + + ?Sized, { self.inner.load_time_zone_specific_long_names( &tz::MzSpecificLongV1Marker::bind(provider), + &tz::MzPeriodV1Marker::bind(provider), + &tz::OffsetsV1Marker::bind(provider), &self.locale, )?; Ok(self) @@ -1326,10 +1353,15 @@ impl TypedDateTimeNames { provider: &P, ) -> Result<&mut Self, SingleLoadError> where - P: DataProvider + ?Sized, + P: DataProvider + + DataProvider + + DataProvider + + ?Sized, { self.inner.load_time_zone_specific_short_names( &tz::MzSpecificShortV1Marker::bind(provider), + &tz::MzPeriodV1Marker::bind(provider), + &tz::OffsetsV1Marker::bind(provider), &self.locale, )?; Ok(self) @@ -1476,6 +1508,8 @@ impl TypedDateTimeNames { + DataProvider + DataProvider + DataProvider + + DataProvider + + DataProvider + DataProvider + ?Sized, { @@ -1492,6 +1526,8 @@ impl TypedDateTimeNames { &tz::MzGenericShortV1Marker::bind(provider), &tz::MzSpecificLongV1Marker::bind(provider), &tz::MzSpecificShortV1Marker::bind(provider), + &tz::MzPeriodV1Marker::bind(provider), + &tz::OffsetsV1Marker::bind(provider), &ExternalLoaderUnstable(provider), locale, pattern @@ -1564,6 +1600,8 @@ impl TypedDateTimeNames { &tz::MzGenericShortV1Marker::bind(&crate::provider::Baked), &tz::MzSpecificLongV1Marker::bind(&crate::provider::Baked), &tz::MzSpecificShortV1Marker::bind(&crate::provider::Baked), + &tz::MzPeriodV1Marker::bind(&crate::provider::Baked), + &tz::OffsetsV1Marker::bind(&crate::provider::Baked), &ExternalLoaderCompiledData, locale, pattern @@ -1646,6 +1684,8 @@ impl RawDateTimeNames { mz_generic_short: >::Container::<_>::new_empty(), mz_specific_long: >::Container::<_>::new_empty(), mz_specific_short: >::Container::<_>::new_empty(), + mz_periods: >::Container::<_>::new_empty(), + offsets: >::Container::<_>::new_empty(), fixed_decimal_formatter: None, _marker: PhantomData, } @@ -1663,6 +1703,8 @@ impl RawDateTimeNames { mz_generic_short: self.mz_generic_short.get().inner, mz_specific_long: self.mz_specific_long.get().inner, mz_specific_short: self.mz_specific_short.get().inner, + mz_periods: self.mz_periods.get().inner, + offsets: self.offsets.get().inner, fixed_decimal_formatter: self.fixed_decimal_formatter.as_ref(), } } @@ -1883,14 +1925,12 @@ impl RawDateTimeNames { Ok(()) } - pub(crate) fn load_time_zone_generic_long_names

( + pub(crate) fn load_time_zone_generic_long_names( &mut self, - provider: &P, + mz_generic_long_provider: &(impl BoundDataProvider + ?Sized), + mz_period_provider: &(impl BoundDataProvider + ?Sized), locale: &DataLocale, - ) -> Result<(), SingleLoadError> - where - P: BoundDataProvider + ?Sized, - { + ) -> Result<(), SingleLoadError> { let field = fields::Field { symbol: FieldSymbol::TimeZone(fields::TimeZone::LowerV), length: FieldLength::Wide, @@ -1901,20 +1941,22 @@ impl RawDateTimeNames { ..Default::default() }; self.mz_generic_long - .load_put(provider, req, variables) + .load_put(mz_generic_long_provider, req, variables) + .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? + .map_err(SingleLoadError::Data)?; + self.mz_periods + .load_put(mz_period_provider, Default::default(), variables) .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? .map_err(SingleLoadError::Data)?; Ok(()) } - pub(crate) fn load_time_zone_generic_short_names

( + pub(crate) fn load_time_zone_generic_short_names( &mut self, - provider: &P, + mz_generic_short_provider: &(impl BoundDataProvider + ?Sized), + mz_period_provider: &(impl BoundDataProvider + ?Sized), locale: &DataLocale, - ) -> Result<(), SingleLoadError> - where - P: BoundDataProvider + ?Sized, - { + ) -> Result<(), SingleLoadError> { let field = fields::Field { symbol: FieldSymbol::TimeZone(fields::TimeZone::LowerV), length: FieldLength::One, @@ -1925,20 +1967,23 @@ impl RawDateTimeNames { ..Default::default() }; self.mz_generic_short - .load_put(provider, req, variables) + .load_put(mz_generic_short_provider, req, variables) + .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? + .map_err(SingleLoadError::Data)?; + self.mz_periods + .load_put(mz_period_provider, Default::default(), variables) .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? .map_err(SingleLoadError::Data)?; Ok(()) } - pub(crate) fn load_time_zone_specific_long_names

( + pub(crate) fn load_time_zone_specific_long_names( &mut self, - provider: &P, + mz_specific_long_provider: &(impl BoundDataProvider + ?Sized), + mz_period_provider: &(impl BoundDataProvider + ?Sized), + offsets_provider: &(impl BoundDataProvider + ?Sized), locale: &DataLocale, - ) -> Result<(), SingleLoadError> - where - P: BoundDataProvider + ?Sized, - { + ) -> Result<(), SingleLoadError> { let field = fields::Field { symbol: FieldSymbol::TimeZone(fields::TimeZone::LowerZ), length: FieldLength::Wide, @@ -1949,20 +1994,27 @@ impl RawDateTimeNames { ..Default::default() }; self.mz_specific_long - .load_put(provider, req, variables) + .load_put(mz_specific_long_provider, req, variables) + .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? + .map_err(SingleLoadError::Data)?; + self.mz_periods + .load_put(mz_period_provider, Default::default(), variables) + .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? + .map_err(SingleLoadError::Data)?; + self.offsets + .load_put(offsets_provider, Default::default(), variables) .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? .map_err(SingleLoadError::Data)?; Ok(()) } - pub(crate) fn load_time_zone_specific_short_names

( + pub(crate) fn load_time_zone_specific_short_names( &mut self, - provider: &P, + mz_specific_short_provider: &(impl BoundDataProvider + ?Sized), + mz_period_provider: &(impl BoundDataProvider + ?Sized), + offsets_provider: &(impl BoundDataProvider + ?Sized), locale: &DataLocale, - ) -> Result<(), SingleLoadError> - where - P: BoundDataProvider + ?Sized, - { + ) -> Result<(), SingleLoadError> { let field = fields::Field { symbol: FieldSymbol::TimeZone(fields::TimeZone::LowerZ), length: FieldLength::One, @@ -1973,7 +2025,15 @@ impl RawDateTimeNames { ..Default::default() }; self.mz_specific_short - .load_put(provider, req, variables) + .load_put(mz_specific_short_provider, req, variables) + .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? + .map_err(SingleLoadError::Data)?; + self.mz_periods + .load_put(mz_period_provider, Default::default(), variables) + .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? + .map_err(SingleLoadError::Data)?; + self.offsets + .load_put(offsets_provider, Default::default(), variables) .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? .map_err(SingleLoadError::Data)?; Ok(()) @@ -2024,6 +2084,8 @@ impl RawDateTimeNames { mz_generic_short_provider: &(impl BoundDataProvider + ?Sized), mz_specific_long_provider: &(impl BoundDataProvider + ?Sized), mz_specific_short_provider: &(impl BoundDataProvider + ?Sized), + mz_period_provider: &(impl BoundDataProvider + ?Sized), + offsets_provider: &(impl BoundDataProvider + ?Sized), fixed_decimal_formatter_loader: &impl FixedDecimalFormatterLoader, locale: &DataLocale, pattern_items: impl Iterator, @@ -2059,6 +2121,8 @@ impl RawDateTimeNames { .map_err(LoadError::Data)?; self.load_time_zone_specific_short_names( mz_specific_short_provider, + mz_period_provider, + offsets_provider, locale, )?; } @@ -2072,6 +2136,8 @@ impl RawDateTimeNames { .map_err(LoadError::Data)?; self.load_time_zone_specific_long_names( mz_specific_long_provider, + mz_period_provider, + offsets_provider, locale, )?; } @@ -2085,6 +2151,7 @@ impl RawDateTimeNames { .map_err(LoadError::Data)?; self.load_time_zone_generic_short_names( mz_generic_short_provider, + mz_period_provider, locale, )?; // For fallback: @@ -2100,6 +2167,7 @@ impl RawDateTimeNames { .map_err(LoadError::Data)?; self.load_time_zone_generic_long_names( mz_generic_long_provider, + mz_period_provider, locale, )?; // For fallback: @@ -2592,6 +2660,8 @@ impl<'data> RawDateTimeNamesBorrowed<'data> { mz_generic_short: self.mz_generic_short.get_option(), mz_specific_long: self.mz_specific_long.get_option(), mz_specific_short: self.mz_specific_short.get_option(), + mz_periods: self.mz_periods.get_option(), + offsets: self.offsets.get_option(), } } } diff --git a/components/datetime/src/neo.rs b/components/datetime/src/neo.rs index 58bd43014b3..946caaf36c6 100644 --- a/components/datetime/src/neo.rs +++ b/components/datetime/src/neo.rs @@ -222,6 +222,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, { Self::try_new_internal( @@ -263,6 +265,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // FixedDecimalFormatter markers + DataProvider, @@ -421,6 +425,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, { Self::try_new_internal( @@ -462,6 +468,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // FixedDecimalFormatter markers + DataProvider, @@ -504,6 +512,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, L: FixedDecimalFormatterLoader, { @@ -536,6 +546,8 @@ where &::GenericShortV1Marker::bind(provider), &::SpecificLongV1Marker::bind(provider), &::SpecificShortV1Marker::bind(provider), + &::MetazonePeriodV1Marker::bind(provider), + &::ZoneOffsetPeriodV1Marker::bind(provider), loader, // fixed decimal formatter locale, selection.pattern_items_for_data_loading(), @@ -754,6 +766,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, { Self::try_new_internal( @@ -843,6 +857,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // AnyCalendar constructor markers + DataProvider @@ -1054,6 +1070,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider { Self::try_new_internal( @@ -1143,6 +1161,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // AnyCalendar constructor markers + DataProvider @@ -1240,6 +1260,8 @@ where + DataProvider<::GenericShortV1Marker> + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + + DataProvider<::MetazonePeriodV1Marker> + + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, L: FixedDecimalFormatterLoader + AnyCalendarLoader, { @@ -1274,6 +1296,8 @@ where &::GenericShortV1Marker::bind(provider), &::SpecificLongV1Marker::bind(provider), &::SpecificShortV1Marker::bind(provider), + &::MetazonePeriodV1Marker::bind(provider), + &::ZoneOffsetPeriodV1Marker::bind(provider), loader, // fixed decimal formatter locale, selection.pattern_items_for_data_loading(), diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 9095c6975a0..60cb3d09fd7 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -1070,6 +1070,10 @@ pub trait ZoneMarkers: private::Sealed { type SpecificLongV1Marker: DataMarker>; /// Marker for loading generic short time zone names. type SpecificShortV1Marker: DataMarker>; + /// Marker for loading generic short time zone names. + type MetazonePeriodV1Marker: DataMarker>; + /// for loading generic short time zone names. + type ZoneOffsetPeriodV1Marker: DataMarker>; } /// A trait associating constants and types implementing various other traits @@ -1192,6 +1196,8 @@ impl ZoneMarkers for NeoNeverMarker { type GenericShortV1Marker = NeverMarker>; type SpecificLongV1Marker = NeverMarker>; type SpecificShortV1Marker = NeverMarker>; + type MetazonePeriodV1Marker = NeverMarker>; + type ZoneOffsetPeriodV1Marker = NeverMarker>; } /// A struct that supports formatting both a date and a time. @@ -1250,6 +1256,8 @@ where type ZoneGenericShort = NeverMarker<()>; type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1287,6 +1295,8 @@ where type ZoneGenericShort = NeverMarker<()>; type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1324,6 +1334,8 @@ where type ZoneGenericShort = Z::ZoneGenericShort; type ZoneSpecificLong = Z::ZoneSpecificLong; type ZoneSpecificShort = Z::ZoneSpecificShort; + type MetazoneLookup = Z::MetazoneLookup; + type Offsets = Z::Offsets; } impl HasConstComponents for DateTimeCombo @@ -1362,6 +1374,8 @@ where type ZoneGenericShort = NeverMarker<()>; type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1403,6 +1417,8 @@ where type ZoneGenericShort = Z::ZoneGenericShort; type ZoneSpecificLong = Z::ZoneSpecificLong; type ZoneSpecificShort = Z::ZoneSpecificShort; + type MetazoneLookup = NeverMarker<()>; + type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1569,6 +1585,12 @@ macro_rules! datetime_marker_helper { (@data/zone/specific_short, yes) => { tz::MzSpecificShortV1Marker }; + (@data/zone/metazone_periods, yes) => { + tz::MzPeriodV1Marker + }; + (@data/zone/offsets, yes) => { + tz::OffsetsV1Marker + }; (@data/zone/essentials,) => { NeverMarker> }; @@ -1587,6 +1609,12 @@ macro_rules! datetime_marker_helper { (@data/zone/specific_short,) => { NeverMarker> }; + (@data/zone/metazone_periods,) => { + NeverMarker> + }; + (@data/zone/offsets,) => { + NeverMarker> + }; (@names/year, yes) => { YearNamesV1Marker }; @@ -1617,6 +1645,12 @@ macro_rules! datetime_marker_helper { (@names/zone/specific_short, yes) => { tz::MzSpecificShortV1Marker }; + (@names/zone/metazone_periods, yes) => { + tz::MzPeriodV1Marker + }; + (@names/zone/offsets, yes) => { + tz::OffsetsV1Marker + }; (@names/$any:ident,) => { NeverMarker<()> }; @@ -1843,6 +1877,8 @@ macro_rules! impl_date_or_calendar_period_marker { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short,); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); + type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateInputMarkers for $type { type YearInput = datetime_marker_helper!(@input/year, $($year_yes)?); @@ -2067,6 +2103,8 @@ macro_rules! impl_time_marker { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short,); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); + type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl HasConstTimeComponents for $type { const COMPONENTS: NeoTimeComponents = $components; @@ -2127,6 +2165,10 @@ macro_rules! impl_zone_marker { $(zone_specific_long = $zone_specific_long_yes:ident,)? // Whether specific short formats can occur. $(zone_specific_short = $zone_specific_short_yes:ident,)? + // Whether metazone periods are needed + $(metazone_periods = $metazone_periods_yes:ident,)? + // Whether metazone offests are needed + $(offsets = $offsets_yes:ident,)? ) => { impl_marker_with_options!( #[doc = concat!("**“", $sample, "**” ⇒ ", $description)] @@ -2212,6 +2254,8 @@ macro_rules! impl_zone_marker { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short, $($zone_generic_short_yes)?); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long, $($zone_specific_long_yes)?); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short, $($zone_specific_short_yes)?); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods, $($metazone_periods_yes)?); + type Offsets = datetime_marker_helper!(@names/zone/offsets, $($offsets_yes)?); } impl HasConstZoneComponent for $type { const COMPONENT: NeoTimeZoneStyle = $components; @@ -2227,6 +2271,8 @@ macro_rules! impl_zone_marker { type GenericShortV1Marker = datetime_marker_helper!(@data/zone/generic_short, $($zone_generic_short_yes)?); type SpecificLongV1Marker = datetime_marker_helper!(@data/zone/specific_long, $($zone_specific_long_yes)?); type SpecificShortV1Marker = datetime_marker_helper!(@data/zone/specific_short, $($zone_specific_short_yes)?); + type MetazonePeriodV1Marker = datetime_marker_helper!(@data/zone/metazone_periods, $($metazone_periods_yes)?); + type ZoneOffsetPeriodV1Marker = datetime_marker_helper!(@data/zone/offsets, $($offsets_yes)?); } impl DateTimeMarkers for $type { type D = NeoNeverMarker; @@ -2536,6 +2582,8 @@ impl_zone_marker!( zone_essentials = yes, zone_specific_long = yes, zone_specific_short = yes, + metazone_periods = yes, + offsets = yes, ); impl_zone_marker!( @@ -2599,6 +2647,8 @@ impl_zone_marker!( sample = "CDT", zone_essentials = yes, zone_specific_short = yes, + metazone_periods = yes, + offsets = yes, ); impl_zone_marker!( @@ -2652,6 +2702,7 @@ impl_zone_marker!( zone_locations = yes, zone_generic_long = yes, zone_generic_short = yes, + metazone_periods = yes, ); impl_zone_marker!( @@ -2716,6 +2767,7 @@ impl_zone_marker!( zone_essentials = yes, zone_locations = yes, zone_generic_short = yes, + metazone_periods = yes, ); impl_zone_marker!( @@ -2763,6 +2815,8 @@ impl DateTimeNamesMarker for NeoDateSkeleton { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short,); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); + type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateInputMarkers for NeoDateSkeleton { @@ -2824,6 +2878,8 @@ impl DateTimeNamesMarker for NeoCalendarPeriodSkeleton { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short,); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); + type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateInputMarkers for NeoCalendarPeriodSkeleton { @@ -2885,6 +2941,8 @@ impl DateTimeNamesMarker for NeoTimeSkeleton { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short,); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); + type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl TimeMarkers for NeoTimeSkeleton { @@ -2933,6 +2991,8 @@ impl DateTimeNamesMarker for NeoTimeZoneSkeleton { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short, yes); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long, yes); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short, yes); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods, yes); + type Offsets = datetime_marker_helper!(@names/zone/offsets, yes); } impl ZoneMarkers for NeoTimeZoneSkeleton { @@ -2946,6 +3006,8 @@ impl ZoneMarkers for NeoTimeZoneSkeleton { type GenericShortV1Marker = datetime_marker_helper!(@data/zone/generic_short, yes); type SpecificLongV1Marker = datetime_marker_helper!(@data/zone/specific_long, yes); type SpecificShortV1Marker = datetime_marker_helper!(@data/zone/specific_short, yes); + type MetazonePeriodV1Marker = datetime_marker_helper!(@data/zone/metazone_periods, yes); + type ZoneOffsetPeriodV1Marker = datetime_marker_helper!(@data/zone/offsets, yes); } impl DateTimeMarkers for NeoTimeZoneSkeleton { @@ -2983,6 +3045,8 @@ impl DateTimeNamesMarker for NeoDateTimeSkeleton { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short,); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); + type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateTimeMarkers for NeoDateTimeSkeleton { @@ -3023,6 +3087,8 @@ impl DateTimeNamesMarker for NeoSkeleton { type ZoneGenericShort = datetime_marker_helper!(@names/zone/generic_short, yes); type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long, yes); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short, yes); + type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods, yes); + type Offsets = datetime_marker_helper!(@names/zone/offsets, yes); } impl DateTimeMarkers for NeoSkeleton { diff --git a/components/datetime/src/provider/time_zones.rs b/components/datetime/src/provider/time_zones.rs index 8368372ebd0..a5314e861bf 100644 --- a/components/datetime/src/provider/time_zones.rs +++ b/components/datetime/src/provider/time_zones.rs @@ -23,11 +23,15 @@ pub(crate) mod tz { pub(crate) use super::MetazoneGenericNamesLongV1Marker as MzGenericLongV1Marker; pub(crate) use super::MetazoneGenericNamesShortV1Marker as MzGenericShortV1Marker; pub(crate) use super::MetazoneGenericNamesV1 as MzGenericV1; + pub(crate) use super::MetazonePeriodV1 as MzPeriodV1; + pub(crate) use super::MetazonePeriodV1Marker as MzPeriodV1Marker; pub(crate) use super::MetazoneSpecificNamesLongV1Marker as MzSpecificLongV1Marker; pub(crate) use super::MetazoneSpecificNamesShortV1Marker as MzSpecificShortV1Marker; pub(crate) use super::MetazoneSpecificNamesV1 as MzSpecificV1; pub(crate) use super::TimeZoneEssentialsV1 as EssentialsV1; pub(crate) use super::TimeZoneEssentialsV1Marker as EssentialsV1Marker; + pub(crate) use super::ZoneOffsetPeriodV1 as OffsetsV1; + pub(crate) use super::ZoneOffsetPeriodV1Marker as OffsetsV1Marker; } /// An ICU4X mapping to the CLDR timeZoneNames format strings. diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index 0ac4ea8861c..19b6877fbd5 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -212,6 +212,10 @@ pub(crate) struct TimeZoneDataPayloadsBorrowed<'a> { pub(crate) mz_specific_long: Option<&'a provider::time_zones::MetazoneSpecificNamesV1<'a>>, /// The specific short metazone names, e.g. Pacific Daylight Time pub(crate) mz_specific_short: Option<&'a provider::time_zones::MetazoneSpecificNamesV1<'a>>, + /// The metazone lookup + pub(crate) mz_periods: Option<&'a provider::time_zones::MetazonePeriodV1<'a>>, + /// The zone offset lookup + pub(crate) offsets: Option<&'a provider::time_zones::ZoneOffsetPeriodV1<'a>>, } impl ExtractedInput { @@ -431,11 +435,11 @@ impl FormatTimeZone for GenericNonLocationFormat { }) else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let Some(metazone_period) = data_payloads.mz_periods else { + return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); + }; - let metazone_id = input.metazone( - time_zone_id, - crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, - ); + let metazone_id = input.metazone(time_zone_id, metazone_period); let Some(name) = metazone_id.and_then(|mz| { names @@ -468,10 +472,11 @@ impl FormatTimeZone for SpecificNonLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let zone_variant = input.zone_variant_or_guess( - time_zone_id, - crate::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, - ); + let Some(offset_period) = data_payloads.offsets else { + return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); + }; + + let zone_variant = input.zone_variant_or_guess(time_zone_id, offset_period); let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_specific_long.as_ref(), @@ -479,11 +484,11 @@ impl FormatTimeZone for SpecificNonLocationFormat { }) else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let Some(metazone_period) = data_payloads.mz_periods else { + return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); + }; - let metazone_id = input.metazone( - time_zone_id, - crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, - ); + let metazone_id = input.metazone(time_zone_id, metazone_period); let Some(name) = metazone_id.and_then(|mz| { names @@ -645,11 +650,11 @@ impl FormatTimeZone for SpecificLocationFormat { let Some(locations) = data_payloads.locations else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let Some(offset_period) = data_payloads.offsets else { + return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); + }; - let zone_variant = input.zone_variant_or_guess( - time_zone_id, - crate::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, - ); + let zone_variant = input.zone_variant_or_guess(time_zone_id, offset_period); if let Some(location) = locations.locations.get(&time_zone_id) { if zone_variant == ZoneVariant::daylight() { @@ -695,11 +700,11 @@ impl FormatTimeZone for GenericPartialLocationFormat { }) else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; + let Some(metazone_period) = data_payloads.mz_periods else { + return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); + }; - let metazone_id = input.metazone( - time_zone_id, - crate::provider::Baked::SINGLETON_METAZONE_PERIOD_V1_MARKER, - ); + let metazone_id = input.metazone(time_zone_id, metazone_period); let Some(location) = locations.locations.get(&time_zone_id) else { return Ok(Err(FormatTimeZoneError::Fallback)); From a1c6ca8671a30ec8ef329a2c6f4a705ca3d2a19b Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 16:18:43 -0700 Subject: [PATCH 08/21] asdf --- components/datetime/src/format/datetime.rs | 36 +++++++++++++++++----- components/datetime/src/neo_marker.rs | 4 +-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/components/datetime/src/format/datetime.rs b/components/datetime/src/format/datetime.rs index 27e6d720ed1..c92e1227faf 100644 --- a/components/datetime/src/format/datetime.rs +++ b/components/datetime/src/format/datetime.rs @@ -11,7 +11,9 @@ use crate::fields::{self, Day, Field, FieldLength, FieldSymbol, Second, Week, Ye use crate::input::ExtractedInput; use crate::pattern::runtime::PatternMetadata; use crate::pattern::PatternItem; -use crate::time_zone::{FormatTimeZone, FormatTimeZoneError, ResolvedNeoTimeZoneSkeleton}; +use crate::time_zone::{ + FormatTimeZone, FormatTimeZoneError, Iso8601Format, IsoMinutes, ResolvedNeoTimeZoneSkeleton, +}; use core::fmt::{self, Write}; use fixed_decimal::FixedDecimal; @@ -490,9 +492,31 @@ where write_value_missing(w, field)?; Err(DateTimeWriteError::MissingInputField(f)) } - Err(FormatTimeZoneError::MissingFixedDecimalFormatter) => { - // A backup write should have already happened - Err(DateTimeWriteError::MissingFixedDecimalFormatter) + Err( + e @ (FormatTimeZoneError::MissingFixedDecimalFormatter + | FormatTimeZoneError::MissingZoneSymbols), + ) => { + if let Some(offset) = input.offset { + w.with_part(Part::ERROR, |w| { + Iso8601Format { + format: crate::time_zone::IsoFormat::Basic, + minutes: IsoMinutes::Required, + seconds: crate::time_zone::IsoSeconds::Optional, + } + .format_infallible(w, offset) + })?; + } else { + write_value_missing(w, field)?; + } + Err(match e { + FormatTimeZoneError::MissingFixedDecimalFormatter => { + DateTimeWriteError::MissingFixedDecimalFormatter + } + FormatTimeZoneError::MissingZoneSymbols => { + DateTimeWriteError::MissingNames(field) + } + _ => unreachable!(), + }) } Err(FormatTimeZoneError::Fallback) => { // fell through @@ -503,10 +527,6 @@ where })?; Err(DateTimeWriteError::UnsupportedField(field)) } - Err(FormatTimeZoneError::MissingZoneSymbols) => { - // todo write something - Err(DateTimeWriteError::MissingNames(field)) - } } } } diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 60cb3d09fd7..8b671dbcb98 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -1417,8 +1417,8 @@ where type ZoneGenericShort = Z::ZoneGenericShort; type ZoneSpecificLong = Z::ZoneSpecificLong; type ZoneSpecificShort = Z::ZoneSpecificShort; - type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; + type MetazoneLookup = Z::MetazoneLookup; + type Offsets = Z::Offsets; } impl HasConstComponents for DateTimeCombo From 917ba975a13aa8118f60a8c6cb648af09c41adc9 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 16:21:01 -0700 Subject: [PATCH 09/21] doc --- components/timezone/src/lib.rs | 52 +++++++--------------------------- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/components/timezone/src/lib.rs b/components/timezone/src/lib.rs index b485e7ef9ec..9ac534b14b0 100644 --- a/components/timezone/src/lib.rs +++ b/components/timezone/src/lib.rs @@ -8,18 +8,10 @@ //! //! In ICU4X, a [formattable time zone](TimeZoneInfo) consists of four different fields: //! -//! 1. The offset from UTC -//! 2. The time zone ID -//! 3. The metazone ID -//! 4. The zone variant, representing concepts such as Standard, Summer, Daylight, and Ramadan time -//! -//! ## UTC Offset -//! -//! The UTC offset precisely states the time difference between the time zone in question and -//! Coordinated Universal Time (UTC). -//! -//! In localized strings, it is often rendered as "UTC-6", meaning 6 hours less than UTC (some locales -//! use the term "GMT" instead of "UTC"). +//! 1. The time zone ID +//! 2. The offset from UTC +//! 3. The zone variant, representing concepts such as Standard, Summer, Daylight, and Ramadan time +//! 4. A timestamp, as time zone names can change over time //! //! ## Time Zone //! @@ -34,27 +26,13 @@ //! ICU4X uses BCP-47 time zone IDs for all of its APIs. To get a BCP-47 time zone from an //! IANA time zone, use [`TimeZoneIdMapper`]. //! -//! ## Metazone -//! -//! A metazone is a collection of multiple time zones that share the same localized formatting -//! at a particular date and time. -//! -//! For example, "America/Chicago" and "America/Indiana/Knox" both map to US Central Time, or -//! `"America_Central"`. -//! -//! The mapping from time zone to metazone depends on the date. For example, from 1991 to 2006, -//! "America/Indiana/Knox" mapped to US Eastern Time instead of US Central Time. -//! -//! As with time zone IDs, there are two interchangeable forms: -//! -//! 1. Long form, like `"America_Central"` -//! 2. Short form compatible with BCP-47, like `"amce"` +//! ## UTC Offset //! -//! ICU4X uses the short form. +//! The UTC offset precisely states the time difference between the time zone in question and +//! Coordinated Universal Time (UTC). //! -//! Note: in ICU4X, "metazone" is one word and "time zone" is two words, except for this crate -//! and module name, where "timezone" is used with no separators. See -//! . +//! In localized strings, it is often rendered as "UTC-6", meaning 6 hours less than UTC (some locales +//! use the term "GMT" instead of "UTC"). //! //! ## Zone Variant //! @@ -68,17 +46,7 @@ //! Note: It is optional (not required) to set the zone variant when constructing a //! [`TimeZoneInfo`]. Therefore, the list of possible variants does not include a generic variant //! to represent the lack of a preference. -//! -//! # Calculations -//! -//! In date/time processing, normally only a subset of information is available, and the other -//! fields must be computed from it. -//! -//! The following calculations are currently supported or will be supported: -//! -//! 1. Time Zone + Local DateTime → Metazone ([`MetazoneCalculator`]) -//! 2. Time Zone + Local DateTime + Offset → Zone Variant ([`ZoneOffsetCalculator`]) -//! +//! //! # Examples //! //! Create a time zone for which the offset and time zone ID are already known, and calculate From 1abbe5ca02b9aa77fd3b3af9026ec222eb4724f7 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Tue, 15 Oct 2024 16:23:06 -0700 Subject: [PATCH 10/21] gjfiod --- components/timezone/README.md | 56 ++++++-------------------------- components/timezone/src/ixdtf.rs | 4 --- components/timezone/src/lib.rs | 8 ++--- 3 files changed, 12 insertions(+), 56 deletions(-) diff --git a/components/timezone/README.md b/components/timezone/README.md index 6936bdb87d6..5180f49bc6d 100644 --- a/components/timezone/README.md +++ b/components/timezone/README.md @@ -8,18 +8,10 @@ Types for resolving and manipulating time zones. In ICU4X, a [formattable time zone](TimeZoneInfo) consists of four different fields: -1. The offset from UTC -2. The time zone ID -3. The metazone ID -4. The zone variant, representing concepts such as Standard, Summer, Daylight, and Ramadan time - -### UTC Offset - -The UTC offset precisely states the time difference between the time zone in question and -Coordinated Universal Time (UTC). - -In localized strings, it is often rendered as "UTC-6", meaning 6 hours less than UTC (some locales -use the term "GMT" instead of "UTC"). +1. The time zone ID +2. The offset from UTC +3. The zone variant, representing concepts such as Standard, Summer, Daylight, and Ramadan time +4. A timestamp, as time zone names can change over time ### Time Zone @@ -34,31 +26,17 @@ There are two mostly-interchangeable standards for time zone IDs: ICU4X uses BCP-47 time zone IDs for all of its APIs. To get a BCP-47 time zone from an IANA time zone, use [`TimeZoneIdMapper`]. -### Metazone - -A metazone is a collection of multiple time zones that share the same localized formatting -at a particular date and time. - -For example, "America/Chicago" and "America/Indiana/Knox" both map to US Central Time, or -`"America_Central"`. - -The mapping from time zone to metazone depends on the date. For example, from 1991 to 2006, -"America/Indiana/Knox" mapped to US Eastern Time instead of US Central Time. - -As with time zone IDs, there are two interchangeable forms: - -1. Long form, like `"America_Central"` -2. Short form compatible with BCP-47, like `"amce"` +### UTC Offset -ICU4X uses the short form. +The UTC offset precisely states the time difference between the time zone in question and +Coordinated Universal Time (UTC). -Note: in ICU4X, "metazone" is one word and "time zone" is two words, except for this crate -and module name, where "timezone" is used with no separators. See -. +In localized strings, it is often rendered as "UTC-6", meaning 6 hours less than UTC (some locales +use the term "GMT" instead of "UTC"). ### Zone Variant -Many metazones use different names and offsets in the summer than in the winter. In ICU4X, +Many zones use different names and offsets in the summer than in the winter. In ICU4X, this is called the _zone variant_. CLDR has two zone variants, named `"standard"` and `"daylight"`. However, the mapping of these @@ -69,26 +47,12 @@ Note: It is optional (not required) to set the zone variant when constructing a [`TimeZoneInfo`]. Therefore, the list of possible variants does not include a generic variant to represent the lack of a preference. -## Calculations - -In date/time processing, normally only a subset of information is available, and the other -fields must be computed from it. - -The following calculations are currently supported or will be supported: - -1. Time Zone + Local DateTime → Metazone ([`MetazoneCalculator`]) -2. Time Zone + Local DateTime + Offset → Zone Variant ([`ZoneOffsetCalculator`]) - ## Examples -Create a time zone for which the offset and time zone ID are already known, and calculate -the metazone based on a certain local datetime: - ```rust use icu::calendar::DateTime; use icu::timezone::TimeZoneInfo; use icu::timezone::UtcOffset; -use icu::timezone::MetazoneCalculator; use icu::timezone::TimeZoneBcp47Id; use icu::timezone::TimeZoneIdMapper; use tinystr::{tinystr, TinyAsciiStr}; diff --git a/components/timezone/src/ixdtf.rs b/components/timezone/src/ixdtf.rs index a1d08f1fdad..e86bba3c542 100644 --- a/components/timezone/src/ixdtf.rs +++ b/components/timezone/src/ixdtf.rs @@ -168,7 +168,6 @@ impl CustomZonedDateTime { /// /// ``` /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id}; - /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// /// let zoneddatetime = CustomZonedDateTime::try_iso_from_str("2024-08-08T12:08:19-05:00[America/Chicago]").unwrap(); @@ -251,7 +250,6 @@ impl CustomZonedDateTime { /// /// ``` /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id}; - /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// /// let zoneddatetime = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Chicago][u-ca=hebrew]").unwrap(); @@ -297,7 +295,6 @@ impl CustomZonedDateTime { /// /// ``` /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; - /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// /// let tz_from_offset_annotation = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19[-05:00]").unwrap(); @@ -323,7 +320,6 @@ impl CustomZonedDateTime { /// /// ``` /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; - /// use icu_timezone::provider::MetazoneId; /// use tinystr::tinystr; /// /// let consistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Chicago]").unwrap(); diff --git a/components/timezone/src/lib.rs b/components/timezone/src/lib.rs index 9ac534b14b0..e83afea2d07 100644 --- a/components/timezone/src/lib.rs +++ b/components/timezone/src/lib.rs @@ -36,7 +36,7 @@ //! //! ## Zone Variant //! -//! Many metazones use different names and offsets in the summer than in the winter. In ICU4X, +//! Many zones use different names and offsets in the summer than in the winter. In ICU4X, //! this is called the _zone variant_. //! //! CLDR has two zone variants, named `"standard"` and `"daylight"`. However, the mapping of these @@ -46,17 +46,13 @@ //! Note: It is optional (not required) to set the zone variant when constructing a //! [`TimeZoneInfo`]. Therefore, the list of possible variants does not include a generic variant //! to represent the lack of a preference. -//! -//! # Examples //! -//! Create a time zone for which the offset and time zone ID are already known, and calculate -//! the metazone based on a certain local datetime: +//! # Examples //! //! ``` //! use icu::calendar::DateTime; //! use icu::timezone::TimeZoneInfo; //! use icu::timezone::UtcOffset; -//! use icu::timezone::MetazoneCalculator; //! use icu::timezone::TimeZoneBcp47Id; //! use icu::timezone::TimeZoneIdMapper; //! use tinystr::{tinystr, TinyAsciiStr}; From d1adf23c70e868e28a09ba769ddca22ad711420d Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 09:45:40 -0700 Subject: [PATCH 11/21] missing zone_variant, local_time error --- components/datetime/src/time_zone.rs | 122 +++++++++++++-------------- 1 file changed, 57 insertions(+), 65 deletions(-) diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index 19b6877fbd5..59aefd9ef5a 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -219,54 +219,43 @@ pub(crate) struct TimeZoneDataPayloadsBorrowed<'a> { } impl ExtractedInput { - fn zone_variant_or_guess( + fn zone_variant( &self, time_zone_id: TimeZoneBcp47Id, offset_period: &crate::provider::time_zones::ZoneOffsetPeriodV1, - ) -> ZoneVariant { + ) -> Option { if let Some(zv) = self.zone_variant { - return zv; + return Some(zv); } - let Some(offset) = self.offset else { - return ZoneVariant::standard(); - }; - - let dst_offset = { - match offset_period.0.get0(&time_zone_id) { - Some(cursor) => { - let offsets = if let Some((date, time)) = self.local_time { - let mut offsets = None; - let minutes_since_local_unix_epoch = - icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1_copied().rev() { - if minutes_since_local_unix_epoch - <= ::from_unaligned(*minutes) - { - offsets = Some(id); - } else { - break; - } - } - offsets.unwrap_or_default() // shouldn't happen - } else { - cursor - .iter1() - .map(|(_, v)| zerovec::ule::AsULE::from_unaligned(*v)) - .next_back() - .unwrap_or_default() // shouldn't happen - }; - (offsets.1 != 0) - .then_some(UtcOffset::from_eighths_of_hour(offsets.0 + offsets.1)) - } - None => None, + let offset = self.offset?; + let (date, time) = self.local_time?; + + let cursor = offset_period.0.get0(&time_zone_id)?; + let mut offsets = None; + let minutes_since_local_unix_epoch = + icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1_copied().rev() { + if minutes_since_local_unix_epoch + <= ::from_unaligned(*minutes) + { + offsets = Some(id); + } else { + break; } - }; + } + let offsets = offsets?; // shouldn't happen + + let std_offset = UtcOffset::from_eighths_of_hour(offsets.0); + let dst_offset = + (offsets.1 != 0).then_some(UtcOffset::from_eighths_of_hour(offsets.0 + offsets.1)); if Some(offset) == dst_offset { - ZoneVariant::daylight() + Some(ZoneVariant::daylight()) + } else if offset == std_offset { + Some(ZoneVariant::standard()) } else { - ZoneVariant::standard() + None } } @@ -274,29 +263,23 @@ impl ExtractedInput { &self, time_zone_id: TimeZoneBcp47Id, metazone_period: &crate::provider::time_zones::MetazonePeriodV1, - ) -> Option { - match metazone_period.0.get0(&time_zone_id) { - Some(cursor) => { - if let Some((date, time)) = self.local_time { - let mut metazone_id = None; - let minutes_since_local_unix_epoch = - icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1() { - if minutes_since_local_unix_epoch - >= ::from_unaligned(*minutes) - { - metazone_id = id.get() - } else { - break; - } - } - metazone_id - } else { - cursor.iter1().next_back().and_then(|(_, m)| m.get()) - } + ) -> Option> { + let (date, time) = self.local_time?; + + let cursor = metazone_period.0.get0(&time_zone_id)?; + let mut metazone_id = None; + let minutes_since_local_unix_epoch = + icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1() { + if minutes_since_local_unix_epoch + >= ::from_unaligned(*minutes) + { + metazone_id = id.get() + } else { + break; } - None => None, } + Some(metazone_id) } } @@ -439,7 +422,9 @@ impl FormatTimeZone for GenericNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let metazone_id = input.metazone(time_zone_id, metazone_period); + let Some(metazone_id) = input.metazone(time_zone_id, metazone_period) else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(name) = metazone_id.and_then(|mz| { names @@ -476,7 +461,9 @@ impl FormatTimeZone for SpecificNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let zone_variant = input.zone_variant_or_guess(time_zone_id, offset_period); + let Some(zone_variant) = input.zone_variant(time_zone_id, offset_period) else { + return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); + }; let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_specific_long.as_ref(), @@ -488,7 +475,9 @@ impl FormatTimeZone for SpecificNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let metazone_id = input.metazone(time_zone_id, metazone_period); + let Some(metazone_id) = input.metazone(time_zone_id, metazone_period) else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(name) = metazone_id.and_then(|mz| { names @@ -654,7 +643,9 @@ impl FormatTimeZone for SpecificLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let zone_variant = input.zone_variant_or_guess(time_zone_id, offset_period); + let Some(zone_variant) = input.zone_variant(time_zone_id, offset_period) else { + return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); + }; if let Some(location) = locations.locations.get(&time_zone_id) { if zone_variant == ZoneVariant::daylight() { @@ -703,8 +694,9 @@ impl FormatTimeZone for GenericPartialLocationFormat { let Some(metazone_period) = data_payloads.mz_periods else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - - let metazone_id = input.metazone(time_zone_id, metazone_period); + let Some(metazone_id) = input.metazone(time_zone_id, metazone_period) else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(location) = locations.locations.get(&time_zone_id) else { return Ok(Err(FormatTimeZoneError::Fallback)); From 8a073eab42b0d1bdd90aa91f13237fd8f48101ce Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 09:54:51 -0700 Subject: [PATCH 12/21] fix --- components/datetime/src/format/datetime.rs | 9 +++--- components/datetime/src/neo_marker.rs | 34 +++++++--------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/components/datetime/src/format/datetime.rs b/components/datetime/src/format/datetime.rs index c92e1227faf..06373dddd9a 100644 --- a/components/datetime/src/format/datetime.rs +++ b/components/datetime/src/format/datetime.rs @@ -12,7 +12,8 @@ use crate::input::ExtractedInput; use crate::pattern::runtime::PatternMetadata; use crate::pattern::PatternItem; use crate::time_zone::{ - FormatTimeZone, FormatTimeZoneError, Iso8601Format, IsoMinutes, ResolvedNeoTimeZoneSkeleton, + FormatTimeZone, FormatTimeZoneError, Iso8601Format, IsoFormat, IsoMinutes, IsoSeconds, + ResolvedNeoTimeZoneSkeleton, }; use core::fmt::{self, Write}; @@ -499,9 +500,9 @@ where if let Some(offset) = input.offset { w.with_part(Part::ERROR, |w| { Iso8601Format { - format: crate::time_zone::IsoFormat::Basic, + format: IsoFormat::Basic, minutes: IsoMinutes::Required, - seconds: crate::time_zone::IsoSeconds::Optional, + seconds: IsoSeconds::Optional, } .format_infallible(w, offset) })?; @@ -519,7 +520,7 @@ where }) } Err(FormatTimeZoneError::Fallback) => { - // fell through + // unreachable because our current fallback chains don't fall through w.with_part(Part::ERROR, |w| { w.write_str("{unsupported:")?; w.write_char(char::from(field.symbol))?; diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 8b671dbcb98..1802147c3b0 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -266,7 +266,7 @@ //! which falls back to the offset when unavailable (see [`NeoTimeZoneGenericMarker`]). //! //! ``` -//! use icu::calendar::DateTime; +//! use icu::calendar::{Date, Time}; //! use icu::timezone::{TimeZoneInfo, UtcOffset, TimeZoneIdMapper, TimeZoneBcp47Id}; //! use icu::datetime::neo::TypedNeoFormatter; //! use icu::datetime::neo_marker::NeoTimeZoneGenericMarker; @@ -279,14 +279,11 @@ //! // Set up the time zone. Note: the inputs here are //! // 1. The offset //! // 2. The IANA time zone ID -//! // 3. A datetime (for non-location name resolution) +//! // 3. A date and time (for non-location name resolution) //! // 4. Note: we do not need the zone variant because of `load_generic_*()` //! -//! // Set up the time zone ID mapper, -//! // and the DateTime to use in calculation +//! // Set up the time zone ID mapper //! let mapper = TimeZoneIdMapper::new(); -//! let datetime = DateTime::try_new_iso_datetime(2022, 8, 29, 0, 0, 0) -//! .unwrap(); //! //! // Set up the formatter //! let mut tzf = TypedNeoFormatter::<(), _>::try_new( @@ -299,19 +296,7 @@ //! let time_zone = TimeZoneInfo { //! time_zone_id: mapper.as_borrowed().iana_to_bcp47("America/Chicago"), //! offset: Some(UtcOffset::from_eighths_of_hour(-6 * 8)), -//! local_time: Some((datetime.date, datetime.time)), -//! ..TimeZoneInfo::unknown() -//! }; -//! assert_try_writeable_eq!( -//! tzf.format(&time_zone), -//! "CT" -//! ); -//! -//! // This is the latest non-location name for `uschi`, so we don't *have* -//! // to set the `local_time`. -//! let time_zone = TimeZoneInfo { -//! time_zone_id: mapper.as_borrowed().iana_to_bcp47("America/Chicago"), -//! offset: Some(UtcOffset::from_eighths_of_hour(-6 * 8)), +//! local_time: Some((Date::try_new_iso_date(2022, 8, 29).unwrap(), Time::midnight())), //! ..TimeZoneInfo::unknown() //! }; //! assert_try_writeable_eq!( @@ -323,7 +308,7 @@ //! let time_zone = TimeZoneInfo { //! time_zone_id: TimeZoneBcp47Id(tinystr!(8, "ushnl")), //! offset: Some(UtcOffset::from_eighths_of_hour(-10 * 8)), -//! local_time: Some((datetime.date, datetime.time)), +//! local_time: Some((Date::try_new_iso_date(2022, 8, 29).unwrap(), Time::midnight())), //! ..TimeZoneInfo::unknown() //! }; //! assert_try_writeable_eq!( @@ -2178,6 +2163,7 @@ macro_rules! impl_zone_marker { /// In [`NeoFormatter`](crate::neo::NeoFormatter): /// /// ``` + /// use icu::calendar::{Date, Time}; /// use icu::timezone::{TimeZoneBcp47Id, TimeZoneInfo, UtcOffset, ZoneVariant}; /// use icu::datetime::neo::NeoFormatter; #[doc = concat!("use icu::datetime::neo_marker::", stringify!($type), ";")] @@ -2197,7 +2183,7 @@ macro_rules! impl_zone_marker { /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), /// offset: Some(UtcOffset::from_eighths_of_hour(-5 * 8)), /// zone_variant: Some(ZoneVariant::daylight()), - /// ..TimeZoneInfo::unknown() + /// local_time: Some((Date::try_new_iso_date(2022, 8, 29).unwrap(), Time::midnight())), /// }; /// /// assert_try_writeable_eq!( @@ -2230,7 +2216,7 @@ macro_rules! impl_zone_marker { /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "uschi")), /// offset: Some(UtcOffset::from_eighths_of_hour(-5 * 8)), /// zone_variant: Some(ZoneVariant::daylight()), - /// ..TimeZoneInfo::unknown() + /// local_time: Some((Date::try_new_iso_date(2022, 8, 29).unwrap(), Time::midnight())), /// }; /// /// assert_try_writeable_eq!( @@ -2566,7 +2552,7 @@ impl_zone_marker!( /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "brsao")), /// offset: Some(UtcOffset::from_eighths_of_hour(-3 * 8)), /// zone_variant: Some(ZoneVariant::standard()), - /// ..TimeZoneInfo::unknown() + /// local_time: Some((Date::try_new_iso_date(2022, 8, 29).unwrap(), Time::midnight())), /// }; /// /// assert_try_writeable_eq!( @@ -2685,7 +2671,7 @@ impl_zone_marker!( /// time_zone_id: TimeZoneBcp47Id(tinystr!(8, "brsao")), /// offset: Some(UtcOffset::from_eighths_of_hour(-3 * 8)), /// zone_variant: Some(ZoneVariant::standard()), - /// ..TimeZoneInfo::unknown() + /// local_time: Some((Date::try_new_iso_date(2022, 8, 29).unwrap(), Time::midnight())), /// }; /// /// assert_try_writeable_eq!( From a84de8c0f6b78bc6c9f92a2e642bda8955cbfb37 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 11:29:48 -0700 Subject: [PATCH 13/21] check --- components/datetime/src/time_zone.rs | 131 ++++++++------------------- 1 file changed, 39 insertions(+), 92 deletions(-) diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index 59aefd9ef5a..239e23b582a 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -12,6 +12,7 @@ use crate::{ }; use core::fmt; use fixed_decimal::FixedDecimal; +use icu_calendar::{Date, Iso, Time}; use icu_decimal::FixedDecimalFormatter; use icu_timezone::{TimeZoneBcp47Id, UtcOffset, ZoneVariant}; use writeable::Writeable; @@ -218,69 +219,24 @@ pub(crate) struct TimeZoneDataPayloadsBorrowed<'a> { pub(crate) offsets: Option<&'a provider::time_zones::ZoneOffsetPeriodV1<'a>>, } -impl ExtractedInput { - fn zone_variant( - &self, - time_zone_id: TimeZoneBcp47Id, - offset_period: &crate::provider::time_zones::ZoneOffsetPeriodV1, - ) -> Option { - if let Some(zv) = self.zone_variant { - return Some(zv); - } - - let offset = self.offset?; - let (date, time) = self.local_time?; - - let cursor = offset_period.0.get0(&time_zone_id)?; - let mut offsets = None; - let minutes_since_local_unix_epoch = - icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1_copied().rev() { - if minutes_since_local_unix_epoch - <= ::from_unaligned(*minutes) - { - offsets = Some(id); - } else { - break; - } - } - let offsets = offsets?; // shouldn't happen - - let std_offset = UtcOffset::from_eighths_of_hour(offsets.0); - let dst_offset = - (offsets.1 != 0).then_some(UtcOffset::from_eighths_of_hour(offsets.0 + offsets.1)); - - if Some(offset) == dst_offset { - Some(ZoneVariant::daylight()) - } else if offset == std_offset { - Some(ZoneVariant::standard()) +fn metazone( + time_zone_id: TimeZoneBcp47Id, + (date, time): (Date, Time), + metazone_period: &crate::provider::time_zones::MetazonePeriodV1, +) -> Option { + let cursor = metazone_period.0.get0(&time_zone_id)?; + let mut metazone_id = None; + let minutes_since_local_unix_epoch = + icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1() { + if minutes_since_local_unix_epoch >= ::from_unaligned(*minutes) + { + metazone_id = id.get() } else { - None - } - } - - fn metazone( - &self, - time_zone_id: TimeZoneBcp47Id, - metazone_period: &crate::provider::time_zones::MetazonePeriodV1, - ) -> Option> { - let (date, time) = self.local_time?; - - let cursor = metazone_period.0.get0(&time_zone_id)?; - let mut metazone_id = None; - let minutes_since_local_unix_epoch = - icu_calendar::DateTime { date, time }.minutes_since_local_unix_epoch(); - for (minutes, id) in cursor.iter1() { - if minutes_since_local_unix_epoch - >= ::from_unaligned(*minutes) - { - metazone_id = id.get() - } else { - break; - } + break; } - Some(metazone_id) } + metazone_id } /// Determines which ISO-8601 format should be used to format the timezone offset. @@ -412,6 +368,9 @@ impl FormatTimeZone for GenericNonLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_generic_long.as_ref(), _ => data_payloads.mz_generic_short.as_ref(), @@ -422,11 +381,7 @@ impl FormatTimeZone for GenericNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let Some(metazone_id) = input.metazone(time_zone_id, metazone_period) else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; - - let Some(name) = metazone_id.and_then(|mz| { + let Some(name) = metazone(time_zone_id, local_time, metazone_period).and_then(|mz| { names .overrides .get(&time_zone_id) @@ -457,13 +412,12 @@ impl FormatTimeZone for SpecificNonLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let Some(offset_period) = data_payloads.offsets else { - return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); - }; - - let Some(zone_variant) = input.zone_variant(time_zone_id, offset_period) else { + let Some(zone_variant) = input.zone_variant else { return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); }; + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(names) = (match self.0 { FieldLength::Wide => data_payloads.mz_specific_long.as_ref(), @@ -475,11 +429,7 @@ impl FormatTimeZone for SpecificNonLocationFormat { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let Some(metazone_id) = input.metazone(time_zone_id, metazone_period) else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; - - let Some(name) = metazone_id.and_then(|mz| { + let Some(name) = metazone(time_zone_id, local_time, metazone_period).and_then(|mz| { names .overrides .get_2d(&time_zone_id, &zone_variant) @@ -636,17 +586,13 @@ impl FormatTimeZone for SpecificLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; - let Some(locations) = data_payloads.locations else { - return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); + let Some(zone_variant) = input.zone_variant else { + return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); }; - let Some(offset_period) = data_payloads.offsets else { + let Some(locations) = data_payloads.locations else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let Some(zone_variant) = input.zone_variant(time_zone_id, offset_period) else { - return Ok(Err(FormatTimeZoneError::MissingInputField("zone_variant"))); - }; - if let Some(location) = locations.locations.get(&time_zone_id) { if zone_variant == ZoneVariant::daylight() { &locations.pattern_daylight @@ -681,6 +627,9 @@ impl FormatTimeZone for GenericPartialLocationFormat { let Some(time_zone_id) = input.time_zone_id else { return Ok(Err(FormatTimeZoneError::MissingInputField("time_zone_id"))); }; + let Some(local_time) = input.local_time else { + return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); + }; let Some(locations) = data_payloads.locations else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); @@ -694,19 +643,17 @@ impl FormatTimeZone for GenericPartialLocationFormat { let Some(metazone_period) = data_payloads.mz_periods else { return Ok(Err(FormatTimeZoneError::MissingZoneSymbols)); }; - let Some(metazone_id) = input.metazone(time_zone_id, metazone_period) else { - return Ok(Err(FormatTimeZoneError::MissingInputField("local_time"))); - }; - let Some(location) = locations.locations.get(&time_zone_id) else { return Ok(Err(FormatTimeZoneError::Fallback)); }; - let Some(non_location) = metazone_id.and_then(|mz| { - non_locations - .overrides - .get(&time_zone_id) - .or_else(|| non_locations.defaults.get(&mz)) - }) else { + let Some(non_location) = + metazone(time_zone_id, local_time, metazone_period).and_then(|mz| { + non_locations + .overrides + .get(&time_zone_id) + .or_else(|| non_locations.defaults.get(&mz)) + }) + else { return Ok(Err(FormatTimeZoneError::Fallback)); }; From cd2629bf5fe31fd4cd5e3c1a92130575e1829893 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 11:47:32 -0700 Subject: [PATCH 14/21] and back --- components/datetime/src/format/neo.rs | 41 +----- components/datetime/src/input.rs | 3 +- components/datetime/src/neo.rs | 12 -- components/datetime/src/neo_marker.rs | 38 +----- components/datetime/src/provider/mod.rs | 2 - .../datetime/src/provider/time_zones.rs | 42 +----- components/datetime/src/time_zone.rs | 2 - components/timezone/src/lib.rs | 2 + components/timezone/src/provider.rs | 41 +++++- components/timezone/src/zone_offset.rs | 121 ++++++++++++++++++ provider/data/datetime/data/mod.rs | 3 - provider/data/datetime/fingerprints.csv | 1 - provider/data/datetime/stubdata/mod.rs | 3 - provider/data/timezone/data/mod.rs | 3 + .../data/zone_offset_period_v1_marker.rs.data | 20 +-- provider/data/timezone/fingerprints.csv | 1 + provider/data/timezone/stubdata/mod.rs | 3 + .../zone_offset_period_v1_marker.rs.data | 20 +-- provider/registry/src/lib.rs | 2 +- .../src/cldr_serde/time_zones/bcp47_tzid.rs | 2 +- provider/source/src/time_zones/convert.rs | 1 + provider/source/src/time_zones/mod.rs | 1 + 22 files changed, 201 insertions(+), 163 deletions(-) create mode 100644 components/timezone/src/zone_offset.rs rename provider/data/{datetime => timezone}/data/zone_offset_period_v1_marker.rs.data (96%) rename provider/data/{datetime => timezone}/stubdata/zone_offset_period_v1_marker.rs.data (96%) diff --git a/components/datetime/src/format/neo.rs b/components/datetime/src/format/neo.rs index ee1ad68d74c..b636b8433af 100644 --- a/components/datetime/src/format/neo.rs +++ b/components/datetime/src/format/neo.rs @@ -66,7 +66,6 @@ impl_holder_trait!(tz::MzGenericShortV1Marker); impl_holder_trait!(tz::MzSpecificLongV1Marker); impl_holder_trait!(tz::MzSpecificShortV1Marker); impl_holder_trait!(tz::MzPeriodV1Marker); -impl_holder_trait!(tz::OffsetsV1Marker); #[non_exhaustive] pub enum MaybePayloadError2 { @@ -420,7 +419,6 @@ pub trait DateTimeNamesMarker { type ZoneSpecificLong: DateTimeNamesHolderTrait; type ZoneSpecificShort: DateTimeNamesHolderTrait; type MetazoneLookup: DateTimeNamesHolderTrait; - type Offsets: DateTimeNamesHolderTrait; } #[derive(Debug)] @@ -438,7 +436,6 @@ impl DateTimeNamesMarker for DateMarker { type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; } #[derive(Debug)] @@ -456,7 +453,6 @@ impl DateTimeNamesMarker for TimeMarker { type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; } #[derive(Debug)] @@ -474,7 +470,6 @@ impl DateTimeNamesMarker for DateTimeMarker { type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; } #[derive(Debug)] @@ -492,7 +487,6 @@ impl DateTimeNamesMarker for ZonedDateTimeMarker { type ZoneSpecificLong = tz::MzSpecificLongV1Marker; type ZoneSpecificShort = tz::MzSpecificShortV1Marker; type MetazoneLookup = tz::MzPeriodV1Marker; - type Offsets = tz::OffsetsV1Marker; } impl From> for RawDateTimeNames { @@ -509,7 +503,6 @@ impl From> for RawDateTimeNames { mz_specific_long: (), mz_specific_short: (), mz_periods: (), - offsets: (), fixed_decimal_formatter: other.fixed_decimal_formatter, _marker: PhantomData, } @@ -530,7 +523,6 @@ impl From> for RawDateTimeNames { mz_specific_long: (), mz_specific_short: (), mz_periods: (), - offsets: (), fixed_decimal_formatter: other.fixed_decimal_formatter, _marker: PhantomData, } @@ -566,7 +558,6 @@ pub(crate) struct RawDateTimeNames { tz::MzSpecificShortV1Marker, >>::Container<()>, mz_periods: >::Container<()>, - offsets: >::Container<()>, // TODO(#4340): Make the FixedDecimalFormatter optional fixed_decimal_formatter: Option, _marker: PhantomData, @@ -604,7 +595,6 @@ pub(crate) struct RawDateTimeNamesBorrowed<'l> { mz_specific_long: OptionalNames<(), &'l tz::MzSpecificV1<'l>>, mz_specific_short: OptionalNames<(), &'l tz::MzSpecificV1<'l>>, mz_periods: OptionalNames<(), &'l tz::MzPeriodV1<'l>>, - offsets: OptionalNames<(), &'l tz::OffsetsV1<'l>>, pub(crate) fixed_decimal_formatter: Option<&'l FixedDecimalFormatter>, } @@ -1273,15 +1263,11 @@ impl TypedDateTimeNames { provider: &P, ) -> Result<&mut Self, SingleLoadError> where - P: DataProvider - + DataProvider - + DataProvider - + ?Sized, + P: DataProvider + DataProvider + ?Sized, { self.inner.load_time_zone_specific_long_names( &tz::MzSpecificLongV1Marker::bind(provider), &tz::MzPeriodV1Marker::bind(provider), - &tz::OffsetsV1Marker::bind(provider), &self.locale, )?; Ok(self) @@ -1353,15 +1339,11 @@ impl TypedDateTimeNames { provider: &P, ) -> Result<&mut Self, SingleLoadError> where - P: DataProvider - + DataProvider - + DataProvider - + ?Sized, + P: DataProvider + DataProvider + ?Sized, { self.inner.load_time_zone_specific_short_names( &tz::MzSpecificShortV1Marker::bind(provider), &tz::MzPeriodV1Marker::bind(provider), - &tz::OffsetsV1Marker::bind(provider), &self.locale, )?; Ok(self) @@ -1509,7 +1491,6 @@ impl TypedDateTimeNames { + DataProvider + DataProvider + DataProvider - + DataProvider + DataProvider + ?Sized, { @@ -1527,7 +1508,6 @@ impl TypedDateTimeNames { &tz::MzSpecificLongV1Marker::bind(provider), &tz::MzSpecificShortV1Marker::bind(provider), &tz::MzPeriodV1Marker::bind(provider), - &tz::OffsetsV1Marker::bind(provider), &ExternalLoaderUnstable(provider), locale, pattern @@ -1601,7 +1581,6 @@ impl TypedDateTimeNames { &tz::MzSpecificLongV1Marker::bind(&crate::provider::Baked), &tz::MzSpecificShortV1Marker::bind(&crate::provider::Baked), &tz::MzPeriodV1Marker::bind(&crate::provider::Baked), - &tz::OffsetsV1Marker::bind(&crate::provider::Baked), &ExternalLoaderCompiledData, locale, pattern @@ -1685,7 +1664,6 @@ impl RawDateTimeNames { mz_specific_long: >::Container::<_>::new_empty(), mz_specific_short: >::Container::<_>::new_empty(), mz_periods: >::Container::<_>::new_empty(), - offsets: >::Container::<_>::new_empty(), fixed_decimal_formatter: None, _marker: PhantomData, } @@ -1704,7 +1682,6 @@ impl RawDateTimeNames { mz_specific_long: self.mz_specific_long.get().inner, mz_specific_short: self.mz_specific_short.get().inner, mz_periods: self.mz_periods.get().inner, - offsets: self.offsets.get().inner, fixed_decimal_formatter: self.fixed_decimal_formatter.as_ref(), } } @@ -1981,7 +1958,6 @@ impl RawDateTimeNames { &mut self, mz_specific_long_provider: &(impl BoundDataProvider + ?Sized), mz_period_provider: &(impl BoundDataProvider + ?Sized), - offsets_provider: &(impl BoundDataProvider + ?Sized), locale: &DataLocale, ) -> Result<(), SingleLoadError> { let field = fields::Field { @@ -2001,10 +1977,6 @@ impl RawDateTimeNames { .load_put(mz_period_provider, Default::default(), variables) .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? .map_err(SingleLoadError::Data)?; - self.offsets - .load_put(offsets_provider, Default::default(), variables) - .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? - .map_err(SingleLoadError::Data)?; Ok(()) } @@ -2012,7 +1984,6 @@ impl RawDateTimeNames { &mut self, mz_specific_short_provider: &(impl BoundDataProvider + ?Sized), mz_period_provider: &(impl BoundDataProvider + ?Sized), - offsets_provider: &(impl BoundDataProvider + ?Sized), locale: &DataLocale, ) -> Result<(), SingleLoadError> { let field = fields::Field { @@ -2032,10 +2003,6 @@ impl RawDateTimeNames { .load_put(mz_period_provider, Default::default(), variables) .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? .map_err(SingleLoadError::Data)?; - self.offsets - .load_put(offsets_provider, Default::default(), variables) - .map_err(|e| MaybePayloadError2::into_single_load_error(e, field))? - .map_err(SingleLoadError::Data)?; Ok(()) } @@ -2085,7 +2052,6 @@ impl RawDateTimeNames { mz_specific_long_provider: &(impl BoundDataProvider + ?Sized), mz_specific_short_provider: &(impl BoundDataProvider + ?Sized), mz_period_provider: &(impl BoundDataProvider + ?Sized), - offsets_provider: &(impl BoundDataProvider + ?Sized), fixed_decimal_formatter_loader: &impl FixedDecimalFormatterLoader, locale: &DataLocale, pattern_items: impl Iterator, @@ -2122,7 +2088,6 @@ impl RawDateTimeNames { self.load_time_zone_specific_short_names( mz_specific_short_provider, mz_period_provider, - offsets_provider, locale, )?; } @@ -2137,7 +2102,6 @@ impl RawDateTimeNames { self.load_time_zone_specific_long_names( mz_specific_long_provider, mz_period_provider, - offsets_provider, locale, )?; } @@ -2661,7 +2625,6 @@ impl<'data> RawDateTimeNamesBorrowed<'data> { mz_specific_long: self.mz_specific_long.get_option(), mz_specific_short: self.mz_specific_short.get_option(), mz_periods: self.mz_periods.get_option(), - offsets: self.offsets.get_option(), } } } diff --git a/components/datetime/src/input.rs b/components/datetime/src/input.rs index f9fc7cb951f..a81029c429f 100644 --- a/components/datetime/src/input.rs +++ b/components/datetime/src/input.rs @@ -6,10 +6,9 @@ //! formatting operations. use crate::neo_marker::{DateInputMarkers, GetField, TimeMarkers, ZoneMarkers}; -use crate::provider::time_zones::TimeZoneBcp47Id; use icu_calendar::any_calendar::AnyCalendarKind; use icu_calendar::{Date, Iso, Time}; -use icu_timezone::{UtcOffset, ZoneVariant}; +use icu_timezone::{TimeZoneBcp47Id, UtcOffset, ZoneVariant}; // TODO(#2630) fix up imports to directly import from icu_calendar pub(crate) use icu_calendar::types::{ diff --git a/components/datetime/src/neo.rs b/components/datetime/src/neo.rs index 946caaf36c6..3e9d763e792 100644 --- a/components/datetime/src/neo.rs +++ b/components/datetime/src/neo.rs @@ -223,7 +223,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, { Self::try_new_internal( @@ -266,7 +265,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // FixedDecimalFormatter markers + DataProvider, @@ -426,7 +424,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, { Self::try_new_internal( @@ -469,7 +466,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // FixedDecimalFormatter markers + DataProvider, @@ -513,7 +509,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, L: FixedDecimalFormatterLoader, { @@ -547,7 +542,6 @@ where &::SpecificLongV1Marker::bind(provider), &::SpecificShortV1Marker::bind(provider), &::MetazonePeriodV1Marker::bind(provider), - &::ZoneOffsetPeriodV1Marker::bind(provider), loader, // fixed decimal formatter locale, selection.pattern_items_for_data_loading(), @@ -767,7 +761,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, { Self::try_new_internal( @@ -858,7 +851,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // AnyCalendar constructor markers + DataProvider @@ -1071,7 +1063,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider { Self::try_new_internal( @@ -1162,7 +1153,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider // AnyCalendar constructor markers + DataProvider @@ -1261,7 +1251,6 @@ where + DataProvider<::SpecificLongV1Marker> + DataProvider<::SpecificShortV1Marker> + DataProvider<::MetazonePeriodV1Marker> - + DataProvider<::ZoneOffsetPeriodV1Marker> + DataProvider, L: FixedDecimalFormatterLoader + AnyCalendarLoader, { @@ -1297,7 +1286,6 @@ where &::SpecificLongV1Marker::bind(provider), &::SpecificShortV1Marker::bind(provider), &::MetazonePeriodV1Marker::bind(provider), - &::ZoneOffsetPeriodV1Marker::bind(provider), loader, // fixed decimal formatter locale, selection.pattern_items_for_data_loading(), diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 1802147c3b0..672dd613b82 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -1047,18 +1047,16 @@ pub trait ZoneMarkers: private::Sealed { type EssentialsV1Marker: DataMarker>; /// Marker for loading location names for time zone formatting type LocationsV1Marker: DataMarker>; - /// Marker for loading generic short time zone names. + /// Marker for loading generic long time zone names. type GenericLongV1Marker: DataMarker>; /// Marker for loading generic short time zone names. type GenericShortV1Marker: DataMarker>; - /// Marker for loading generic short time zone names. + /// Marker for loading specific long time zone names. type SpecificLongV1Marker: DataMarker>; /// Marker for loading generic short time zone names. type SpecificShortV1Marker: DataMarker>; - /// Marker for loading generic short time zone names. + /// Marker for loading metazone periods. type MetazonePeriodV1Marker: DataMarker>; - /// for loading generic short time zone names. - type ZoneOffsetPeriodV1Marker: DataMarker>; } /// A trait associating constants and types implementing various other traits @@ -1182,7 +1180,6 @@ impl ZoneMarkers for NeoNeverMarker { type SpecificLongV1Marker = NeverMarker>; type SpecificShortV1Marker = NeverMarker>; type MetazonePeriodV1Marker = NeverMarker>; - type ZoneOffsetPeriodV1Marker = NeverMarker>; } /// A struct that supports formatting both a date and a time. @@ -1242,7 +1239,6 @@ where type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1281,7 +1277,6 @@ where type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1320,7 +1315,6 @@ where type ZoneSpecificLong = Z::ZoneSpecificLong; type ZoneSpecificShort = Z::ZoneSpecificShort; type MetazoneLookup = Z::MetazoneLookup; - type Offsets = Z::Offsets; } impl HasConstComponents for DateTimeCombo @@ -1360,7 +1354,6 @@ where type ZoneSpecificLong = NeverMarker<()>; type ZoneSpecificShort = NeverMarker<()>; type MetazoneLookup = NeverMarker<()>; - type Offsets = NeverMarker<()>; } impl HasConstComponents for DateTimeCombo @@ -1403,7 +1396,6 @@ where type ZoneSpecificLong = Z::ZoneSpecificLong; type ZoneSpecificShort = Z::ZoneSpecificShort; type MetazoneLookup = Z::MetazoneLookup; - type Offsets = Z::Offsets; } impl HasConstComponents for DateTimeCombo @@ -1573,9 +1565,6 @@ macro_rules! datetime_marker_helper { (@data/zone/metazone_periods, yes) => { tz::MzPeriodV1Marker }; - (@data/zone/offsets, yes) => { - tz::OffsetsV1Marker - }; (@data/zone/essentials,) => { NeverMarker> }; @@ -1597,9 +1586,6 @@ macro_rules! datetime_marker_helper { (@data/zone/metazone_periods,) => { NeverMarker> }; - (@data/zone/offsets,) => { - NeverMarker> - }; (@names/year, yes) => { YearNamesV1Marker }; @@ -1633,9 +1619,6 @@ macro_rules! datetime_marker_helper { (@names/zone/metazone_periods, yes) => { tz::MzPeriodV1Marker }; - (@names/zone/offsets, yes) => { - tz::OffsetsV1Marker - }; (@names/$any:ident,) => { NeverMarker<()> }; @@ -1863,7 +1846,6 @@ macro_rules! impl_date_or_calendar_period_marker { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); - type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateInputMarkers for $type { type YearInput = datetime_marker_helper!(@input/year, $($year_yes)?); @@ -2089,7 +2071,6 @@ macro_rules! impl_time_marker { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); - type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl HasConstTimeComponents for $type { const COMPONENTS: NeoTimeComponents = $components; @@ -2152,8 +2133,6 @@ macro_rules! impl_zone_marker { $(zone_specific_short = $zone_specific_short_yes:ident,)? // Whether metazone periods are needed $(metazone_periods = $metazone_periods_yes:ident,)? - // Whether metazone offests are needed - $(offsets = $offsets_yes:ident,)? ) => { impl_marker_with_options!( #[doc = concat!("**“", $sample, "**” ⇒ ", $description)] @@ -2241,7 +2220,6 @@ macro_rules! impl_zone_marker { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long, $($zone_specific_long_yes)?); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short, $($zone_specific_short_yes)?); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods, $($metazone_periods_yes)?); - type Offsets = datetime_marker_helper!(@names/zone/offsets, $($offsets_yes)?); } impl HasConstZoneComponent for $type { const COMPONENT: NeoTimeZoneStyle = $components; @@ -2258,7 +2236,6 @@ macro_rules! impl_zone_marker { type SpecificLongV1Marker = datetime_marker_helper!(@data/zone/specific_long, $($zone_specific_long_yes)?); type SpecificShortV1Marker = datetime_marker_helper!(@data/zone/specific_short, $($zone_specific_short_yes)?); type MetazonePeriodV1Marker = datetime_marker_helper!(@data/zone/metazone_periods, $($metazone_periods_yes)?); - type ZoneOffsetPeriodV1Marker = datetime_marker_helper!(@data/zone/offsets, $($offsets_yes)?); } impl DateTimeMarkers for $type { type D = NeoNeverMarker; @@ -2569,7 +2546,6 @@ impl_zone_marker!( zone_specific_long = yes, zone_specific_short = yes, metazone_periods = yes, - offsets = yes, ); impl_zone_marker!( @@ -2634,7 +2610,6 @@ impl_zone_marker!( zone_essentials = yes, zone_specific_short = yes, metazone_periods = yes, - offsets = yes, ); impl_zone_marker!( @@ -2802,7 +2777,6 @@ impl DateTimeNamesMarker for NeoDateSkeleton { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); - type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateInputMarkers for NeoDateSkeleton { @@ -2865,7 +2839,6 @@ impl DateTimeNamesMarker for NeoCalendarPeriodSkeleton { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); - type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateInputMarkers for NeoCalendarPeriodSkeleton { @@ -2928,7 +2901,6 @@ impl DateTimeNamesMarker for NeoTimeSkeleton { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); - type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl TimeMarkers for NeoTimeSkeleton { @@ -2978,7 +2950,6 @@ impl DateTimeNamesMarker for NeoTimeZoneSkeleton { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long, yes); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short, yes); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods, yes); - type Offsets = datetime_marker_helper!(@names/zone/offsets, yes); } impl ZoneMarkers for NeoTimeZoneSkeleton { @@ -2993,7 +2964,6 @@ impl ZoneMarkers for NeoTimeZoneSkeleton { type SpecificLongV1Marker = datetime_marker_helper!(@data/zone/specific_long, yes); type SpecificShortV1Marker = datetime_marker_helper!(@data/zone/specific_short, yes); type MetazonePeriodV1Marker = datetime_marker_helper!(@data/zone/metazone_periods, yes); - type ZoneOffsetPeriodV1Marker = datetime_marker_helper!(@data/zone/offsets, yes); } impl DateTimeMarkers for NeoTimeZoneSkeleton { @@ -3032,7 +3002,6 @@ impl DateTimeNamesMarker for NeoDateTimeSkeleton { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long,); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short,); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods,); - type Offsets = datetime_marker_helper!(@names/zone/offsets,); } impl DateTimeMarkers for NeoDateTimeSkeleton { @@ -3074,7 +3043,6 @@ impl DateTimeNamesMarker for NeoSkeleton { type ZoneSpecificLong = datetime_marker_helper!(@names/zone/specific_long, yes); type ZoneSpecificShort = datetime_marker_helper!(@names/zone/specific_short, yes); type MetazoneLookup = datetime_marker_helper!(@names/zone/metazone_periods, yes); - type Offsets = datetime_marker_helper!(@names/zone/offsets, yes); } impl DateTimeMarkers for NeoSkeleton { diff --git a/components/datetime/src/provider/mod.rs b/components/datetime/src/provider/mod.rs index 0004daf25ec..dfd055ebd5c 100644 --- a/components/datetime/src/provider/mod.rs +++ b/components/datetime/src/provider/mod.rs @@ -53,7 +53,6 @@ const _: () = { impl_metazone_specific_names_long_v1_marker!(Baked); impl_metazone_specific_names_short_v1_marker!(Baked); impl_time_zone_essentials_v1_marker!(Baked); - impl_zone_offset_period_v1_marker!(Baked); impl_weekday_names_v1_marker!(Baked); impl_day_period_names_v1_marker!(Baked); @@ -116,7 +115,6 @@ pub const MARKERS: &[DataMarkerInfo] = &[ time_zones::MetazoneSpecificNamesLongV1Marker::INFO, time_zones::MetazoneSpecificNamesShortV1Marker::INFO, time_zones::TimeZoneEssentialsV1Marker::INFO, - time_zones::ZoneOffsetPeriodV1Marker::INFO, neo::WeekdayNamesV1Marker::INFO, neo::DayPeriodNamesV1Marker::INFO, neo::GluePatternV1Marker::INFO, diff --git a/components/datetime/src/provider/time_zones.rs b/components/datetime/src/provider/time_zones.rs index a5314e861bf..df527229395 100644 --- a/components/datetime/src/provider/time_zones.rs +++ b/components/datetime/src/provider/time_zones.rs @@ -13,8 +13,7 @@ use zerovec::{ ZeroMap, ZeroMap2d, ZeroSlice, ZeroVec, }; -pub use icu_timezone::provider::TimeZoneBcp47Id; -use icu_timezone::ZoneVariant; +use icu_timezone::{provider::IsoMinutesSinceEpoch, TimeZoneBcp47Id, ZoneVariant}; /// Time zone type aliases for cleaner code pub(crate) mod tz { @@ -30,8 +29,6 @@ pub(crate) mod tz { pub(crate) use super::MetazoneSpecificNamesV1 as MzSpecificV1; pub(crate) use super::TimeZoneEssentialsV1 as EssentialsV1; pub(crate) use super::TimeZoneEssentialsV1Marker as EssentialsV1Marker; - pub(crate) use super::ZoneOffsetPeriodV1 as OffsetsV1; - pub(crate) use super::ZoneOffsetPeriodV1Marker as OffsetsV1Marker; } /// An ICU4X mapping to the CLDR timeZoneNames format strings. @@ -238,40 +235,3 @@ pub struct MetazonePeriodV1<'data>( #[cfg_attr(feature = "serde", serde(borrow))] pub ZeroMap2d<'data, TimeZoneBcp47Id, IsoMinutesSinceEpoch, Option>, ); - -/// Storage type for storing UTC offsets as eights of an hour. -pub type EighthsOfHourOffset = i8; -/// Storage type for storing `DateTime` as minutes since the UNIX epoch. -pub type IsoMinutesSinceEpoch = i32; - -/// An ICU4X mapping to the time zone offsets at a given period. -/// -///

-/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, -/// including in SemVer minor releases. While the serde representation of data structs is guaranteed -/// to be stable, their Rust representation might not be. Use with caution. -///
-#[icu_provider::data_struct(marker( - ZoneOffsetPeriodV1Marker, - "time_zone/offset_period@1", - singleton -))] -#[derive(PartialEq, Debug, Clone, Default)] -#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] -#[cfg_attr(feature = "datagen", databake(path = icu_datetime::provider::time_zones))] -#[cfg_attr(feature = "serde", derive(serde::Deserialize))] -#[yoke(prove_covariance_manually)] -pub struct ZoneOffsetPeriodV1<'data>( - /// The default mapping between period and offsets. The second level key is a wall-clock time represented as - /// the number of minutes since the local unix epoch. It represents when the offsets ended to be used. - /// - /// The values are the standard offset, and the daylight offset *relative to the standard offset*. As such, - /// if the second value is 0, there is no daylight time. - #[cfg_attr(feature = "serde", serde(borrow))] - pub ZeroMap2d< - 'data, - TimeZoneBcp47Id, - IsoMinutesSinceEpoch, - (EighthsOfHourOffset, EighthsOfHourOffset), - >, -); diff --git a/components/datetime/src/time_zone.rs b/components/datetime/src/time_zone.rs index 239e23b582a..fa7de4532b4 100644 --- a/components/datetime/src/time_zone.rs +++ b/components/datetime/src/time_zone.rs @@ -215,8 +215,6 @@ pub(crate) struct TimeZoneDataPayloadsBorrowed<'a> { pub(crate) mz_specific_short: Option<&'a provider::time_zones::MetazoneSpecificNamesV1<'a>>, /// The metazone lookup pub(crate) mz_periods: Option<&'a provider::time_zones::MetazonePeriodV1<'a>>, - /// The zone offset lookup - pub(crate) offsets: Option<&'a provider::time_zones::ZoneOffsetPeriodV1<'a>>, } fn metazone( diff --git a/components/timezone/src/lib.rs b/components/timezone/src/lib.rs index e83afea2d07..96278e166cc 100644 --- a/components/timezone/src/lib.rs +++ b/components/timezone/src/lib.rs @@ -93,6 +93,7 @@ pub mod provider; mod time_zone; mod types; mod windows_tz; +mod zone_offset; mod zoned_datetime; #[cfg(all(feature = "ixdtf", feature = "compiled_data"))] @@ -107,6 +108,7 @@ pub use provider::TimeZoneBcp47Id; pub use time_zone::TimeZoneInfo; pub use types::{UtcOffset, ZoneVariant}; pub use windows_tz::{WindowsTimeZoneMapper, WindowsTimeZoneMapperBorrowed}; +pub use zone_offset::ZoneOffsetCalculator; pub use zoned_datetime::CustomZonedDateTime; #[cfg(all(feature = "ixdtf", feature = "compiled_data"))] diff --git a/components/timezone/src/provider.rs b/components/timezone/src/provider.rs index c023d0ef6a6..fbe55399704 100644 --- a/components/timezone/src/provider.rs +++ b/components/timezone/src/provider.rs @@ -19,7 +19,7 @@ use core::ops::Deref; use icu_provider::prelude::*; use tinystr::TinyAsciiStr; use zerovec::ule::{AsULE, ULE}; -use zerovec::{ZeroSlice, ZeroVec}; +use zerovec::{ZeroMap2d, ZeroSlice, ZeroVec}; pub mod names; pub mod windows; @@ -46,6 +46,7 @@ const _: () = { impl_bcp47_to_iana_map_v1_marker!(Baked); impl_iana_to_bcp47_map_v3_marker!(Baked); impl_windows_zones_to_bcp47_map_v1_marker!(Baked); + impl_zone_offset_period_v1_marker!(Baked); }; #[cfg(feature = "datagen")] @@ -54,6 +55,7 @@ pub const MARKERS: &[DataMarkerInfo] = &[ names::Bcp47ToIanaMapV1Marker::INFO, names::IanaToBcp47MapV3Marker::INFO, windows::WindowsZonesToBcp47MapV1Marker::INFO, + ZoneOffsetPeriodV1Marker::INFO, ]; /// TimeZone ID in BCP47 format @@ -108,3 +110,40 @@ impl<'a> zerovec::maps::ZeroMapKV<'a> for TimeZoneBcp47Id { type GetType = TimeZoneBcp47Id; type OwnedType = TimeZoneBcp47Id; } + +/// Storage type for storing UTC offsets as eights of an hour. +pub type EighthsOfHourOffset = i8; +/// Storage type for storing `DateTime` as minutes since the UNIX epoch. +pub type IsoMinutesSinceEpoch = i32; + +/// An ICU4X mapping to the time zone offsets at a given period. +/// +///
+/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways, +/// including in SemVer minor releases. While the serde representation of data structs is guaranteed +/// to be stable, their Rust representation might not be. Use with caution. +///
+#[icu_provider::data_struct(marker( + ZoneOffsetPeriodV1Marker, + "time_zone/offset_period@1", + singleton +))] +#[derive(PartialEq, Debug, Clone, Default)] +#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))] +#[cfg_attr(feature = "datagen", databake(path = icu_timezone::provider))] +#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +#[yoke(prove_covariance_manually)] +pub struct ZoneOffsetPeriodV1<'data>( + /// The default mapping between period and offsets. The second level key is a wall-clock time represented as + /// the number of minutes since the local unix epoch. It represents when the offsets ended to be used. + /// + /// The values are the standard offset, and the daylight offset *relative to the standard offset*. As such, + /// if the second value is 0, there is no daylight time. + #[cfg_attr(feature = "serde", serde(borrow))] + pub ZeroMap2d< + 'data, + TimeZoneBcp47Id, + IsoMinutesSinceEpoch, + (EighthsOfHourOffset, EighthsOfHourOffset), + >, +); diff --git a/components/timezone/src/zone_offset.rs b/components/timezone/src/zone_offset.rs new file mode 100644 index 00000000000..47a027446b1 --- /dev/null +++ b/components/timezone/src/zone_offset.rs @@ -0,0 +1,121 @@ +// 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::ZoneOffsetPeriodV1Marker; +use crate::{TimeZoneBcp47Id, UtcOffset}; +use icu_calendar::DateTime; +use icu_calendar::Iso; +use icu_provider::prelude::*; + +/// [`ZoneOffsetCalculator`] uses data from the [data provider] to calculate time zone offsets. +/// +/// [data provider]: icu_provider +#[derive(Debug)] +pub struct ZoneOffsetCalculator { + pub(super) offset_period: DataPayload, +} + +#[cfg(feature = "compiled_data")] +impl Default for ZoneOffsetCalculator { + fn default() -> Self { + Self::new() + } +} + +impl ZoneOffsetCalculator { + /// Constructs a `ZoneOffsetCalculator` using compiled data. + /// + /// ✨ *Enabled with the `compiled_data` Cargo feature.* + /// + /// [📚 Help choosing a constructor](icu_provider::constructors) + #[cfg(feature = "compiled_data")] + #[inline] + pub const fn new() -> Self { + ZoneOffsetCalculator { + offset_period: DataPayload::from_static_ref( + crate::provider::Baked::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER, + ), + } + } + + icu_provider::gen_any_buffer_data_constructors!(() -> error: DataError, + functions: [ + new: skip, + try_new_with_any_provider, + try_new_with_buffer_provider, + try_new_unstable, + Self, + ] + ); + + #[doc = icu_provider::gen_any_buffer_unstable_docs!(UNSTABLE, Self::new)] + pub fn try_new_unstable( + provider: &(impl DataProvider + ?Sized), + ) -> Result { + let metazone_period = provider.load(Default::default())?.payload; + Ok(Self { + offset_period: metazone_period, + }) + } + + /// Calculate zone offsets from timezone and local datetime. + /// + /// # Examples + /// + /// ``` + /// use icu::calendar::DateTime; + /// use icu::timezone::TimeZoneBcp47Id; + /// use icu::timezone::ZoneOffsetCalculator; + /// use icu::timezone::UtcOffset; + /// use tinystr::tinystr; + /// + /// let zoc = ZoneOffsetCalculator::new(); + /// + /// // America/Denver observes DST + /// assert_eq!( + /// zoc.compute_offsets_from_time_zone( + /// TimeZoneBcp47Id(tinystr!(8, "usden")), + /// &DateTime::try_new_iso_datetime(2024, 1, 1, 0, 0, 0).unwrap() + /// ), + /// Some((UtcOffset::try_from_seconds(-7 * 3600).unwrap(), Some(UtcOffset::try_from_seconds(-6 * 3600).unwrap()))) + /// ); + /// + /// // America/Phoenix does not + /// assert_eq!( + /// zoc.compute_offsets_from_time_zone( + /// TimeZoneBcp47Id(tinystr!(8, "usphx")), + /// &DateTime::try_new_iso_datetime(2024, 1, 1, 0, 0, 0).unwrap() + /// ), + /// Some((UtcOffset::try_from_seconds(-7 * 3600).unwrap(), None)) + /// ); + /// ``` + pub fn compute_offsets_from_time_zone( + &self, + time_zone_id: TimeZoneBcp47Id, + local_datetime: &DateTime, + ) -> Option<(UtcOffset, Option)> { + use zerovec::ule::AsULE; + match self.offset_period.get().0.get0(&time_zone_id) { + Some(cursor) => { + let mut offsets = None; + let minutes_since_local_unix_epoch = + local_datetime.minutes_since_local_unix_epoch(); + for (minutes, id) in cursor.iter1_copied().rev() { + if minutes_since_local_unix_epoch <= i32::from_unaligned(*minutes) { + offsets = Some(id); + } else { + break; + } + } + let offsets = offsets?; + Some(( + UtcOffset::from_eighths_of_hour(offsets.0), + (offsets.1 != 0) + .then_some(UtcOffset::from_eighths_of_hour(offsets.0 + offsets.1)), + )) + } + None => None, + } + } +} diff --git a/provider/data/datetime/data/mod.rs b/provider/data/datetime/data/mod.rs index 1a0d38444ba..a63daa29b0e 100644 --- a/provider/data/datetime/data/mod.rs +++ b/provider/data/datetime/data/mod.rs @@ -47,7 +47,6 @@ include!("metazone_generic_names_long_v1_marker.rs.data"); include!("metazone_generic_names_short_v1_marker.rs.data"); include!("locations_v1_marker.rs.data"); include!("metazone_period_v1_marker.rs.data"); -include!("zone_offset_period_v1_marker.rs.data"); include!("metazone_specific_names_long_v1_marker.rs.data"); include!("metazone_specific_names_short_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like @@ -127,7 +126,6 @@ macro_rules! impl_data_provider { impl_metazone_generic_names_short_v1_marker!($provider); impl_locations_v1_marker!($provider); impl_metazone_period_v1_marker!($provider); - impl_zone_offset_period_v1_marker!($provider); impl_metazone_specific_names_long_v1_marker!($provider); impl_metazone_specific_names_short_v1_marker!($provider); }; @@ -187,7 +185,6 @@ macro_rules! impl_any_provider { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), - h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), diff --git a/provider/data/datetime/fingerprints.csv b/provider/data/datetime/fingerprints.csv index c0828cc9a4e..5147b8c38a9 100644 --- a/provider/data/datetime/fingerprints.csv +++ b/provider/data/datetime/fingerprints.csv @@ -35815,7 +35815,6 @@ time_zone/locations@1, zh-MO, -> zh-HK time_zone/locations@1, zh-SG, 9247B, 9088B, dbf3a8f8eb62d828 time_zone/locations@1, zu, 9086B, 8927B, cebb6ba6c35f2d98 time_zone/metazone_period@1, , 11097B, 11009B, dcfa50fb39ebd549 -time_zone/offset_period@1, , 13374B, 13286B, 397b18d3f2345411 time_zone/specific_long@1, , 948B, 190 identifiers time_zone/specific_long@1, , 1638778B, 1605415B, 185 unique payloads time_zone/specific_long@1, af, 6872B, 6692B, 92b73e3a6b592d73 diff --git a/provider/data/datetime/stubdata/mod.rs b/provider/data/datetime/stubdata/mod.rs index 1a0d38444ba..a63daa29b0e 100644 --- a/provider/data/datetime/stubdata/mod.rs +++ b/provider/data/datetime/stubdata/mod.rs @@ -47,7 +47,6 @@ include!("metazone_generic_names_long_v1_marker.rs.data"); include!("metazone_generic_names_short_v1_marker.rs.data"); include!("locations_v1_marker.rs.data"); include!("metazone_period_v1_marker.rs.data"); -include!("zone_offset_period_v1_marker.rs.data"); include!("metazone_specific_names_long_v1_marker.rs.data"); include!("metazone_specific_names_short_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like @@ -127,7 +126,6 @@ macro_rules! impl_data_provider { impl_metazone_generic_names_short_v1_marker!($provider); impl_locations_v1_marker!($provider); impl_metazone_period_v1_marker!($provider); - impl_zone_offset_period_v1_marker!($provider); impl_metazone_specific_names_long_v1_marker!($provider); impl_metazone_specific_names_short_v1_marker!($provider); }; @@ -187,7 +185,6 @@ macro_rules! impl_any_provider { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), - h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), diff --git a/provider/data/timezone/data/mod.rs b/provider/data/timezone/data/mod.rs index e531c05f9f9..2dbedfe9041 100644 --- a/provider/data/timezone/data/mod.rs +++ b/provider/data/timezone/data/mod.rs @@ -1,6 +1,7 @@ // @generated include!("bcp47_to_iana_map_v1_marker.rs.data"); include!("iana_to_bcp47_map_v3_marker.rs.data"); +include!("zone_offset_period_v1_marker.rs.data"); include!("windows_zones_to_bcp47_map_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like /// `impl_core_helloworld_v1` to add implementations. @@ -33,6 +34,7 @@ macro_rules! impl_data_provider { make_provider!($provider); impl_bcp47_to_iana_map_v1_marker!($provider); impl_iana_to_bcp47_map_v3_marker!($provider); + impl_zone_offset_period_v1_marker!($provider); impl_windows_zones_to_bcp47_map_v1_marker!($provider); }; } @@ -45,6 +47,7 @@ macro_rules! impl_any_provider { match marker.path.hashed() { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), } diff --git a/provider/data/datetime/data/zone_offset_period_v1_marker.rs.data b/provider/data/timezone/data/zone_offset_period_v1_marker.rs.data similarity index 96% rename from provider/data/datetime/data/zone_offset_period_v1_marker.rs.data rename to provider/data/timezone/data/zone_offset_period_v1_marker.rs.data index 8331ffe3ff6..b17a8cd029c 100644 --- a/provider/data/datetime/data/zone_offset_period_v1_marker.rs.data +++ b/provider/data/timezone/data/zone_offset_period_v1_marker.rs.data @@ -16,18 +16,18 @@ macro_rules! __impl_zone_offset_period_v1_marker { #[clippy::msrv = "1.71.1"] impl $provider { #[doc(hidden)] - pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::datetime::provider::time_zones::ZoneOffsetPeriodV1(unsafe { + pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::timezone::provider::ZoneOffsetPeriodV1(unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"adalv\0\0\0aedxb\0\0\0afkbl\0\0\0aganu\0\0\0aiaxa\0\0\0altia\0\0\0amevn\0\0\0ancur\0\0\0aolad\0\0\0aqcas\0\0\0aqdav\0\0\0aqddu\0\0\0aqmaw\0\0\0aqmcm\0\0\0aqplm\0\0\0aqrot\0\0\0aqsyw\0\0\0aqtrl\0\0\0aqvos\0\0\0arbue\0\0\0arcor\0\0\0arctc\0\0\0arirj\0\0\0arjuj\0\0\0arluq\0\0\0armdz\0\0\0arrgl\0\0\0arsla\0\0\0artuc\0\0\0aruaq\0\0\0arush\0\0\0asppg\0\0\0atvie\0\0\0auadl\0\0\0aubhq\0\0\0aubne\0\0\0audrw\0\0\0aueuc\0\0\0auhba\0\0\0auldc\0\0\0auldh\0\0\0aumel\0\0\0aumqi\0\0\0auper\0\0\0ausyd\0\0\0awaua\0\0\0azbak\0\0\0basjj\0\0\0bbbgi\0\0\0bddac\0\0\0bebru\0\0\0bfoua\0\0\0bgsof\0\0\0bhbah\0\0\0bibjm\0\0\0bjptn\0\0\0bmbda\0\0\0bnbwn\0\0\0bolpb\0\0\0bqkra\0\0\0braux\0\0\0brbel\0\0\0brbvb\0\0\0brcgb\0\0\0brcgr\0\0\0brern\0\0\0brfen\0\0\0brfor\0\0\0brmao\0\0\0brmcz\0\0\0brpvh\0\0\0brrbr\0\0\0brrec\0\0\0brsao\0\0\0brssa\0\0\0brstm\0\0\0bsnas\0\0\0btthi\0\0\0bwgbe\0\0\0bymsq\0\0\0bzbze\0\0\0cacfq\0\0\0caedm\0\0\0cafne\0\0\0caglb\0\0\0cagoo\0\0\0cahal\0\0\0caiql\0\0\0camon\0\0\0careb\0\0\0careg\0\0\0casjf\0\0\0cator\0\0\0cavan\0\0\0cawnp\0\0\0caybx\0\0\0caycb\0\0\0cayda\0\0\0caydq\0\0\0cayek\0\0\0cayev\0\0\0cayxy\0\0\0cayyn\0\0\0cayzs\0\0\0cccck\0\0\0cdfbm\0\0\0cdfih\0\0\0cfbgf\0\0\0cgbzv\0\0\0chzrh\0\0\0ciabj\0\0\0ckrar\0\0\0clipc\0\0\0clpuq\0\0\0clscl\0\0\0cmdla\0\0\0cnsha\0\0\0cnurc\0\0\0cobog\0\0\0crsjo\0\0\0cuhav\0\0\0cvrai\0\0\0cxxch\0\0\0cyfmg\0\0\0cynic\0\0\0czprg\0\0\0deber\0\0\0debsngn\0djjib\0\0\0dkcph\0\0\0dmdom\0\0\0dosdq\0\0\0dzalg\0\0\0ecgps\0\0\0ecgye\0\0\0eetll\0\0\0egcai\0\0\0eheai\0\0\0erasm\0\0\0esceu\0\0\0eslpa\0\0\0esmad\0\0\0etadd\0\0\0fihel\0\0\0fimhq\0\0\0fjsuv\0\0\0fkpsy\0\0\0fmksa\0\0\0fmpni\0\0\0fmtkk\0\0\0fotho\0\0\0frpar\0\0\0galbv\0\0\0gazastrpgblon\0\0\0gdgnd\0\0\0getbs\0\0\0gfcay\0\0\0gggci\0\0\0ghacc\0\0\0gigib\0\0\0gldkshvnglgoh\0\0\0globy\0\0\0glthu\0\0\0gmbjl\0\0\0gmt\0\0\0\0\0gncky\0\0\0gpbbr\0\0\0gpmsb\0\0\0gpsbh\0\0\0gqssg\0\0\0grath\0\0\0gsgrv\0\0\0gtgua\0\0\0gugum\0\0\0gwoxb\0\0\0gygeo\0\0\0hebron\0\0hkhkg\0\0\0hntgu\0\0\0hrzag\0\0\0htpap\0\0\0hubud\0\0\0iddjj\0\0\0idjkt\0\0\0idmak\0\0\0idpnk\0\0\0iedub\0\0\0imdgs\0\0\0inccu\0\0\0iodga\0\0\0iqbgw\0\0\0irthr\0\0\0isrey\0\0\0itrom\0\0\0jeruslm\0jesth\0\0\0jmkin\0\0\0joamm\0\0\0jptyo\0\0\0kenbo\0\0\0kgfru\0\0\0khpnh\0\0\0kicxi\0\0\0kipho\0\0\0kitrw\0\0\0kmyva\0\0\0knbas\0\0\0kpfnj\0\0\0krsel\0\0\0kwkwi\0\0\0kygec\0\0\0kzaau\0\0\0kzakx\0\0\0kzala\0\0\0kzguw\0\0\0kzksn\0\0\0kzkzo\0\0\0kzura\0\0\0lavte\0\0\0lbbey\0\0\0lccas\0\0\0livdz\0\0\0lkcmb\0\0\0lrmlw\0\0\0lsmsu\0\0\0ltvno\0\0\0lulux\0\0\0lvrix\0\0\0lytip\0\0\0macas\0\0\0mcmon\0\0\0mdkiv\0\0\0metgd\0\0\0mgtnr\0\0\0mhkwa\0\0\0mhmaj\0\0\0mkskp\0\0\0mlbko\0\0\0mmrgn\0\0\0mnhvd\0\0\0mnuln\0\0\0momfm\0\0\0mpspn\0\0\0mqfdf\0\0\0mrnkc\0\0\0msmni\0\0\0mtmla\0\0\0muplu\0\0\0mvmle\0\0\0mwblz\0\0\0mxchi\0\0\0mxcjs\0\0\0mxcun\0\0\0mxhmo\0\0\0mxmam\0\0\0mxmex\0\0\0mxmid\0\0\0mxmty\0\0\0mxmzt\0\0\0mxoji\0\0\0mxpvr\0\0\0mxtij\0\0\0mykch\0\0\0mykul\0\0\0mzmpm\0\0\0nawdh\0\0\0ncnou\0\0\0nenim\0\0\0nfnlk\0\0\0nglos\0\0\0nimga\0\0\0nlams\0\0\0noosl\0\0\0npktm\0\0\0nrinu\0\0\0nuiue\0\0\0nzakl\0\0\0nzcht\0\0\0ommct\0\0\0papty\0\0\0pelim\0\0\0pfgmr\0\0\0pfnhv\0\0\0pfppt\0\0\0pgpom\0\0\0pgraw\0\0\0phmnl\0\0\0pkkhi\0\0\0plwaw\0\0\0pmmqc\0\0\0pnpcn\0\0\0prsju\0\0\0ptfnc\0\0\0ptlis\0\0\0ptpdl\0\0\0pwror\0\0\0pyasu\0\0\0qadoh\0\0\0rereu\0\0\0robuh\0\0\0rsbeg\0\0\0ruasf\0\0\0rubax\0\0\0ruchita\0rudyr\0\0\0rugdx\0\0\0ruikt\0\0\0rukgd\0\0\0rukhndg\0rukra\0\0\0rukuf\0\0\0rukvx\0\0\0rumow\0\0\0runoz\0\0\0ruoms\0\0\0ruovb\0\0\0rupkc\0\0\0rurtw\0\0\0rusred\0\0rutof\0\0\0ruuly\0\0\0ruunera\0ruuus\0\0\0ruvog\0\0\0ruvvo\0\0\0ruyek\0\0\0ruyks\0\0\0rwkgl\0\0\0saruh\0\0\0sbhir\0\0\0scmaw\0\0\0sdkrt\0\0\0sesto\0\0\0sgsin\0\0\0shshn\0\0\0silju\0\0\0sjlyr\0\0\0skbts\0\0\0slfna\0\0\0smsai\0\0\0sndkr\0\0\0somgq\0\0\0srpbm\0\0\0ssjub\0\0\0sttms\0\0\0svsal\0\0\0sxphi\0\0\0sydam\0\0\0szqmn\0\0\0tcgdt\0\0\0tdndj\0\0\0tfpfr\0\0\0tglfw\0\0\0thbkk\0\0\0tjdyu\0\0\0tkfko\0\0\0tldil\0\0\0tmasb\0\0\0tntun\0\0\0totbu\0\0\0trist\0\0\0ttpos\0\0\0tvfun\0\0\0twtpe\0\0\0tzdar\0\0\0uaiev\0\0\0uasip\0\0\0ugkla\0\0\0umawk\0\0\0ummdy\0\0\0usadk\0\0\0usaeg\0\0\0usanc\0\0\0usboi\0\0\0uschi\0\0\0usden\0\0\0usdet\0\0\0ushnl\0\0\0usind\0\0\0usinvev\0usjnu\0\0\0usknx\0\0\0uslax\0\0\0uslui\0\0\0usmnm\0\0\0usmoc\0\0\0usmtm\0\0\0usndcnt\0usndnsl\0usnyc\0\0\0usoea\0\0\0usome\0\0\0usphx\0\0\0ussit\0\0\0ustel\0\0\0uswlz\0\0\0uswsq\0\0\0usxul\0\0\0usyak\0\0\0utc\0\0\0\0\0utce01\0\0utce02\0\0utce03\0\0utce04\0\0utce05\0\0utce06\0\0utce07\0\0utce08\0\0utce09\0\0utce10\0\0utce11\0\0utce12\0\0utce13\0\0utce14\0\0utcw01\0\0utcw02\0\0utcw03\0\0utcw04\0\0utcw05\0\0utcw06\0\0utcw07\0\0utcw08\0\0utcw09\0\0utcw10\0\0utcw11\0\0utcw12\0\0uymvd\0\0\0uzskd\0\0\0uztas\0\0\0vavat\0\0\0vcsvd\0\0\0veccs\0\0\0vgtov\0\0\0vistt\0\0\0vnsgn\0\0\0vuvli\0\0\0wfmau\0\0\0wsapw\0\0\0yeade\0\0\0ytmam\0\0\0zajnb\0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x01\0\0\x8F\x01\0\0\x91\x01\0\0\x92\x01\0\0\x95\x01\0\0\x97\x01\0\0\x9A\x01\0\0\x9B\x01\0\0\x9C\x01\0\0\x9E\x01\0\0\x9F\x01\0\0\xA1\x01\0\0\xA3\x01\0\0\xA4\x01\0\0\xA6\x01\0\0\xA7\x01\0\0\xAC\x01\0\0\xAF\x01\0\0\xB1\x01\0\0\xB3\x01\0\0\xB5\x01\0\0\xB6\x01\0\0\xB8\x01\0\0\xB9\x01\0\0\xBE\x01\0\0\xC5\x01\0\0\xC8\x01\0\0\xCA\x01\0\0\xCF\x01\0\0\xD0\x01\0\0\xD5\x01\0\0\xD6\x01\0\0\xDA\x01\0\0\xDC\x01\0\0\xDF\x01\0\0\xE0\x01\0\0\xE3\x01\0\0\xE6\x01\0\0\xE8\x01\0\0\xED\x01\0\0\xEF\x01\0\0\xF0\x01\0\0\xF1\x01\0\0\xF3\x01\0\0\xF6\x01\0\0\xF7\x01\0\0\0\x02\0\0\x04\x02\0\0\x05\x02\0\0\n\x02\0\0\x0B\x02\0\0\x0F\x02\0\0\x10\x02\0\0\x12\x02\0\0\x15\x02\0\0\x19\x02\0\0\x1E\x02\0\0\x1F\x02\0\0 \x02\0\0!\x02\0\0\"\x02\0\0#\x02\0\0$\x02\0\0%\x02\0\0&\x02\0\0)\x02\0\0*\x02\0\0,\x02\0\0.\x02\0\x000\x02\0\x003\x02\0\08\x02\0\0:\x02\0\0<\x02\0\0>\x02\0\0?\x02\0\0B\x02\0\0C\x02\0\0D\x02\0\0E\x02\0\0G\x02\0\0H\x02\0\0L\x02\0\0M\x02\0\0O\x02\0\0R\x02\0\0W\x02\0\0X\x02\0\0[\x02\0\0\\\x02\0\0`\x02\0\0c\x02\0\0f\x02\0\0g\x02\0\0h\x02\0\0m\x02\0\0n\x02\0\0q\x02\0\0t\x02\0\0u\x02\0\0v\x02\0\0w\x02\0\0z\x02\0\0|\x02\0\0}\x02\0\0~\x02\0\0\x85\x02\0\0\x8D\x02\0\0\x93\x02\0\0\x9A\x02\0\0\xA3\x02\0\0\xAD\x02\0\0\xB5\x02\0\0\xB6\x02\0\0\xB7\x02\0\0\xB8\x02\0\0\xBA\x02\0\0\xBE\x02\0\0\xC0\x02\0\0\xC1\x02\0\0\xC7\x02\0\0\xC9\x02\0\0\xD0\x02\0\0\xD8\x02\0\0\xDF\x02\0\0\xE2\x02\0\0\xE6\x02\0\0\xE8\x02\0\0\xE9\x02\0\0\xEB\x02\0\0\xEC\x02\0\0\xEE\x02\0\0\xEF\x02\0\0\xF0\x02\0\0\xF3\x02\0\0\xF6\x02\0\0\xF8\x02\0\0\xFA\x02\0\0\xFD\x02\0\0\xFE\x02\0\0\xFF\x02\0\0\x04\x03\0\0\x06\x03\0\0\x07\x03\0\0\x08\x03\0\0\r\x03\0\0\x12\x03\0\0\x16\x03\0\0\x19\x03\0\0\x1B\x03\0\0\x1F\x03\0\0#\x03\0\0&\x03\0\0(\x03\0\0-\x03\0\0/\x03\0\x003\x03\0\x004\x03\0\x006\x03\0\x007\x03\0\0:\x03\0\0<\x03\0\0=\x03\0\0B\x03\0\0C\x03\0\0L\x03\0\0N\x03\0\0P\x03\0\0R\x03\0\0T\x03\0\0U\x03\0\0V\x03\0\0W\x03\0\0X\x03\0\0Y\x03\0\0[\x03\0\0\\\x03\0\0]\x03\0\0^\x03\0\0_\x03\0\0a\x03\0\0c\x03\0\0f\x03\0\0h\x03\0\0k\x03\0\0m\x03\0\0n\x03\0\0r\x03\0\0v\x03\0\0z\x03\0\0{\x03\0\0~\x03\0\0\x80\x03\0\0\x81\x03\0\0\x86\x03\0\0\x88\x03\0\0\x90\x03\0\0\x98\x03\0\0\x9E\x03\0\0\xA4\x03\0\0\xAA\x03\0\0\xAF\x03\0\0\xB4\x03\0\0\xBD\x03\0\0\xC2\x03\0\0\xCA\x03\0\0\xD1\x03\0\0\xD6\x03\0\0\xDB\x03\0\0\xE0\x03\0\0\xE8\x03\0\0\xED\x03\0\0\xF5\x03\0\0\xFA\x03\0\0\x02\x04\0\0\t\x04\0\0\x10\x04\0\0\x18\x04\0\0!\x04\0\0&\x04\0\0+\x04\0\x000\x04\0\x001\x04\0\x002\x04\0\x003\x04\0\x004\x04\0\08\x04\0\0:\x04\0\0<\x04\0\0=\x04\0\0?\x04\0\0A\x04\0\0C\x04\0\0D\x04\0\0G\x04\0\0H\x04\0\0I\x04\0\0K\x04\0\0O\x04\0\0R\x04\0\0T\x04\0\0U\x04\0\0X\x04\0\0Y\x04\0\0]\x04\0\0`\x04\0\0a\x04\0\0b\x04\0\0c\x04\0\0g\x04\0\0i\x04\0\0l\x04\0\0o\x04\0\0q\x04\0\0t\x04\0\0\x80\x04\0\0\x81\x04\0\0\x82\x04\0\0\x84\x04\0\0\x85\x04\0\0\x89\x04\0\0\x93\x04\0\0\x94\x04\0\0\x95\x04\0\0\x96\x04\0\0\x9B\x04\0\0\xA1\x04\0\0\xA6\x04\0\0\xA9\x04\0\0\xAA\x04\0\0\xAB\x04\0\0\xAF\x04\0\0\xB0\x04\0\0\xB3\x04\0\0\xB6\x04\0\0\xBA\x04\0\0\xBD\x04\0\0\xBE\x04\0\0\xC2\x04\0\0\xC4\x04\0\0\xC6\x04\0\0\xCB\x04\0\0\xCD\x04\0\0\xCF\x04\0\0\xD0\x04\0\0\xD5\x04\0\0\xDA\x04\0\0\xDB\x04\0\0\xDD\x04\0\0\xE0\x04\0\0\xE5\x04\0\0\xEA\x04\0\0\xEC\x04\0\0\xED\x04\0\0\xEE\x04\0\0\xEF\x04\0\0\xF0\x04\0\0\xF1\x04\0\0\xF2\x04\0\0\xF3\x04\0\0\xF4\x04\0\0\xF5\x04\0\0\xF6\x04\0\0\xF7\x04\0\0\xF8\x04\0\0\xF9\x04\0\0\xFA\x04\0\0\xFB\x04\0\0\xFC\x04\0\0\xFD\x04\0\0\xFE\x04\0\0\xFF\x04\0\0\0\x05\0\0\x01\x05\0\0\x02\x05\0\0\x03\x05\0\0\x04\x05\0\0\x05\x05\0\0\x06\x05\0\0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xC8\0\xC8\x08\xC0\x08\xC8\x08\xC0\0\xC0\x08\xC8\0\xC8\0\xD0\0\xD8\x004\0\x10\0\x08\0\x08\0\x08\0\x08\0\x08\x08\0\0\xAC\0\xB0\x04\xB0\0\xC8\x08\xD0\x08\xE0\x08\xE0\0\xE8\0\xE0\x08\x08\0@\x08@\x000\0\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xF0\0\xF8\08\0\x10\x08\x10\0\x10\x08\x18\0\x10\x08\x10\x08\x10\0\x10\x08\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\x18\0\x08\0\x08\x08\xE0\0\xD8\x04\xD8\0\xE0\0\xD8\x08\xE0\0\0\x08\0\0\x08\x08\x08\0\0\x08\0\0\x08\0\xD8\0\xD0\x08\xD0\0\xD8\x08\xD8\0\x18\x08\x10\x08\x10\0\x18\x08\x10\x08\x10\x08\xF8\0\0\x08\0\0\0\x08\x08\0\x18\0\0\x08\0\0\x08\0\x08\x08\0\0\0\x08\x08\x08\x08\0\x08\x08\x18\0\x10\x08\x10\0\x10\x08\x10\x08\x10\0\x10\x08`\x08`\0\xE0\0\xE8\x08\xE8\0\xE0\x08\xE8\0`\0X\0X\0P\0\0\0\0\x08\x08\x08\x08\0\x08\x08\x08\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\0\x08\0\0\0\x08\xE0\0 \x08\x18\0 \x08\x18\x08 \0\xE8\0\x08\0\0\x08\0\0\0\x08\0\0\x08\0\x08\x08\xE8\0\xE8\x08\0\0\xE8\0\xE8\x08\xF0\0\xF0\x08\xF0\0\xF0\x08\xF0\0\xF8\x08\xF0\x08\xE0\x08\0\0\0\0\0\0\xE0\0\xE0\0\xE0\0\x08\0\x10\x08\x10\0\x10\x08\xF0\0\xD0\x08\xD0\0P\x08P\0\xF8\0\0\0\xE2\0\xE8\0\xE0\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08@\x08@\0\xD0\x08\xD0\0\x08\0\x08\x08\xD8\x08\x08\x08\x08\0\x08\x08H\08\0@\0@\08\0\0\x08\x08\0\0\x08\0\0\0\x08,\0(\x000\0\x18\0\x18\x08\x18\0\x1C\0 \x08 \0\x1C\x08\x1C\0\0\0\x08\x08\x08\0\x08\x08\x10\x08\x08\0\0\x08\0\0\0\x08\xD8\0\xD8\x08\xD8\0\x10\x08\x10\0\x18\0H\0\x18\x000\x08(\x000\x08(\x080\08\0\xAB\0\xB0\0p\0\xA0\0\xA8\0h\0`\0\x18\0\xE0\0H\0D\0H\0H\x08H\0\x18\0\xD8\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x08(\x000\x080\x000\x08(\x080\0(\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x080\0(\0(\0(\x080\0(\x08(\x000\x08(\x08 \x080\0(\0(\0(\x080\0(\x08(\0(\x08 \x08(\08\0\x10\x08\xE0\0\x08\0\x08\x08,\x004\x000\0,\0\xFB\0\0\0\x10\0\x18\x08\x10\0\x08\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\x08\x10\x08\x10\0\x10\x08\x10\0\x18\x08\x10\x08\x10\0\x08\x08\x08\0\x10\0\x08\0\x10\0\x08\0\x10\0\0\x08\0\0\x08\0\0\x08\0\0\0\x08\x08\0\x08\x08\x08\0\x08\x08\x18\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\0\xA0\0`\0`\0\x08\0\x08\x08\0\x004\x000\08\x088\08\0@\x08@\0@\x08@\0P\x08P\0\xE0\0\xE0\x08\xE0\0\0\0\xE0\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08 \x08 \0(\0\x10\0\xD0\0\xD0\x08\xC8\x08\xC8\0\xD0\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xC8\x08\xD0\0\xD8\0\xD0\x08\xD8\0\xC8\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xD0\x08\xD0\0\xD0\x08\xD0\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD0\0\xD0\x08\xD0\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xD0\x08\xC8\x08\xD0\0\xC0\0\xC0\x08\xC0\0\xC0\x08@\0<\0@\0\x10\0\x10\0\x08\x08\x10\0X\x08X\0\x08\0\\\0\\\x08\\\0X\0X\x08\x08\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD8\0\xD0\0\xD8\0\xD0\x08\xD0\0\x08\0\x08\x08\x08\0\x08\x08,\0.\0\\\0`\0\xA8\0`\x08f\x08 \0\xD8\0\xD8\x08\xD8\0\xB8\0\xB4\0\xB0\0P\0P\0X\0@\x08@\0(\0(\x08(\0\x08\0\x08\x08\xE0\0\xE8\0\xE8\x08\xBC\0\xC0\0\xE0\0\0\0\0\x08\0\0\0\x08\x08\0\0\x08\x08\x08\0\x08\xF8\0\xF8\x08\0\x08\xF8\x08H\0\xE0\0\xE8\0\xE0\x08 \0\x18\0 \0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\x08\x08 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \08\x088\08\x080\x080\08\x000\08\0H\x08@\x08H\0P\0@\0H\0h\x08`\x08X\x08`\0X\0`\0X\x08P\x08X\0`\0P\0X\0@\x088\x08@\0H\0@\0\x18\x08\x10\x08\x10\0\x18\0\x10\0H\x08H\0P\x08H\x08@\x08P\0X\0P\0H\08\x080\x088\0@\08\0 \x08\x18\0 \x08\x18\x08\x10\x08 \0\x18\0 \0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0\x18\x08\x10\x08\x18\0 \0\x18\08\x080\x088\x000\08\x000\x08(\x080\08\x000\08\x088\08\x080\x080\08\x000\08\0`\x08X\x08`\0X\0`\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0X\x08P\x08X\0`\0X\08\x088\08\x080\x080\08\x000\08\0 \x08\x18\x08\x10\x08\x18\0 \0\x18\0 \0H\0X\x08P\x08X\0`\0X\0P\0X\x08X\0X\x08P\x08P\0X\0P\0X\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0\x18\0P\x08H\x08P\0X\0P\0(\x08 \x08(\x000\0(\0H\x08@\x08H\0P\0H\0\x10\0\x18\0X\0 \0\x10\x08\x10\0\x18\0\x10\0\x08\0\x08\x08<\0@\0\0\0\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\0\0\x08\x08\x08\0\x08\x08\0\0\x18\0\xE4\0\xE8\0\x10\x08\x10\0\x18\0\x10\0\0\0\x08\0\0\0\xD0\x08\xD0\0\xE0\0\x10\x08\x10\0\x18\0\x10\0\xD8\0\xD8\x08\xE0\0\xD8\x08\x08\0\x08\x08\x08\0(\0\0\08\x000\x08(\x080\x08(\0\xA8\0h\0H\0@\0H\0(\x08 \x08(\0\x08\x08\x08\0h\0h\x08h\0\x10\x08\x10\0\x18\x08\x18\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x18\0\xE0\0`\0@\x08@\0\x18\0\x18\x08\x10\x08\x18\x08\x10\x08\x18\x08\x18\0\x10\0\x10\x08\x18\x08\x18\0\x18\x08\x10\x08 \0\x18\0\x18\0`\0\xA8\0\xA8\x08\xB0\0\xB0\x08\xA8\x08\xB0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD8\x08\xB0\x08\xB8\0\xB8\x08\xB0\x08\xB8\x08\xC8\x08\xC8\0\xC8\x08\xD0\x08\xC8\x08\xD8\0\xD8\x08\xD8\0\xD8\x08\xB0\0\xD8\x08\xD8\0\xD8\x08\xD8\x08\xD8\0\xD8\x08\xC0\x08\xC0\0\xC0\x08\xB8\x08\xD0\x08\xD8\0\xD0\x08\xC0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\x08\xD8\x08\xC0\x08\xC0\0\xB8\x08\xC0\0\xB8\x08\xC8\x08\xD0\x08\xC8\x08\xD0\x08\xD8\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xA8\x08\xB8\0\xB8\x08\xA8\x08\xB8\x08\xC8\0\xC0\x08\xB8\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xD0\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xC8\x08\xD0\x08\xB8\x08\0\0\x08\0\x10\0\x18\0 \0(\x000\08\0@\0H\0P\0X\0`\0h\0p\0\xF8\0\xF0\0\xE8\0\xE0\0\xD8\0\xD0\0\xC8\0\xC0\0\xB8\0\xB0\0\xA8\0\xA0\0\xE8\x08\xE8\0\xE8\x08\xE8\0(\0(\x080\0(\x08(\x000\x08(\x08(\0\x08\x08\x08\0\x08\x08\xE0\0\xE0\0\xDC\0\xE0\0\xE0\0\xE0\0@\08\0X\x08X\0`\0\xA8\x08\xA8\0h\x08h\0\x18\0\x18\0\x10\0\x10\0\x10\0") }) }); } #[clippy::msrv = "1.71.1"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.id.locale.is_default() { Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(Self::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER), metadata: Default::default() }) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -35,7 +35,7 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } @@ -44,12 +44,12 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -57,17 +57,17 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } diff --git a/provider/data/timezone/fingerprints.csv b/provider/data/timezone/fingerprints.csv index c1ced2df8ad..06a30340ca2 100644 --- a/provider/data/timezone/fingerprints.csv +++ b/provider/data/timezone/fingerprints.csv @@ -1,3 +1,4 @@ time_zone/bcp47_to_iana@1, , 7630B, 7609B, 7efd2629d86e0cdc time_zone/iana_to_bcp47@3, , 9551B, 9509B, ef97860b5f688e6d +time_zone/offset_period@1, , 13374B, 13286B, 397b18d3f2345411 time_zone/windows_zones_to_bcp47@1, , 8634B, 8591B, 90b7fe3f9cadf5bd diff --git a/provider/data/timezone/stubdata/mod.rs b/provider/data/timezone/stubdata/mod.rs index e531c05f9f9..2dbedfe9041 100644 --- a/provider/data/timezone/stubdata/mod.rs +++ b/provider/data/timezone/stubdata/mod.rs @@ -1,6 +1,7 @@ // @generated include!("bcp47_to_iana_map_v1_marker.rs.data"); include!("iana_to_bcp47_map_v3_marker.rs.data"); +include!("zone_offset_period_v1_marker.rs.data"); include!("windows_zones_to_bcp47_map_v1_marker.rs.data"); /// Marks a type as a data provider. You can then use macros like /// `impl_core_helloworld_v1` to add implementations. @@ -33,6 +34,7 @@ macro_rules! impl_data_provider { make_provider!($provider); impl_bcp47_to_iana_map_v1_marker!($provider); impl_iana_to_bcp47_map_v3_marker!($provider); + impl_zone_offset_period_v1_marker!($provider); impl_windows_zones_to_bcp47_map_v1_marker!($provider); }; } @@ -45,6 +47,7 @@ macro_rules! impl_any_provider { match marker.path.hashed() { h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), + h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), h if h == ::INFO.path.hashed() => icu_provider::DataProvider::::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response), _ => Err(icu_provider::DataErrorKind::MarkerNotFound.with_req(marker, req)), } diff --git a/provider/data/datetime/stubdata/zone_offset_period_v1_marker.rs.data b/provider/data/timezone/stubdata/zone_offset_period_v1_marker.rs.data similarity index 96% rename from provider/data/datetime/stubdata/zone_offset_period_v1_marker.rs.data rename to provider/data/timezone/stubdata/zone_offset_period_v1_marker.rs.data index 8331ffe3ff6..b17a8cd029c 100644 --- a/provider/data/datetime/stubdata/zone_offset_period_v1_marker.rs.data +++ b/provider/data/timezone/stubdata/zone_offset_period_v1_marker.rs.data @@ -16,18 +16,18 @@ macro_rules! __impl_zone_offset_period_v1_marker { #[clippy::msrv = "1.71.1"] impl $provider { #[doc(hidden)] - pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::datetime::provider::time_zones::ZoneOffsetPeriodV1(unsafe { + pub const SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER: &'static ::DataStruct = &icu::timezone::provider::ZoneOffsetPeriodV1(unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"adalv\0\0\0aedxb\0\0\0afkbl\0\0\0aganu\0\0\0aiaxa\0\0\0altia\0\0\0amevn\0\0\0ancur\0\0\0aolad\0\0\0aqcas\0\0\0aqdav\0\0\0aqddu\0\0\0aqmaw\0\0\0aqmcm\0\0\0aqplm\0\0\0aqrot\0\0\0aqsyw\0\0\0aqtrl\0\0\0aqvos\0\0\0arbue\0\0\0arcor\0\0\0arctc\0\0\0arirj\0\0\0arjuj\0\0\0arluq\0\0\0armdz\0\0\0arrgl\0\0\0arsla\0\0\0artuc\0\0\0aruaq\0\0\0arush\0\0\0asppg\0\0\0atvie\0\0\0auadl\0\0\0aubhq\0\0\0aubne\0\0\0audrw\0\0\0aueuc\0\0\0auhba\0\0\0auldc\0\0\0auldh\0\0\0aumel\0\0\0aumqi\0\0\0auper\0\0\0ausyd\0\0\0awaua\0\0\0azbak\0\0\0basjj\0\0\0bbbgi\0\0\0bddac\0\0\0bebru\0\0\0bfoua\0\0\0bgsof\0\0\0bhbah\0\0\0bibjm\0\0\0bjptn\0\0\0bmbda\0\0\0bnbwn\0\0\0bolpb\0\0\0bqkra\0\0\0braux\0\0\0brbel\0\0\0brbvb\0\0\0brcgb\0\0\0brcgr\0\0\0brern\0\0\0brfen\0\0\0brfor\0\0\0brmao\0\0\0brmcz\0\0\0brpvh\0\0\0brrbr\0\0\0brrec\0\0\0brsao\0\0\0brssa\0\0\0brstm\0\0\0bsnas\0\0\0btthi\0\0\0bwgbe\0\0\0bymsq\0\0\0bzbze\0\0\0cacfq\0\0\0caedm\0\0\0cafne\0\0\0caglb\0\0\0cagoo\0\0\0cahal\0\0\0caiql\0\0\0camon\0\0\0careb\0\0\0careg\0\0\0casjf\0\0\0cator\0\0\0cavan\0\0\0cawnp\0\0\0caybx\0\0\0caycb\0\0\0cayda\0\0\0caydq\0\0\0cayek\0\0\0cayev\0\0\0cayxy\0\0\0cayyn\0\0\0cayzs\0\0\0cccck\0\0\0cdfbm\0\0\0cdfih\0\0\0cfbgf\0\0\0cgbzv\0\0\0chzrh\0\0\0ciabj\0\0\0ckrar\0\0\0clipc\0\0\0clpuq\0\0\0clscl\0\0\0cmdla\0\0\0cnsha\0\0\0cnurc\0\0\0cobog\0\0\0crsjo\0\0\0cuhav\0\0\0cvrai\0\0\0cxxch\0\0\0cyfmg\0\0\0cynic\0\0\0czprg\0\0\0deber\0\0\0debsngn\0djjib\0\0\0dkcph\0\0\0dmdom\0\0\0dosdq\0\0\0dzalg\0\0\0ecgps\0\0\0ecgye\0\0\0eetll\0\0\0egcai\0\0\0eheai\0\0\0erasm\0\0\0esceu\0\0\0eslpa\0\0\0esmad\0\0\0etadd\0\0\0fihel\0\0\0fimhq\0\0\0fjsuv\0\0\0fkpsy\0\0\0fmksa\0\0\0fmpni\0\0\0fmtkk\0\0\0fotho\0\0\0frpar\0\0\0galbv\0\0\0gazastrpgblon\0\0\0gdgnd\0\0\0getbs\0\0\0gfcay\0\0\0gggci\0\0\0ghacc\0\0\0gigib\0\0\0gldkshvnglgoh\0\0\0globy\0\0\0glthu\0\0\0gmbjl\0\0\0gmt\0\0\0\0\0gncky\0\0\0gpbbr\0\0\0gpmsb\0\0\0gpsbh\0\0\0gqssg\0\0\0grath\0\0\0gsgrv\0\0\0gtgua\0\0\0gugum\0\0\0gwoxb\0\0\0gygeo\0\0\0hebron\0\0hkhkg\0\0\0hntgu\0\0\0hrzag\0\0\0htpap\0\0\0hubud\0\0\0iddjj\0\0\0idjkt\0\0\0idmak\0\0\0idpnk\0\0\0iedub\0\0\0imdgs\0\0\0inccu\0\0\0iodga\0\0\0iqbgw\0\0\0irthr\0\0\0isrey\0\0\0itrom\0\0\0jeruslm\0jesth\0\0\0jmkin\0\0\0joamm\0\0\0jptyo\0\0\0kenbo\0\0\0kgfru\0\0\0khpnh\0\0\0kicxi\0\0\0kipho\0\0\0kitrw\0\0\0kmyva\0\0\0knbas\0\0\0kpfnj\0\0\0krsel\0\0\0kwkwi\0\0\0kygec\0\0\0kzaau\0\0\0kzakx\0\0\0kzala\0\0\0kzguw\0\0\0kzksn\0\0\0kzkzo\0\0\0kzura\0\0\0lavte\0\0\0lbbey\0\0\0lccas\0\0\0livdz\0\0\0lkcmb\0\0\0lrmlw\0\0\0lsmsu\0\0\0ltvno\0\0\0lulux\0\0\0lvrix\0\0\0lytip\0\0\0macas\0\0\0mcmon\0\0\0mdkiv\0\0\0metgd\0\0\0mgtnr\0\0\0mhkwa\0\0\0mhmaj\0\0\0mkskp\0\0\0mlbko\0\0\0mmrgn\0\0\0mnhvd\0\0\0mnuln\0\0\0momfm\0\0\0mpspn\0\0\0mqfdf\0\0\0mrnkc\0\0\0msmni\0\0\0mtmla\0\0\0muplu\0\0\0mvmle\0\0\0mwblz\0\0\0mxchi\0\0\0mxcjs\0\0\0mxcun\0\0\0mxhmo\0\0\0mxmam\0\0\0mxmex\0\0\0mxmid\0\0\0mxmty\0\0\0mxmzt\0\0\0mxoji\0\0\0mxpvr\0\0\0mxtij\0\0\0mykch\0\0\0mykul\0\0\0mzmpm\0\0\0nawdh\0\0\0ncnou\0\0\0nenim\0\0\0nfnlk\0\0\0nglos\0\0\0nimga\0\0\0nlams\0\0\0noosl\0\0\0npktm\0\0\0nrinu\0\0\0nuiue\0\0\0nzakl\0\0\0nzcht\0\0\0ommct\0\0\0papty\0\0\0pelim\0\0\0pfgmr\0\0\0pfnhv\0\0\0pfppt\0\0\0pgpom\0\0\0pgraw\0\0\0phmnl\0\0\0pkkhi\0\0\0plwaw\0\0\0pmmqc\0\0\0pnpcn\0\0\0prsju\0\0\0ptfnc\0\0\0ptlis\0\0\0ptpdl\0\0\0pwror\0\0\0pyasu\0\0\0qadoh\0\0\0rereu\0\0\0robuh\0\0\0rsbeg\0\0\0ruasf\0\0\0rubax\0\0\0ruchita\0rudyr\0\0\0rugdx\0\0\0ruikt\0\0\0rukgd\0\0\0rukhndg\0rukra\0\0\0rukuf\0\0\0rukvx\0\0\0rumow\0\0\0runoz\0\0\0ruoms\0\0\0ruovb\0\0\0rupkc\0\0\0rurtw\0\0\0rusred\0\0rutof\0\0\0ruuly\0\0\0ruunera\0ruuus\0\0\0ruvog\0\0\0ruvvo\0\0\0ruyek\0\0\0ruyks\0\0\0rwkgl\0\0\0saruh\0\0\0sbhir\0\0\0scmaw\0\0\0sdkrt\0\0\0sesto\0\0\0sgsin\0\0\0shshn\0\0\0silju\0\0\0sjlyr\0\0\0skbts\0\0\0slfna\0\0\0smsai\0\0\0sndkr\0\0\0somgq\0\0\0srpbm\0\0\0ssjub\0\0\0sttms\0\0\0svsal\0\0\0sxphi\0\0\0sydam\0\0\0szqmn\0\0\0tcgdt\0\0\0tdndj\0\0\0tfpfr\0\0\0tglfw\0\0\0thbkk\0\0\0tjdyu\0\0\0tkfko\0\0\0tldil\0\0\0tmasb\0\0\0tntun\0\0\0totbu\0\0\0trist\0\0\0ttpos\0\0\0tvfun\0\0\0twtpe\0\0\0tzdar\0\0\0uaiev\0\0\0uasip\0\0\0ugkla\0\0\0umawk\0\0\0ummdy\0\0\0usadk\0\0\0usaeg\0\0\0usanc\0\0\0usboi\0\0\0uschi\0\0\0usden\0\0\0usdet\0\0\0ushnl\0\0\0usind\0\0\0usinvev\0usjnu\0\0\0usknx\0\0\0uslax\0\0\0uslui\0\0\0usmnm\0\0\0usmoc\0\0\0usmtm\0\0\0usndcnt\0usndnsl\0usnyc\0\0\0usoea\0\0\0usome\0\0\0usphx\0\0\0ussit\0\0\0ustel\0\0\0uswlz\0\0\0uswsq\0\0\0usxul\0\0\0usyak\0\0\0utc\0\0\0\0\0utce01\0\0utce02\0\0utce03\0\0utce04\0\0utce05\0\0utce06\0\0utce07\0\0utce08\0\0utce09\0\0utce10\0\0utce11\0\0utce12\0\0utce13\0\0utce14\0\0utcw01\0\0utcw02\0\0utcw03\0\0utcw04\0\0utcw05\0\0utcw06\0\0utcw07\0\0utcw08\0\0utcw09\0\0utcw10\0\0utcw11\0\0utcw12\0\0uymvd\0\0\0uzskd\0\0\0uztas\0\0\0vavat\0\0\0vcsvd\0\0\0veccs\0\0\0vgtov\0\0\0vistt\0\0\0vnsgn\0\0\0vuvli\0\0\0wfmau\0\0\0wsapw\0\0\0yeade\0\0\0ytmam\0\0\0zajnb\0\0\0zmlun\0\0\0zwhre\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\0\0\0\x03\0\0\0\x04\0\0\0\x05\0\0\0\x06\0\0\0\t\0\0\0\x10\0\0\0\x11\0\0\0\x12\0\0\0#\0\0\0(\0\0\0)\0\0\0+\0\0\0,\0\0\x001\0\0\x003\0\0\x004\0\0\x006\0\0\0:\0\0\0@\0\0\0H\0\0\0R\0\0\0\\\0\0\0f\0\0\0t\0\0\0\x82\0\0\0\x8A\0\0\0\x92\0\0\0\x9C\0\0\0\xA6\0\0\0\xAE\0\0\0\xAF\0\0\0\xB2\0\0\0\xB4\0\0\0\xB8\0\0\0\xBB\0\0\0\xBC\0\0\0\xBE\0\0\0\xBF\0\0\0\xC4\0\0\0\xC8\0\0\0\xCA\0\0\0\xCB\0\0\0\xCD\0\0\0\xCF\0\0\0\xD0\0\0\0\xD6\0\0\0\xD8\0\0\0\xDA\0\0\0\xDD\0\0\0\xDF\0\0\0\xE0\0\0\0\xE4\0\0\0\xE6\0\0\0\xE7\0\0\0\xE8\0\0\0\xEA\0\0\0\xEB\0\0\0\xEC\0\0\0\xED\0\0\0\xF3\0\0\0\xF5\0\0\0\xF9\0\0\0\xFD\0\0\0\xFF\0\0\0\x05\x01\0\0\x0B\x01\0\0\x11\x01\0\0\x15\x01\0\0\x1D\x01\0\0\x1F\x01\0\0#\x01\0\0)\x01\0\0+\x01\0\0/\x01\0\x002\x01\0\x005\x01\0\x007\x01\0\08\x01\0\0>\x01\0\0@\x01\0\0A\x01\0\0D\x01\0\0H\x01\0\0L\x01\0\0Q\x01\0\0T\x01\0\0W\x01\0\0\\\x01\0\0b\x01\0\0c\x01\0\0h\x01\0\0k\x01\0\0n\x01\0\0q\x01\0\0r\x01\0\0w\x01\0\0{\x01\0\0}\x01\0\0\x80\x01\0\0\x84\x01\0\0\x87\x01\0\0\x89\x01\0\0\x8A\x01\0\0\x8B\x01\0\0\x8C\x01\0\0\x8D\x01\0\0\x8E\x01\0\0\x8F\x01\0\0\x91\x01\0\0\x92\x01\0\0\x95\x01\0\0\x97\x01\0\0\x9A\x01\0\0\x9B\x01\0\0\x9C\x01\0\0\x9E\x01\0\0\x9F\x01\0\0\xA1\x01\0\0\xA3\x01\0\0\xA4\x01\0\0\xA6\x01\0\0\xA7\x01\0\0\xAC\x01\0\0\xAF\x01\0\0\xB1\x01\0\0\xB3\x01\0\0\xB5\x01\0\0\xB6\x01\0\0\xB8\x01\0\0\xB9\x01\0\0\xBE\x01\0\0\xC5\x01\0\0\xC8\x01\0\0\xCA\x01\0\0\xCF\x01\0\0\xD0\x01\0\0\xD5\x01\0\0\xD6\x01\0\0\xDA\x01\0\0\xDC\x01\0\0\xDF\x01\0\0\xE0\x01\0\0\xE3\x01\0\0\xE6\x01\0\0\xE8\x01\0\0\xED\x01\0\0\xEF\x01\0\0\xF0\x01\0\0\xF1\x01\0\0\xF3\x01\0\0\xF6\x01\0\0\xF7\x01\0\0\0\x02\0\0\x04\x02\0\0\x05\x02\0\0\n\x02\0\0\x0B\x02\0\0\x0F\x02\0\0\x10\x02\0\0\x12\x02\0\0\x15\x02\0\0\x19\x02\0\0\x1E\x02\0\0\x1F\x02\0\0 \x02\0\0!\x02\0\0\"\x02\0\0#\x02\0\0$\x02\0\0%\x02\0\0&\x02\0\0)\x02\0\0*\x02\0\0,\x02\0\0.\x02\0\x000\x02\0\x003\x02\0\08\x02\0\0:\x02\0\0<\x02\0\0>\x02\0\0?\x02\0\0B\x02\0\0C\x02\0\0D\x02\0\0E\x02\0\0G\x02\0\0H\x02\0\0L\x02\0\0M\x02\0\0O\x02\0\0R\x02\0\0W\x02\0\0X\x02\0\0[\x02\0\0\\\x02\0\0`\x02\0\0c\x02\0\0f\x02\0\0g\x02\0\0h\x02\0\0m\x02\0\0n\x02\0\0q\x02\0\0t\x02\0\0u\x02\0\0v\x02\0\0w\x02\0\0z\x02\0\0|\x02\0\0}\x02\0\0~\x02\0\0\x85\x02\0\0\x8D\x02\0\0\x93\x02\0\0\x9A\x02\0\0\xA3\x02\0\0\xAD\x02\0\0\xB5\x02\0\0\xB6\x02\0\0\xB7\x02\0\0\xB8\x02\0\0\xBA\x02\0\0\xBE\x02\0\0\xC0\x02\0\0\xC1\x02\0\0\xC7\x02\0\0\xC9\x02\0\0\xD0\x02\0\0\xD8\x02\0\0\xDF\x02\0\0\xE2\x02\0\0\xE6\x02\0\0\xE8\x02\0\0\xE9\x02\0\0\xEB\x02\0\0\xEC\x02\0\0\xEE\x02\0\0\xEF\x02\0\0\xF0\x02\0\0\xF3\x02\0\0\xF6\x02\0\0\xF8\x02\0\0\xFA\x02\0\0\xFD\x02\0\0\xFE\x02\0\0\xFF\x02\0\0\x04\x03\0\0\x06\x03\0\0\x07\x03\0\0\x08\x03\0\0\r\x03\0\0\x12\x03\0\0\x16\x03\0\0\x19\x03\0\0\x1B\x03\0\0\x1F\x03\0\0#\x03\0\0&\x03\0\0(\x03\0\0-\x03\0\0/\x03\0\x003\x03\0\x004\x03\0\x006\x03\0\x007\x03\0\0:\x03\0\0<\x03\0\0=\x03\0\0B\x03\0\0C\x03\0\0L\x03\0\0N\x03\0\0P\x03\0\0R\x03\0\0T\x03\0\0U\x03\0\0V\x03\0\0W\x03\0\0X\x03\0\0Y\x03\0\0[\x03\0\0\\\x03\0\0]\x03\0\0^\x03\0\0_\x03\0\0a\x03\0\0c\x03\0\0f\x03\0\0h\x03\0\0k\x03\0\0m\x03\0\0n\x03\0\0r\x03\0\0v\x03\0\0z\x03\0\0{\x03\0\0~\x03\0\0\x80\x03\0\0\x81\x03\0\0\x86\x03\0\0\x88\x03\0\0\x90\x03\0\0\x98\x03\0\0\x9E\x03\0\0\xA4\x03\0\0\xAA\x03\0\0\xAF\x03\0\0\xB4\x03\0\0\xBD\x03\0\0\xC2\x03\0\0\xCA\x03\0\0\xD1\x03\0\0\xD6\x03\0\0\xDB\x03\0\0\xE0\x03\0\0\xE8\x03\0\0\xED\x03\0\0\xF5\x03\0\0\xFA\x03\0\0\x02\x04\0\0\t\x04\0\0\x10\x04\0\0\x18\x04\0\0!\x04\0\0&\x04\0\0+\x04\0\x000\x04\0\x001\x04\0\x002\x04\0\x003\x04\0\x004\x04\0\08\x04\0\0:\x04\0\0<\x04\0\0=\x04\0\0?\x04\0\0A\x04\0\0C\x04\0\0D\x04\0\0G\x04\0\0H\x04\0\0I\x04\0\0K\x04\0\0O\x04\0\0R\x04\0\0T\x04\0\0U\x04\0\0X\x04\0\0Y\x04\0\0]\x04\0\0`\x04\0\0a\x04\0\0b\x04\0\0c\x04\0\0g\x04\0\0i\x04\0\0l\x04\0\0o\x04\0\0q\x04\0\0t\x04\0\0\x80\x04\0\0\x81\x04\0\0\x82\x04\0\0\x84\x04\0\0\x85\x04\0\0\x89\x04\0\0\x93\x04\0\0\x94\x04\0\0\x95\x04\0\0\x96\x04\0\0\x9B\x04\0\0\xA1\x04\0\0\xA6\x04\0\0\xA9\x04\0\0\xAA\x04\0\0\xAB\x04\0\0\xAF\x04\0\0\xB0\x04\0\0\xB3\x04\0\0\xB6\x04\0\0\xBA\x04\0\0\xBD\x04\0\0\xBE\x04\0\0\xC2\x04\0\0\xC4\x04\0\0\xC6\x04\0\0\xCB\x04\0\0\xCD\x04\0\0\xCF\x04\0\0\xD0\x04\0\0\xD5\x04\0\0\xDA\x04\0\0\xDB\x04\0\0\xDD\x04\0\0\xE0\x04\0\0\xE5\x04\0\0\xEA\x04\0\0\xEC\x04\0\0\xED\x04\0\0\xEE\x04\0\0\xEF\x04\0\0\xF0\x04\0\0\xF1\x04\0\0\xF2\x04\0\0\xF3\x04\0\0\xF4\x04\0\0\xF5\x04\0\0\xF6\x04\0\0\xF7\x04\0\0\xF8\x04\0\0\xF9\x04\0\0\xFA\x04\0\0\xFB\x04\0\0\xFC\x04\0\0\xFD\x04\0\0\xFE\x04\0\0\xFF\x04\0\0\0\x05\0\0\x01\x05\0\0\x02\x05\0\0\x03\x05\0\0\x04\x05\0\0\x05\x05\0\0\x06\x05\0\0\x07\x05\0\0\x08\x05\0\0\x0C\x05\0\0\x11\x05\0\0\x14\x05\0\0\x17\x05\0\0\x18\x05\0\0\x1B\x05\0\0\x1C\x05\0\0\x1D\x05\0\0\x1F\x05\0\0!\x05\0\0\"\x05\0\0&\x05\0\0'\x05\0\0(\x05\0\0)\x05\0\0*\x05\0\0+\x05\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"xXz\0\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xE8\xACj\0`Xt\0\xFF\xFF\xFF\x7FTWr\0\xC0\xB1\xD8\0\x88\xE8B\x01\xC4\xE8B\x01`\nI\x01\x08\xE8J\x01\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xD8_?\x01\x18hB\x01X\xA2O\x01\\2R\x01\0\xA5w\x01\x90\xBE\x82\x01\xD0[\x87\x014\xE5\x8A\x01\xD4O\x8F\x01T\xBD\x92\x01\xE1Y\x97\x01\x80\xE3\x9A\x01aY\x9F\x01\0\xE3\xA2\x01\xE1X\xA7\x01T\xD2\xAA\x01\xFF\xFF\xFF\x7F\xD8_?\x01p\x88B\x01X\xA2O\x01\x103R\x01\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7F\xD8_?\x01\xFF\xFF\xFF\x7F\xFF\xFF\xFF\x7FX\x96 \0`\xF1b\0\xF0\x98f\x01\xE0\x96x\x01\xF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\x08\xE8\0\xE8\x08\xE8\0\xE0\x08\xE0\0\xE8\0\xE0\0\xE8\x08\xE8\0\xA8\0\x08\x08\x08\0\x08\x08L\0L\x08L\0L\x08L\0L\x08P\0P\x08P\0L\0F\x08F\0P\x08P\0P\x08P\0P\x08P\0P\0T\x08T\0T\x04P\0P\x08P\x08@\x08@\0P\0P\x08\xE0\0 \x08 \0 \x08\x18\x08 \x08 \0\x08\0\x08\x08\xE0\x08\xE0\x000\x000\x080\0\x08\0\x08\x08\0\0\x10\0\x10\x08\x10\0\x10\x08 \0\x18\0\x10\0\x08\0\xE0\0\xE0\x08@\0\xE0\0\xE0\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE0\x08\xE0\0\xE0\x08\xE0\0\xE0\x08\xE0\0\xE0\x08\xE0\0\xE0\x08\xE0\0\xD8\x08\xD8\0\xD8\x08\xD8\0\xE0\0\xD8\0\xF0\x08\xF0\0\xF0\x08\xF0\0\xF0\x08\xF0\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE0\x08\xE0\0\xE0\x08\xE0\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE0\x08\xE0\0\xD8\x08\xD8\0\xE0\0\xD8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE8\x08\xE8\0\xE0\x08\xE0\0\xE8\0\xD8\x08\xD8\0\xD8\x08,\x000\0\x10\0\x18\x08\x18\0\x18\x08\x10\x08\x10\0\x18\0\xD0\x08\xD0\0\xC8\0\xC8\x08\xC8\0\xC8\x08\xC0\x08\xC0\0\xC0\x08\xC8\0\xE0\0\xE0\x08\xE0\0\xE0\x08\xE0\x08\xE0\x10\xE0\x08\xE0\0\xE0\x08\xE0\x08\xE0\0\xE0\x08\xD8\x08\xD0\x08\xD8\x08\xE0\x08\xE0\0\xE0\x08\xE0\0\xE0\x08\xD0\x08\xD8\0\xD0\x08\xD0\0\xD8\0\xD0\x08\xD0\0\xE4\x08\xE4\x10\xE4\x08\xE4\0\xE4\x08\xD8\x08\xD8\0\xD8\x08\xC0\x08\xC0\0\xC0\x08\xD0\x08\xD0\0\xD0\x08\xE0\0\xC8\x08\xD0\0\xD8\0\xD0\0\xC8\x08\xB8\0\xC0\0\xC0\x08\xC8\0\xC0\x08\xC8\0\xD0\x08\xD8\0\xD0\x08\xC8\0\xC8\x08\xC0\x08\xC8\x08\xC0\0\xC0\x08\xC8\0\xC8\0\xD0\0\xD8\x004\0\x10\0\x08\0\x08\0\x08\0\x08\0\x08\x08\0\0\xAC\0\xB0\x04\xB0\0\xC8\x08\xD0\x08\xE0\x08\xE0\0\xE8\0\xE0\x08\x08\0@\x08@\x000\0\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xF0\0\xF8\08\0\x10\x08\x10\0\x10\x08\x18\0\x10\x08\x10\x08\x10\0\x10\x08\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\x18\0\x08\0\x08\x08\xE0\0\xD8\x04\xD8\0\xE0\0\xD8\x08\xE0\0\0\x08\0\0\x08\x08\x08\0\0\x08\0\0\x08\0\xD8\0\xD0\x08\xD0\0\xD8\x08\xD8\0\x18\x08\x10\x08\x10\0\x18\x08\x10\x08\x10\x08\xF8\0\0\x08\0\0\0\x08\x08\0\x18\0\0\x08\0\0\x08\0\x08\x08\0\0\0\x08\x08\x08\x08\0\x08\x08\x18\0\x10\x08\x10\0\x10\x08\x10\x08\x10\0\x10\x08`\x08`\0\xE0\0\xE8\x08\xE8\0\xE0\x08\xE8\0`\0X\0X\0P\0\0\0\0\x08\x08\x08\x08\0\x08\x08\x08\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\0\x08\0\0\0\x08\xE0\0 \x08\x18\0 \x08\x18\x08 \0\xE8\0\x08\0\0\x08\0\0\0\x08\0\0\x08\0\x08\x08\xE8\0\xE8\x08\0\0\xE8\0\xE8\x08\xF0\0\xF0\x08\xF0\0\xF0\x08\xF0\0\xF8\x08\xF0\x08\xE0\x08\0\0\0\0\0\0\xE0\0\xE0\0\xE0\0\x08\0\x10\x08\x10\0\x10\x08\xF0\0\xD0\x08\xD0\0P\x08P\0\xF8\0\0\0\xE2\0\xE8\0\xE0\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08@\x08@\0\xD0\x08\xD0\0\x08\0\x08\x08\xD8\x08\x08\x08\x08\0\x08\x08H\08\0@\0@\08\0\0\x08\x08\0\0\x08\0\0\0\x08,\0(\x000\0\x18\0\x18\x08\x18\0\x1C\0 \x08 \0\x1C\x08\x1C\0\0\0\x08\x08\x08\0\x08\x08\x10\x08\x08\0\0\x08\0\0\0\x08\xD8\0\xD8\x08\xD8\0\x10\x08\x10\0\x18\0H\0\x18\x000\x08(\x000\x08(\x080\08\0\xAB\0\xB0\0p\0\xA0\0\xA8\0h\0`\0\x18\0\xE0\0H\0D\0H\0H\x08H\0\x18\0\xD8\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x08(\x000\x080\x000\x08(\x080\0(\0(\x000\0(\x08(\0(\x08 \x08(\0(\0(\x080\0(\x08(\0(\x08 \x080\0(\0(\0(\x080\0(\x08(\x000\x08(\x08 \x080\0(\0(\0(\x080\0(\x08(\0(\x08 \x08(\08\0\x10\x08\xE0\0\x08\0\x08\x08,\x004\x000\0,\0\xFB\0\0\0\x10\0\x18\x08\x10\0\x08\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\x08\x10\x08\x10\0\x10\x08\x10\0\x18\x08\x10\x08\x10\0\x08\x08\x08\0\x10\0\x08\0\x10\0\x08\0\x10\0\0\x08\0\0\x08\0\0\x08\0\0\0\x08\x08\0\x08\x08\x08\0\x08\x08\x18\x08\x10\0\x18\x08\x10\x08\x08\0\x08\x08\x18\0\xA0\0`\0`\0\x08\0\x08\x08\0\x004\x000\08\x088\08\0@\x08@\0@\x08@\0P\x08P\0\xE0\0\xE0\x08\xE0\0\0\0\xE0\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08 \x08 \0(\0\x10\0\xD0\0\xD0\x08\xC8\x08\xC8\0\xD0\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xC8\x08\xD0\0\xD8\0\xD0\x08\xD8\0\xC8\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xD0\x08\xD0\0\xD0\x08\xD0\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD0\0\xD0\x08\xD0\0\xC8\x08\xC8\0\xD0\0\xD0\x08\xC8\x08\xD0\0\xD0\x08\xC8\x08\xD0\0\xC0\0\xC0\x08\xC0\0\xC0\x08@\0<\0@\0\x10\0\x10\0\x08\x08\x10\0X\x08X\0\x08\0\\\0\\\x08\\\0X\0X\x08\x08\0\xD0\0\xD8\0\xD0\x08\xD0\0\xD8\0\xD0\0\xD8\0\xD0\x08\xD0\0\x08\0\x08\x08\x08\0\x08\x08,\0.\0\\\0`\0\xA8\0`\x08f\x08 \0\xD8\0\xD8\x08\xD8\0\xB8\0\xB4\0\xB0\0P\0P\0X\0@\x08@\0(\0(\x08(\0\x08\0\x08\x08\xE0\0\xE8\0\xE8\x08\xBC\0\xC0\0\xE0\0\0\0\0\x08\0\0\0\x08\x08\0\0\x08\x08\x08\0\x08\xF8\0\xF8\x08\0\x08\xF8\x08H\0\xE0\0\xE8\0\xE0\x08 \0\x18\0 \0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x08\0\x08\x08 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \08\x088\08\x080\x080\08\x000\08\0H\x08@\x08H\0P\0@\0H\0h\x08`\x08X\x08`\0X\0`\0X\x08P\x08X\0`\0P\0X\0@\x088\x08@\0H\0@\0\x18\x08\x10\x08\x10\0\x18\0\x10\0H\x08H\0P\x08H\x08@\x08P\0X\0P\0H\08\x080\x088\0@\08\0 \x08\x18\0 \x08\x18\x08\x10\x08 \0\x18\0 \0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0\x18\x08\x10\x08\x18\0 \0\x18\08\x080\x088\x000\08\x000\x08(\x080\08\x000\08\x088\08\x080\x080\08\x000\08\0`\x08X\x08`\0X\0`\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0X\x08P\x08X\0`\0X\08\x088\08\x080\x080\08\x000\08\0 \x08\x18\x08\x10\x08\x18\0 \0\x18\0 \0H\0X\x08P\x08X\0`\0X\0P\0X\x08X\0X\x08P\x08P\0X\0P\0X\0 \x08 \0 \x08\x18\x08\x18\0 \0\x18\0 \0\x18\0P\x08H\x08P\0X\0P\0(\x08 \x08(\x000\0(\0H\x08@\x08H\0P\0H\0\x10\0\x18\0X\0 \0\x10\x08\x10\0\x18\0\x10\0\x08\0\x08\x08<\0@\0\0\0\x08\0\x08\x08\x08\0\x08\x08\x08\0\x08\x08\0\0\x08\x08\x08\0\x08\x08\0\0\x18\0\xE4\0\xE8\0\x10\x08\x10\0\x18\0\x10\0\0\0\x08\0\0\0\xD0\x08\xD0\0\xE0\0\x10\x08\x10\0\x18\0\x10\0\xD8\0\xD8\x08\xE0\0\xD8\x08\x08\0\x08\x08\x08\0(\0\0\08\x000\x08(\x080\x08(\0\xA8\0h\0H\0@\0H\0(\x08 \x08(\0\x08\x08\x08\0h\0h\x08h\0\x10\x08\x10\0\x18\x08\x18\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x10\0\x10\x08\x18\0\xE0\0`\0@\x08@\0\x18\0\x18\x08\x10\x08\x18\x08\x10\x08\x18\x08\x18\0\x10\0\x10\x08\x18\x08\x18\0\x18\x08\x10\x08 \0\x18\0\x18\0`\0\xA8\0\xA8\x08\xB0\0\xB0\x08\xA8\x08\xB0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD8\x08\xB0\x08\xB8\0\xB8\x08\xB0\x08\xB8\x08\xC8\x08\xC8\0\xC8\x08\xD0\x08\xC8\x08\xD8\0\xD8\x08\xD8\0\xD8\x08\xB0\0\xD8\x08\xD8\0\xD8\x08\xD8\x08\xD8\0\xD8\x08\xC0\x08\xC0\0\xC0\x08\xB8\x08\xD0\x08\xD8\0\xD0\x08\xC0\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\x08\xD8\x08\xC0\x08\xC0\0\xB8\x08\xC0\0\xB8\x08\xC8\x08\xD0\x08\xC8\x08\xD0\x08\xD8\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xA8\x08\xB8\0\xB8\x08\xA8\x08\xB8\x08\xC8\0\xC0\x08\xB8\x08\xD8\x08\xD8\0\xD0\x08\xD8\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xD0\x08\xD8\0\xD0\x08\xD0\0\xD8\x08\xC8\x08\xD0\x08\xB8\x08\0\0\x08\0\x10\0\x18\0 \0(\x000\08\0@\0H\0P\0X\0`\0h\0p\0\xF8\0\xF0\0\xE8\0\xE0\0\xD8\0\xD0\0\xC8\0\xC0\0\xB8\0\xB0\0\xA8\0\xA0\0\xE8\x08\xE8\0\xE8\x08\xE8\0(\0(\x080\0(\x08(\x000\x08(\x08(\0\x08\x08\x08\0\x08\x08\xE0\0\xE0\0\xDC\0\xE0\0\xE0\0\xE0\0@\08\0X\x08X\0`\0\xA8\x08\xA8\0h\x08h\0\x18\0\x18\0\x10\0\x10\0\x10\0") }) }); } #[clippy::msrv = "1.71.1"] - impl icu_provider::DataProvider for $provider { - fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { + impl icu_provider::DataProvider for $provider { + fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { if req.id.locale.is_default() { Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(Self::SINGLETON_ZONE_OFFSET_PERIOD_V1_MARKER), metadata: Default::default() }) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -35,7 +35,7 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } @@ -44,12 +44,12 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } @@ -57,17 +57,17 @@ macro_rules! __impl_zone_offset_period_v1_marker { ($ provider : ty , DRY , ITER) => { __impl_zone_offset_period_v1_marker!($provider); #[clippy::msrv = "1.71.1"] - impl icu_provider::DryDataProvider for $provider { + impl icu_provider::DryDataProvider for $provider { fn dry_load(&self, req: icu_provider::DataRequest) -> Result { if req.id.locale.is_default() { Ok(Default::default()) } else { - Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) + Err(icu_provider::DataErrorKind::InvalidRequest.with_req(::INFO, req)) } } } #[clippy::msrv = "1.71.1"] - impl icu_provider::IterableDataProvider for $provider { + impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok([Default::default()].into_iter().collect()) } diff --git a/provider/registry/src/lib.rs b/provider/registry/src/lib.rs index 87bdac1114a..e1732126c00 100644 --- a/provider/registry/src/lib.rs +++ b/provider/registry/src/lib.rs @@ -44,7 +44,7 @@ macro_rules! registry( icu::datetime::provider::time_zones::MetazoneSpecificNamesLongV1Marker = "time_zone/specific_long@1", icu::datetime::provider::time_zones::MetazoneSpecificNamesShortV1Marker = "time_zone/specific_short@1", icu::datetime::provider::time_zones::TimeZoneEssentialsV1Marker = "time_zone/essentials@1", - icu::datetime::provider::time_zones::ZoneOffsetPeriodV1Marker = "time_zone/offset_period@1", + icu::timezone::provider::ZoneOffsetPeriodV1Marker = "time_zone/offset_period@1", icu::decimal::provider::DecimalSymbolsV1Marker = "decimal/symbols@1", icu::list::provider::AndListV2Marker = "list/and@2", icu::list::provider::OrListV2Marker = "list/or@2", diff --git a/provider/source/src/cldr_serde/time_zones/bcp47_tzid.rs b/provider/source/src/cldr_serde/time_zones/bcp47_tzid.rs index 9211899bab7..bb0bf041869 100644 --- a/provider/source/src/cldr_serde/time_zones/bcp47_tzid.rs +++ b/provider/source/src/cldr_serde/time_zones/bcp47_tzid.rs @@ -7,7 +7,7 @@ //! Sample file: //! -use icu::datetime::provider::time_zones::TimeZoneBcp47Id; +use icu::timezone::TimeZoneBcp47Id; use serde::Deserialize; use std::collections::BTreeMap; diff --git a/provider/source/src/time_zones/convert.rs b/provider/source/src/time_zones/convert.rs index f4244e42cd7..e28c193e535 100644 --- a/provider/source/src/time_zones/convert.rs +++ b/provider/source/src/time_zones/convert.rs @@ -10,6 +10,7 @@ use cldr_serde::time_zones::time_zone_names::*; use icu::calendar::DateTime; use icu::calendar::Iso; use icu::datetime::provider::time_zones::*; +use icu::timezone::provider::*; use icu::timezone::UtcOffset; use icu::timezone::ZoneVariant; use icu_provider::prelude::*; diff --git a/provider/source/src/time_zones/mod.rs b/provider/source/src/time_zones/mod.rs index cd3b4f40f79..4a2c5e7e878 100644 --- a/provider/source/src/time_zones/mod.rs +++ b/provider/source/src/time_zones/mod.rs @@ -6,6 +6,7 @@ use crate::cldr_serde; use crate::IterableDataProviderCached; use crate::SourceDataProvider; use icu::datetime::provider::time_zones::*; +use icu::timezone::provider::*; use icu_locale_core::subtags::Region; use icu_provider::prelude::*; use std::collections::BTreeMap; From bf3c3ec2f4ce805d1e43c9131b79fc2544789e61 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:52:05 -0700 Subject: [PATCH 15/21] Update components/datetime/src/neo_marker.rs Co-authored-by: Shane F. Carr --- components/datetime/src/neo_marker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/datetime/src/neo_marker.rs b/components/datetime/src/neo_marker.rs index 672dd613b82..501c95f98ea 100644 --- a/components/datetime/src/neo_marker.rs +++ b/components/datetime/src/neo_marker.rs @@ -1041,7 +1041,7 @@ pub trait ZoneMarkers: private::Sealed { type TimeZoneOffsetInput: Into>; /// Marker for resolving the time zone variant input field. type TimeZoneVariantInput: Into>; - /// Marker for resolving the time zone metazone input field. + /// Marker for resolving the time zone non-location display names, which depend on the datetime. type TimeZoneLocalTimeInput: Into, Time)>>; /// Marker for loading core time zone data. type EssentialsV1Marker: DataMarker>; From 25807e95f901a6fc4f65f6b2eb52bdb9602b6125 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 13:51:06 -0700 Subject: [PATCH 16/21] fix --- .../fixtures/tests/components_with_zones.json | 8 +-- components/datetime/tests/mock.rs | 4 ++ .../tests/patterns/tests/time_zones.json | 25 ++++++-- components/timezone/src/ixdtf.rs | 64 ++++++++++++------- 4 files changed, 71 insertions(+), 30 deletions(-) diff --git a/components/datetime/tests/fixtures/tests/components_with_zones.json b/components/datetime/tests/fixtures/tests/components_with_zones.json index fd5e906aca4..db108da552e 100644 --- a/components/datetime/tests/fixtures/tests/components_with_zones.json +++ b/components/datetime/tests/fixtures/tests/components_with_zones.json @@ -23,7 +23,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 Unknown City Time" + "en": "Tuesday, January 21, 2020, 08:25:07 {v}" } } }, @@ -51,7 +51,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 Unknown City Time" + "en": "Tuesday, January 21, 2020, 08:25:07 {v}" } } }, @@ -79,7 +79,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 GMT+5" + "en": "Tuesday, January 21, 2020, 08:25:07 {z}" } } }, @@ -107,7 +107,7 @@ }, "output": { "values": { - "en": "Tuesday, January 21, 2020, 08:25:07 GMT+5" + "en": "Tuesday, January 21, 2020, 08:25:07 {z}" } } }, diff --git a/components/datetime/tests/mock.rs b/components/datetime/tests/mock.rs index e321184fd94..0c311605a1d 100644 --- a/components/datetime/tests/mock.rs +++ b/components/datetime/tests/mock.rs @@ -57,6 +57,10 @@ pub fn parse_gregorian_from_str(input: &str) -> DateTime { /// ``` pub fn parse_zoned_gregorian_from_str(input: &str) -> CustomZonedDateTime { CustomZonedDateTime::try_iso_from_str(input) + .or_else(|e| { + println!("{input}"); + Err(e) + }) .unwrap() .to_calendar(Gregorian) } diff --git a/components/datetime/tests/patterns/tests/time_zones.json b/components/datetime/tests/patterns/tests/time_zones.json index 601102f0b1f..7dfeb8ae5e1 100644 --- a/components/datetime/tests/patterns/tests/time_zones.json +++ b/components/datetime/tests/patterns/tests/time_zones.json @@ -986,7 +986,13 @@ "patterns": [ "z", "zz", - "zzz", + "zzz" + ], + "configs": [], + "expected": ["{z}"] + }, + { + "patterns": [ "O" ], "configs": [], @@ -995,7 +1001,6 @@ { "patterns": [ "OOOO", - "zzzz", "ZZZZ" ], "configs": [], @@ -1037,6 +1042,13 @@ "z", "zz", "zzz", + "zzzz" + ], + "configs": [], + "expected": ["{z}"] + }, + { + "patterns": [ "O" ], "configs": [], @@ -1045,7 +1057,6 @@ { "patterns": [ "ZZZZ", - "zzzz", "OOOO" ], "configs": [], @@ -1070,7 +1081,13 @@ { "patterns": [ "v", - "vvvv", + "vvvv" + ], + "configs": [], + "expected": ["{v}"] + }, + { + "patterns": [ "VVVV" ], "configs": [], diff --git a/components/timezone/src/ixdtf.rs b/components/timezone/src/ixdtf.rs index e86bba3c542..a59ea0e7326 100644 --- a/components/timezone/src/ixdtf.rs +++ b/components/timezone/src/ixdtf.rs @@ -2,9 +2,12 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). -use crate::{CustomZonedDateTime, InvalidOffsetError, TimeZoneIdMapper, TimeZoneInfo, UtcOffset}; +use crate::{ + CustomZonedDateTime, InvalidOffsetError, TimeZoneIdMapper, TimeZoneInfo, UtcOffset, + ZoneOffsetCalculator, ZoneVariant, +}; use alloc::str::FromStr; -use icu_calendar::{AnyCalendar, Date, DateError, Iso, RangeError, Time}; +use icu_calendar::{AnyCalendar, Date, DateError, DateTime, Iso, RangeError, Time}; use ixdtf::{ parsers::{ records::{DateRecord, IxdtfParseRecord, TimeRecord, TimeZoneRecord, UTCOffsetRecord}, @@ -129,22 +132,39 @@ impl TimeZoneInfo { let mapper = TimeZoneIdMapper::new(); let time_zone_id = mapper.as_borrowed().iana_bytes_to_bcp47(iana_identifier); + let mut zone_variant = None; + let mut local_time = None; + if let (Some(date), Some(time)) = (date, time) { + let iso = DateTime::::try_new_iso_datetime( + date.year, + date.month, + date.day, + time.hour, + time.minute, + time.second, + )?; + if let Some(offset) = offset { + if let Some((std_offset, dst_offset)) = ZoneOffsetCalculator::new() + .compute_offsets_from_time_zone(time_zone_id, &iso) + { + zone_variant = if offset == std_offset { + Some(ZoneVariant::standard()) + } else if Some(offset) == dst_offset { + Some(ZoneVariant::daylight()) + } else { + // return an invalid offset error? + None + }; + } + } + local_time = Some((iso.date, iso.time)); + }; + Ok(Self { time_zone_id, offset, - zone_variant: None, - local_time: if let Some(date) = date { - if let Some(time) = time { - Some(( - Date::::try_new_iso_date(date.year, date.month, date.day)?, - Time::try_new(time.hour, time.minute, time.second, 0)?, - )) - } else { - None - } - } else { - None - }, + zone_variant, + local_time, }) } TimeZoneRecord::Offset(offset_record) => { @@ -167,7 +187,7 @@ impl CustomZonedDateTime { /// ✨ *Enabled with the `compiled_data` and `ixdtf` Cargo features.* /// /// ``` - /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id}; + /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; /// use tinystr::tinystr; /// /// let zoneddatetime = CustomZonedDateTime::try_iso_from_str("2024-08-08T12:08:19-05:00[America/Chicago]").unwrap(); @@ -185,7 +205,7 @@ impl CustomZonedDateTime { /// assert_eq!(zoneddatetime.time.nanosecond.number(), 0); /// assert_eq!(zoneddatetime.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); /// assert_eq!(zoneddatetime.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); - /// assert_eq!(zoneddatetime.zone.zone_variant, None); + /// assert_eq!(zoneddatetime.zone.zone_variant, Some(ZoneVariant::daylight())); /// assert!(zoneddatetime.zone.local_time.is_some()); /// ``` /// @@ -249,7 +269,7 @@ impl CustomZonedDateTime { /// Basic usage: /// /// ``` - /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id}; + /// use icu_timezone::{CustomZonedDateTime, TimeZoneInfo, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; /// use tinystr::tinystr; /// /// let zoneddatetime = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Chicago][u-ca=hebrew]").unwrap(); @@ -267,7 +287,7 @@ impl CustomZonedDateTime { /// assert_eq!(zoneddatetime.time.nanosecond.number(), 0); /// assert_eq!(zoneddatetime.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); /// assert_eq!(zoneddatetime.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); - /// assert_eq!(zoneddatetime.zone.zone_variant, None); + /// assert_eq!(zoneddatetime.zone.zone_variant, Some(ZoneVariant::daylight())); /// assert!(zoneddatetime.zone.local_time.is_some()); /// ``` /// @@ -294,7 +314,7 @@ impl CustomZonedDateTime { /// Below is an example of a time zone being provided by a time zone annotation. /// /// ``` - /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; + /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; /// use tinystr::tinystr; /// /// let tz_from_offset_annotation = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19[-05:00]").unwrap(); @@ -319,7 +339,7 @@ impl CustomZonedDateTime { /// verifying internal consistency. /// /// ``` - /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id}; + /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; /// use tinystr::tinystr; /// /// let consistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Chicago]").unwrap(); @@ -327,7 +347,7 @@ impl CustomZonedDateTime { /// /// assert_eq!(consistent_tz_from_both.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uschi"))); /// assert_eq!(consistent_tz_from_both.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); - /// assert_eq!(consistent_tz_from_both.zone.zone_variant, None); + /// assert_eq!(consistent_tz_from_both.zone.zone_variant, Some(ZoneVariant::daylight())); /// assert!(consistent_tz_from_both.zone.local_time.is_some()); /// /// let inconsistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Los_Angeles]").unwrap(); From 619d7c68e6e06d0649dbcc728731fa28aa18f7d5 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 13:58:46 -0700 Subject: [PATCH 17/21] validity check --- components/timezone/src/ixdtf.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/components/timezone/src/ixdtf.rs b/components/timezone/src/ixdtf.rs index a59ea0e7326..12b852e1d30 100644 --- a/components/timezone/src/ixdtf.rs +++ b/components/timezone/src/ixdtf.rs @@ -152,8 +152,7 @@ impl TimeZoneInfo { } else if Some(offset) == dst_offset { Some(ZoneVariant::daylight()) } else { - // return an invalid offset error? - None + return Err(ParseError::InvalidOffsetError); }; } } @@ -335,11 +334,10 @@ impl CustomZonedDateTime { /// /// ### DateTime UTC Offset with IANA identifier annotation /// - /// In cases where the DateTime UTC Offset is provided and the IANA identifier, these will be returned without - /// verifying internal consistency. + /// In cases where the DateTime UTC Offset is provided and the IANA identifier, some validity checks are performed. /// /// ``` - /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id, ZoneVariant}; + /// use icu_timezone::{TimeZoneInfo, CustomZonedDateTime, UtcOffset, TimeZoneBcp47Id, ZoneVariant, ParseError}; /// use tinystr::tinystr; /// /// let consistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Chicago]").unwrap(); @@ -350,12 +348,16 @@ impl CustomZonedDateTime { /// assert_eq!(consistent_tz_from_both.zone.zone_variant, Some(ZoneVariant::daylight())); /// assert!(consistent_tz_from_both.zone.local_time.is_some()); /// - /// let inconsistent_tz_from_both = CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Los_Angeles]").unwrap(); - /// - /// assert_eq!(inconsistent_tz_from_both.zone.time_zone_id, TimeZoneBcp47Id(tinystr!(8, "uslax"))); - /// assert_eq!(inconsistent_tz_from_both.zone.offset, Some(UtcOffset::try_from_seconds(-18000).unwrap())); - /// assert_eq!(inconsistent_tz_from_both.zone.zone_variant, None); - /// assert!(inconsistent_tz_from_both.zone.local_time.is_some()); + /// // We know that America/Los_Angeles never used a -05:00 offset at any time of the year 2024 + /// assert_eq!( + /// CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Los_Angeles]").unwrap_err(), + /// ParseError::InvalidOffsetError + /// ); + /// + /// // We don't know that America/Los_Angeles didn't use DST (-08:00) in August + /// assert!( + /// CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-08:00[America/Los_Angeles]").is_ok() + /// ); /// ``` /// /// ### DateTime UTC offset with UTC Offset annotation. From 77e22ada3dc5c66e9b564a73d85488fe5c4eb97c Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 14:16:56 -0700 Subject: [PATCH 18/21] ffi --- ffi/capi/bindings/c/TimeZoneInfo.h | 7 ++++ .../bindings/cpp/icu4x/TimeZoneInfo.d.hpp | 8 ++++ ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp | 21 +++++++++++ ffi/capi/bindings/dart/TimeZoneInfo.g.dart | 37 +++++++++++++++++++ ffi/capi/bindings/js/TimeZoneInfo.d.ts | 7 ++++ ffi/capi/bindings/js/TimeZoneInfo.mjs | 25 +++++++++++++ ffi/capi/src/timezone.rs | 22 ++++++++++- ffi/capi/tests/missing_apis.txt | 3 ++ tutorials/cpp/datetime.cpp | 30 ++++++++------- 9 files changed, 146 insertions(+), 14 deletions(-) diff --git a/ffi/capi/bindings/c/TimeZoneInfo.h b/ffi/capi/bindings/c/TimeZoneInfo.h index a6ededf97a4..e7ac529c124 100644 --- a/ffi/capi/bindings/c/TimeZoneInfo.h +++ b/ffi/capi/bindings/c/TimeZoneInfo.h @@ -7,6 +7,7 @@ #include #include "diplomat_runtime.h" +#include "IsoDateTime.d.h" #include "TimeZoneIdMapper.d.h" #include "TimeZoneInfo.d.h" @@ -75,6 +76,12 @@ icu4x_TimeZoneInfo_is_standard_time_mv1_result icu4x_TimeZoneInfo_is_standard_ti typedef struct icu4x_TimeZoneInfo_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_daylight_time_mv1_result; icu4x_TimeZoneInfo_is_daylight_time_mv1_result icu4x_TimeZoneInfo_is_daylight_time_mv1(const TimeZoneInfo* self); +void icu4x_TimeZoneInfo_set_local_time_mv1(TimeZoneInfo* self, const IsoDateTime* datetime); + +void icu4x_TimeZoneInfo_clear_local_time_mv1(TimeZoneInfo* self); + +IsoDateTime* icu4x_TimeZoneInfo_get_local_time_mv1(const TimeZoneInfo* self); + void icu4x_TimeZoneInfo_destroy_mv1(TimeZoneInfo* self); diff --git a/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp index 58ecfbf2e27..c579fbdd924 100644 --- a/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp +++ b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.d.hpp @@ -10,6 +10,8 @@ #include "../diplomat_runtime.hpp" namespace icu4x { +namespace capi { struct IsoDateTime; } +class IsoDateTime; namespace capi { struct TimeZoneIdMapper; } class TimeZoneIdMapper; namespace capi { struct TimeZoneInfo; } @@ -74,6 +76,12 @@ class TimeZoneInfo { inline std::optional is_daylight_time() const; + inline void set_local_time(const icu4x::IsoDateTime& datetime); + + inline void clear_local_time(); + + inline std::unique_ptr get_local_time() const; + inline const icu4x::capi::TimeZoneInfo* AsFFI() const; inline icu4x::capi::TimeZoneInfo* AsFFI(); inline static const icu4x::TimeZoneInfo* FromFFI(const icu4x::capi::TimeZoneInfo* ptr); diff --git a/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp index 5916143739d..93d3f18606f 100644 --- a/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp +++ b/ffi/capi/bindings/cpp/icu4x/TimeZoneInfo.hpp @@ -10,6 +10,7 @@ #include #include #include "../diplomat_runtime.hpp" +#include "IsoDateTime.hpp" #include "TimeZoneIdMapper.hpp" #include "TimeZoneInvalidOffsetError.hpp" @@ -77,6 +78,12 @@ namespace capi { typedef struct icu4x_TimeZoneInfo_is_daylight_time_mv1_result {union {bool ok; }; bool is_ok;} icu4x_TimeZoneInfo_is_daylight_time_mv1_result; icu4x_TimeZoneInfo_is_daylight_time_mv1_result icu4x_TimeZoneInfo_is_daylight_time_mv1(const icu4x::capi::TimeZoneInfo* self); + void icu4x_TimeZoneInfo_set_local_time_mv1(icu4x::capi::TimeZoneInfo* self, const icu4x::capi::IsoDateTime* datetime); + + void icu4x_TimeZoneInfo_clear_local_time_mv1(icu4x::capi::TimeZoneInfo* self); + + icu4x::capi::IsoDateTime* icu4x_TimeZoneInfo_get_local_time_mv1(const icu4x::capi::TimeZoneInfo* self); + void icu4x_TimeZoneInfo_destroy_mv1(TimeZoneInfo* self); @@ -205,6 +212,20 @@ inline std::optional icu4x::TimeZoneInfo::is_daylight_time() const { return result.is_ok ? std::optional(result.ok) : std::nullopt; } +inline void icu4x::TimeZoneInfo::set_local_time(const icu4x::IsoDateTime& datetime) { + icu4x::capi::icu4x_TimeZoneInfo_set_local_time_mv1(this->AsFFI(), + datetime.AsFFI()); +} + +inline void icu4x::TimeZoneInfo::clear_local_time() { + icu4x::capi::icu4x_TimeZoneInfo_clear_local_time_mv1(this->AsFFI()); +} + +inline std::unique_ptr icu4x::TimeZoneInfo::get_local_time() const { + auto result = icu4x::capi::icu4x_TimeZoneInfo_get_local_time_mv1(this->AsFFI()); + return std::unique_ptr(icu4x::IsoDateTime::FromFFI(result)); +} + inline const icu4x::capi::TimeZoneInfo* icu4x::TimeZoneInfo::AsFFI() const { return reinterpret_cast(this); } diff --git a/ffi/capi/bindings/dart/TimeZoneInfo.g.dart b/ffi/capi/bindings/dart/TimeZoneInfo.g.dart index b325ed011c5..5778e56a053 100644 --- a/ffi/capi/bindings/dart/TimeZoneInfo.g.dart +++ b/ffi/capi/bindings/dart/TimeZoneInfo.g.dart @@ -295,6 +295,28 @@ final class TimeZoneInfo implements ffi.Finalizable { } return result.union.ok; } + + /// Sets the `local_time` field. + /// + /// See the [Rust documentation for `local_time`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.local_time) for more information. + void setLocalTime(IsoDateTime datetime) { + _icu4x_TimeZoneInfo_set_local_time_mv1(_ffi, datetime._ffi); + } + + /// Clears the `local_time` field. + /// + /// See the [Rust documentation for `local_time`](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.local_time) for more information. + void clearLocalTime() { + _icu4x_TimeZoneInfo_clear_local_time_mv1(_ffi); + } + + /// Returns a copy of the `local_time` field. + /// + /// Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneInfo.html#structfield.local_time) + IsoDateTime? getLocalTime() { + final result = _icu4x_TimeZoneInfo_get_local_time_mv1(_ffi); + return result.address == 0 ? null : IsoDateTime._fromFfi(result, []); + } } @meta.RecordUse() @@ -416,3 +438,18 @@ external _ResultBoolVoid _icu4x_TimeZoneInfo_is_standard_time_mv1(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_is_daylight_time_mv1') // ignore: non_constant_identifier_names external _ResultBoolVoid _icu4x_TimeZoneInfo_is_daylight_time_mv1(ffi.Pointer self); + +@meta.RecordUse() +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_set_local_time_mv1') +// ignore: non_constant_identifier_names +external void _icu4x_TimeZoneInfo_set_local_time_mv1(ffi.Pointer self, ffi.Pointer datetime); + +@meta.RecordUse() +@ffi.Native)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_clear_local_time_mv1') +// ignore: non_constant_identifier_names +external void _icu4x_TimeZoneInfo_clear_local_time_mv1(ffi.Pointer self); + +@meta.RecordUse() +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'icu4x_TimeZoneInfo_get_local_time_mv1') +// ignore: non_constant_identifier_names +external ffi.Pointer _icu4x_TimeZoneInfo_get_local_time_mv1(ffi.Pointer self); diff --git a/ffi/capi/bindings/js/TimeZoneInfo.d.ts b/ffi/capi/bindings/js/TimeZoneInfo.d.ts index 5c729b94bf3..597f4808fdc 100644 --- a/ffi/capi/bindings/js/TimeZoneInfo.d.ts +++ b/ffi/capi/bindings/js/TimeZoneInfo.d.ts @@ -1,4 +1,5 @@ // generated by diplomat-tool +import type { IsoDateTime } from "./IsoDateTime" import type { TimeZoneIdMapper } from "./TimeZoneIdMapper" import type { TimeZoneInvalidOffsetError } from "./TimeZoneInvalidOffsetError" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; @@ -56,4 +57,10 @@ export class TimeZoneInfo { get isStandardTime(): boolean | null; get isDaylightTime(): boolean | null; + + setLocalTime(datetime: IsoDateTime): void; + + clearLocalTime(): void; + + getLocalTime(): IsoDateTime | null; } \ No newline at end of file diff --git a/ffi/capi/bindings/js/TimeZoneInfo.mjs b/ffi/capi/bindings/js/TimeZoneInfo.mjs index 21909907ab7..2d49d48624d 100644 --- a/ffi/capi/bindings/js/TimeZoneInfo.mjs +++ b/ffi/capi/bindings/js/TimeZoneInfo.mjs @@ -1,4 +1,5 @@ // generated by diplomat-tool +import { IsoDateTime } from "./IsoDateTime.mjs" import { TimeZoneIdMapper } from "./TimeZoneIdMapper.mjs" import { TimeZoneInvalidOffsetError } from "./TimeZoneInvalidOffsetError.mjs" import wasm from "./diplomat-wasm.mjs"; @@ -348,4 +349,28 @@ export class TimeZoneInfo { diplomatReceive.free(); } } + + setLocalTime(datetime) {wasm.icu4x_TimeZoneInfo_set_local_time_mv1(this.ffiValue, datetime.ffiValue); + + try {} + + finally {} + } + + clearLocalTime() {wasm.icu4x_TimeZoneInfo_clear_local_time_mv1(this.ffiValue); + + try {} + + finally {} + } + + getLocalTime() { + const result = wasm.icu4x_TimeZoneInfo_get_local_time_mv1(this.ffiValue); + + try { + return result === 0 ? null : new IsoDateTime(diplomatRuntime.internalConstructor, result, []); + } + + finally {} + } } \ No newline at end of file diff --git a/ffi/capi/src/timezone.rs b/ffi/capi/src/timezone.rs index dbf3df2b0d1..e8ac9f233ed 100644 --- a/ffi/capi/src/timezone.rs +++ b/ffi/capi/src/timezone.rs @@ -10,7 +10,7 @@ pub mod ffi { use core::fmt::Write; use icu_timezone::TimeZoneBcp47Id; - use crate::errors::ffi::TimeZoneInvalidOffsetError; + use crate::{datetime::ffi::IsoDateTime, errors::ffi::TimeZoneInvalidOffsetError}; #[diplomat::opaque] #[diplomat::rust_link(icu::timezone::TimeZoneInfo, Struct)] @@ -245,6 +245,26 @@ pub mod ffi { pub fn is_daylight_time(&self) -> Option { Some(self.0.zone_variant? == icu_timezone::ZoneVariant::daylight()) } + + /// Sets the `local_time` field. + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::local_time, StructField)] + pub fn set_local_time(&mut self, datetime: &IsoDateTime) { + self.0.local_time = Some((datetime.0.date, datetime.0.time.clone())); + } + + /// Clears the `local_time` field. + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::local_time, StructField)] + pub fn clear_local_time(&mut self) { + self.0.local_time.take(); + } + + /// Returns a copy of the `local_time` field. + #[diplomat::rust_link(icu::timezone::TimeZoneInfo::local_time, StructField, compact)] + pub fn get_local_time(&self) -> Option> { + self.0 + .local_time + .map(|(date, time)| Box::new(IsoDateTime(icu_calendar::DateTime { date, time }))) + } } } diff --git a/ffi/capi/tests/missing_apis.txt b/ffi/capi/tests/missing_apis.txt index 14aabf29fd7..5223fa580f2 100644 --- a/ffi/capi/tests/missing_apis.txt +++ b/ffi/capi/tests/missing_apis.txt @@ -225,3 +225,6 @@ icu::timezone::WindowsTimeZoneMapperBorrowed#Struct icu::timezone::WindowsTimeZoneMapperBorrowed::new#FnInStruct icu::timezone::WindowsTimeZoneMapperBorrowed::windows_tz_to_bcp47_id#FnInStruct icu::timezone::WindowsTimeZoneMapperBorrowed::windows_tz_to_bcp47_id_with_region#FnInStruct +icu::timezone::ZoneOffsetCalculator#Struct +icu::timezone::ZoneOffsetCalculator::compute_offsets_from_time_zone#FnInStruct +icu::timezone::ZoneOffsetCalculator::new#FnInStruct diff --git a/tutorials/cpp/datetime.cpp b/tutorials/cpp/datetime.cpp index f05d8b9276a..3456bfc901b 100644 --- a/tutorials/cpp/datetime.cpp +++ b/tutorials/cpp/datetime.cpp @@ -62,20 +62,7 @@ int main() { return 1; } - std::unique_ptr time_zone = TimeZoneInfo::unknown(); - time_zone->try_set_offset_str("-05:00").ok().value(); - int32_t offset = time_zone->offset_seconds().value(); - if (offset != -18000) { - std::cout << "GMT offset doesn't parse" << std::endl; - return 1; - } std::unique_ptr mapper = TimeZoneIdMapper::create(*dp.get()).ok().value(); - time_zone->set_iana_time_zone_id(*mapper.get(), "america/chicago"); - std::string time_zone_id_return = time_zone->time_zone_id(); - if (time_zone_id_return != "uschi") { - std::cout << "Time zone ID does not roundtrip: " << time_zone_id_return << std::endl; - return 1; - } std::string normalized_iana_id = mapper->normalize_iana("America/CHICAGO").ok().value().value(); if (normalized_iana_id != "America/Chicago") { std::cout << "Time zone ID does not normalize: " << normalized_iana_id << std::endl; @@ -98,6 +85,21 @@ int main() { return 1; } + std::unique_ptr time_zone = TimeZoneInfo::unknown(); + time_zone->try_set_offset_str("-05:00").ok().value(); + int32_t offset = time_zone->offset_seconds().value(); + if (offset != -18000) { + std::cout << "GMT offset doesn't parse" << std::endl; + return 1; + } + time_zone->set_iana_time_zone_id(*mapper.get(), "america/chicago"); + std::string time_zone_id_return = time_zone->time_zone_id(); + if (time_zone_id_return != "uschi") { + std::cout << "Time zone ID does not roundtrip: " << time_zone_id_return << std::endl; + return 1; + } + time_zone->set_local_time(*date.get()); + std::unique_ptr gzdtf = GregorianZonedDateTimeFormatter::create_with_length(*dp.get(), *locale.get(), DateTimeLength::Long).ok().value(); out = gzdtf->format_iso_datetime_with_custom_time_zone(*date.get(), *time_zone.get()); std::cout << "Formatted value is " << out << std::endl; @@ -106,6 +108,8 @@ int main() { return 1; } + time_zone->set_local_time(*any_date->to_iso().get()); + std::unique_ptr zdtf = ZonedDateTimeFormatter::create_with_length(*dp.get(), *locale.get(), DateTimeLength::Long).ok().value(); out = zdtf->format_datetime_with_custom_time_zone(*any_date.get(), *time_zone.get()).ok().value(); std::cout << "Formatted value is " << out << std::endl; From a566e086b5bb9148c31bda5bbb6f259e72e0d9c9 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 14:17:53 -0700 Subject: [PATCH 19/21] fix --- components/datetime/tests/mock.rs | 4 ---- components/timezone/src/ixdtf.rs | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/components/datetime/tests/mock.rs b/components/datetime/tests/mock.rs index 0c311605a1d..e321184fd94 100644 --- a/components/datetime/tests/mock.rs +++ b/components/datetime/tests/mock.rs @@ -57,10 +57,6 @@ pub fn parse_gregorian_from_str(input: &str) -> DateTime { /// ``` pub fn parse_zoned_gregorian_from_str(input: &str) -> CustomZonedDateTime { CustomZonedDateTime::try_iso_from_str(input) - .or_else(|e| { - println!("{input}"); - Err(e) - }) .unwrap() .to_calendar(Gregorian) } diff --git a/components/timezone/src/ixdtf.rs b/components/timezone/src/ixdtf.rs index 12b852e1d30..fb63254bec1 100644 --- a/components/timezone/src/ixdtf.rs +++ b/components/timezone/src/ixdtf.rs @@ -350,10 +350,10 @@ impl CustomZonedDateTime { /// /// // We know that America/Los_Angeles never used a -05:00 offset at any time of the year 2024 /// assert_eq!( - /// CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Los_Angeles]").unwrap_err(), + /// CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-05:00[America/Los_Angeles]").unwrap_err(), /// ParseError::InvalidOffsetError /// ); - /// + /// /// // We don't know that America/Los_Angeles didn't use DST (-08:00) in August /// assert!( /// CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-08:00[America/Los_Angeles]").is_ok() From 4d598bd264fdc6b711003da3952da8590afdc2e9 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:20:04 -0700 Subject: [PATCH 20/21] Update components/timezone/src/ixdtf.rs Co-authored-by: Shane F. Carr --- components/timezone/src/ixdtf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/timezone/src/ixdtf.rs b/components/timezone/src/ixdtf.rs index fb63254bec1..715de8c1521 100644 --- a/components/timezone/src/ixdtf.rs +++ b/components/timezone/src/ixdtf.rs @@ -354,7 +354,7 @@ impl CustomZonedDateTime { /// ParseError::InvalidOffsetError /// ); /// - /// // We don't know that America/Los_Angeles didn't use DST (-08:00) in August + /// // We don't know that America/Los_Angeles didn't use standard time (-08:00) in August /// assert!( /// CustomZonedDateTime::try_from_str("2024-08-08T12:08:19-08:00[America/Los_Angeles]").is_ok() /// ); From a7724523d128abd1d752619066ed383b78bb9a50 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 16 Oct 2024 14:23:57 -0700 Subject: [PATCH 21/21] clippy --- ffi/capi/src/timezone.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffi/capi/src/timezone.rs b/ffi/capi/src/timezone.rs index e8ac9f233ed..c74763c7b0a 100644 --- a/ffi/capi/src/timezone.rs +++ b/ffi/capi/src/timezone.rs @@ -249,7 +249,7 @@ pub mod ffi { /// Sets the `local_time` field. #[diplomat::rust_link(icu::timezone::TimeZoneInfo::local_time, StructField)] pub fn set_local_time(&mut self, datetime: &IsoDateTime) { - self.0.local_time = Some((datetime.0.date, datetime.0.time.clone())); + self.0.local_time = Some((datetime.0.date, datetime.0.time)); } /// Clears the `local_time` field.