From 22b772a8c7f9d7cb0e0f64d3749fb8187b65873c Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Thu, 29 Feb 2024 08:38:26 -0500 Subject: [PATCH] Start on the combined localization library, with dates and times --- Cargo.lock | 605 +++++++++++++++++++++++- Cargo.nix | 1185 +++++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 1 + l10n/Cargo.toml | 15 + l10n/src/lib.rs | 146 ++++++ 5 files changed, 1925 insertions(+), 27 deletions(-) create mode 100644 l10n/Cargo.toml create mode 100644 l10n/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 618d38e..23fd28f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -483,6 +483,16 @@ dependencies = [ "system-deps", ] +[[package]] +name = "calendrical_calculations" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dfe3bc6a50b4667fafdb6d9cf26731c5418c457e317d8166c972014facf9a5d" +dependencies = [ + "core_maths", + "displaydoc", +] + [[package]] name = "cc" version = "1.0.83" @@ -692,6 +702,15 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core_maths" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3" +dependencies = [ + "libm", +] + [[package]] name = "cpufeatures" version = "0.2.11" @@ -1117,6 +1136,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "fixed_decimal" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc7fdec9d7f6671a3ebb3282c969962aba67c49f6abac5311959b65cafabc10" +dependencies = [ + "displaydoc", + "smallvec", + "writeable", +] + [[package]] name = "flate2" version = "1.0.28" @@ -2020,6 +2050,422 @@ dependencies = [ "libadwaita", ] +[[package]] +name = "icu" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21be1c98fbdb29fff7e34b2939a4f30dad330d4cc20f7be1b3956e21032f67ba" +dependencies = [ + "icu_calendar", + "icu_casemap", + "icu_collator", + "icu_collections", + "icu_compactdecimal", + "icu_datetime", + "icu_decimal", + "icu_displaynames", + "icu_list", + "icu_locid", + "icu_locid_transform", + "icu_normalizer", + "icu_plurals", + "icu_properties", + "icu_provider", + "icu_relativetime", + "icu_segmenter", + "icu_timezone", +] + +[[package]] +name = "icu_calendar" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb932a690c92f87955e923106181ee0d5682e688ff37fb5c7b296e1fe806edb" +dependencies = [ + "calendrical_calculations", + "displaydoc", + "icu_calendar_data", + "icu_locid", + "icu_locid_transform", + "icu_provider", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_calendar_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22aec7d032735d9acb256eeef72adcac43c3b7572f19b51576a63d664b524ca2" + +[[package]] +name = "icu_casemap" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7988d4f2655012592ac5b027722a93fbe12ff2a86d3e0f9ae686aedba0984f5e" +dependencies = [ + "displaydoc", + "icu_casemap_data", + "icu_collections", + "icu_locid", + "icu_properties", + "icu_provider", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_casemap_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36409fb8ce6f87c408310d87396ac471cc7320e007e648814c607c60fe77cc5" + +[[package]] +name = "icu_collator" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a45056e541cffde068f5c81ac1c0503b9ee2a4b967546422e509c5c653750" +dependencies = [ + "displaydoc", + "icu_collator_data", + "icu_collections", + "icu_locid", + "icu_locid_transform", + "icu_normalizer", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_collator_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39774016c5b9ad006941f3196fea83ade662d9167eb573111c8f4cc9593e2999" + +[[package]] +name = "icu_collections" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "137d96353afc8544d437e8a99eceb10ab291352699573b0de5b08bda38c78c60" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_compactdecimal" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d3c22da90659121ae1e38bd0fb378d15179c820f56a0c278032fb4eb5a0ca60" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_compactdecimal_data", + "icu_decimal", + "icu_locid_transform", + "icu_plurals", + "icu_provider", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_compactdecimal_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53eaf4902ee2e804f2583611722f6961fe85f31eab7ec790f47dde2d1cd494fb" + +[[package]] +name = "icu_datetime" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1508c7ed627cc0b031c81203eb98f34433e24b32b39d5b2c0238e4962a00957d" +dependencies = [ + "displaydoc", + "either", + "fixed_decimal", + "icu_calendar", + "icu_datetime_data", + "icu_decimal", + "icu_locid", + "icu_locid_transform", + "icu_plurals", + "icu_provider", + "icu_timezone", + "smallvec", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_datetime_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6abc569cb4ee80b30707566f05c5c9ed4bed765f91ce41e7f5a37c5e6a75b3f" + +[[package]] +name = "icu_decimal" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf994f9ed8061c17bb313f28fba6cffc736f0a16c7fab827efc9b73fd3f7778" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_decimal_data", + "icu_locid", + "icu_locid_transform", + "icu_provider", + "writeable", +] + +[[package]] +name = "icu_decimal_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2de3548316b697c70f30dec1395c9212db09df1d86a27624ee24872b71326c" + +[[package]] +name = "icu_displaynames" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726c0d83ff52f05907275f39e5bb7949a92fa3d09538de60cf73ccf8ee89a613" +dependencies = [ + "icu_displaynames_data", + "icu_locid", + "icu_locid_transform", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_displaynames_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af40e6b723e5e6d9359cf0bb4e4ed6dfb9d6ab16b73b5c82b61f947e88bb30f6" + +[[package]] +name = "icu_list" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6c04ec71ad1bacdbfb47164d4801f80a0533d9340f94f1a880f521eff59f54" +dependencies = [ + "displaydoc", + "icu_list_data", + "icu_locid_transform", + "icu_provider", + "regex-automata 0.2.0", + "writeable", +] + +[[package]] +name = "icu_list_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f6afcf7a9a7fedece70b7f17d7a7ecdfb8df145d37ae46d0277cd1e3932532" + +[[package]] +name = "icu_locid" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0aa2536adc14c07e2a521e95512b75ed8ef832f0fdf9299d4a0a45d2be2a9d" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c17d8f6524fdca4471101dd71f0a132eb6382b5d6d7f2970441cb25f6f435a" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545c6c3e8bf9580e2dafee8de6f9ec14826aaf359787789c7724f1f85f47d3dc" + +[[package]] +name = "icu_normalizer" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c183e31ed700f1ecd6b032d104c52fe8b15d028956b73727c97ec176b170e187" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22026918a80e6a9a330cb01b60f950e2b4e5284c59528fd0c6150076ef4c8522" + +[[package]] +name = "icu_plurals" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d807b123eb2a9ae8f12080fb8cce479f5c8a761fba0bb5ab52da6dd5e31a03" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_locid", + "icu_locid_transform", + "icu_plurals_data", + "icu_provider", + "zerovec", +] + +[[package]] +name = "icu_plurals_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3acd5f1f2f988ed2dae9316c3d3560dfe4e03a7516d142b4b89b92252ada41a" + +[[package]] +name = "icu_properties" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976e296217453af983efa25f287a4c1da04b9a63bf1ed63719455068e4453eb5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6a86c0e384532b06b6c104814f9c1b13bcd5b64409001c0d05713a1f3529d99" + +[[package]] +name = "icu_provider" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba58e782287eb6950247abbf11719f83f5d4e4a5c1f2cd490d30a334bc47c2f4" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2abdd3a62551e8337af119c5899e600ca0c88ec8f23a46c60ba216c803dcf1a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "icu_relativetime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47825312a5eb0790bad7b718fa8d41a8ea1e0ba597b4f7bb84bcfe97d7fc5aba" +dependencies = [ + "displaydoc", + "fixed_decimal", + "icu_decimal", + "icu_locid_transform", + "icu_plurals", + "icu_provider", + "icu_relativetime_data", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_relativetime_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b55cc15ea8981fbba78e9347d0c4003d4490c85f76e9adc7f270290046cae8" + +[[package]] +name = "icu_segmenter" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2dc1e8f4ba33a6a4956770ac5c08570f255d6605519fb3a859a0c0a270a2f8f" +dependencies = [ + "core_maths", + "displaydoc", + "icu_collections", + "icu_locid", + "icu_provider", + "icu_segmenter_data", + "utf8_iter", + "zerovec", +] + +[[package]] +name = "icu_segmenter_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3673d6698dcffce08cfe8fc5da3c11c3f2c663d5d6137fd58ab2cbf44235ab46" + +[[package]] +name = "icu_timezone" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35aabe571a7c653c0f543ff1512b8a1b2ad481cfa24b3d25115298d2ff3b50f" +dependencies = [ + "displaydoc", + "icu_calendar", + "icu_locid", + "icu_provider", + "icu_timezone_data", + "tinystr", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_timezone_data" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceee21e181cce2ab44e95923da6b3418df75369f570df82264c29c51ca398d4" + [[package]] name = "idna" version = "0.1.5" @@ -2262,6 +2708,19 @@ dependencies = [ "log 0.4.20", ] +[[package]] +name = "l10n" +version = "0.1.0" +dependencies = [ + "chrono", + "chrono-tz", + "fluent-ergonomics", + "icu", + "icu_locid", + "icu_provider", + "sys-locale", +] + [[package]] name = "language-tags" version = "0.2.2" @@ -2350,6 +2809,12 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +[[package]] +name = "litemap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d642685b028806386b2b6e75685faadd3eb65a85fff7df711ce18446a422da" + [[package]] name = "lock_api" version = "0.4.11" @@ -3364,10 +3829,19 @@ checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata", + "regex-automata 0.4.3", "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782" +dependencies = [ + "memchr", +] + [[package]] name = "regex-automata" version = "0.4.3" @@ -4015,6 +4489,12 @@ dependencies = [ "urlencoding", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "stringprep" version = "0.1.4" @@ -4060,6 +4540,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "sys-locale" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801cf239ecd6ccd71f03d270d67dd53d13e90aab208bf4b8fe4ad957ea949b0" +dependencies = [ + "libc", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -4229,6 +4729,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" dependencies = [ "displaydoc", + "zerovec", ] [[package]] @@ -4611,6 +5112,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.1" @@ -5034,6 +5547,42 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad7bb64b8ef9c0aa27b6da38b452b0ee9fd82beaf276a87dd796fb55cbae14e" + +[[package]] +name = "yoke" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65e71b2e4f287f467794c671e2b8f8a5f3716b3c829079a1c44740148eff07e4" +dependencies = [ + "serde 1.0.193", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6936f0cce458098a201c245a11bef556c6a0181129c7034d10d76d1ec3a2b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.31" @@ -5054,12 +5603,66 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "zerofrom" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655b0814c5c0b19ade497851070c640773304939a6c0fd5f5fb43da0696d05b7" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "synstructure", +] + [[package]] name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +[[package]] +name = "zerotrie" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0594125a0574fb93059c92c588ab209cc036a23d1baeb3410fa9181bea551a0" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff4439ae91fb5c72b8abc12f3f2dbf51bd27e6eadb9f8a5bc8898dddb0e27ea" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4e5997cbf58990550ef1f0e5124a05e47e1ebd33a84af25739be6031a62c20" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.nix b/Cargo.nix index 47475e9..775f882 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -625,7 +625,31 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "async-channel" = rec { + "async-channel 1.9.0" = rec { + crateName = "async-channel"; + version = "1.9.0"; + edition = "2018"; + sha256 = "0dbdlkzlncbibd3ij6y6jmvjd0cmdn48ydcfdpfhw09njd93r5c1"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "concurrent-queue"; + packageId = "concurrent-queue"; + } + { + name = "event-listener"; + packageId = "event-listener 2.5.3"; + } + { + name = "futures-core"; + packageId = "futures-core"; + } + ]; + + }; + "async-channel 2.1.1" = rec { crateName = "async-channel"; version = "2.1.1"; edition = "2018"; @@ -665,6 +689,447 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; + "async-executor" = rec { + crateName = "async-executor"; + version = "1.8.0"; + edition = "2021"; + sha256 = "0z7rpayidhdqs4sdzjhh26z5155c1n94fycqni9793n4zjz5xbhp"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "async-lock"; + packageId = "async-lock 3.3.0"; + } + { + name = "async-task"; + packageId = "async-task"; + } + { + name = "concurrent-queue"; + packageId = "concurrent-queue"; + } + { + name = "fastrand"; + packageId = "fastrand 2.0.1"; + } + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + usesDefaultFeatures = false; + } + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + usesDefaultFeatures = false; + target = { target, features }: (builtins.elem "wasm" target."family"); + features = [ "std" ]; + } + { + name = "slab"; + packageId = "slab"; + } + ]; + devDependencies = [ + { + name = "fastrand"; + packageId = "fastrand 2.0.1"; + } + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + } + ]; + + }; + "async-global-executor" = rec { + crateName = "async-global-executor"; + version = "2.4.1"; + edition = "2021"; + sha256 = "1762s45cc134d38rrv0hyp41hv4iv6nmx59vswid2p0il8rvdc85"; + authors = [ + "Marc-Antoine Perennou " + ]; + dependencies = [ + { + name = "async-channel"; + packageId = "async-channel 2.1.1"; + } + { + name = "async-executor"; + packageId = "async-executor"; + } + { + name = "async-io"; + packageId = "async-io 2.3.1"; + optional = true; + } + { + name = "async-lock"; + packageId = "async-lock 3.3.0"; + } + { + name = "blocking"; + packageId = "blocking"; + } + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + } + { + name = "once_cell"; + packageId = "once_cell"; + } + ]; + features = { + "async-io" = [ "dep:async-io" ]; + "default" = [ "async-io" ]; + "tokio" = [ "tokio-crate" ]; + "tokio-crate" = [ "dep:tokio-crate" ]; + "tokio02" = [ "tokio02-crate" ]; + "tokio02-crate" = [ "dep:tokio02-crate" ]; + "tokio03" = [ "tokio03-crate" ]; + "tokio03-crate" = [ "dep:tokio03-crate" ]; + }; + resolvedDefaultFeatures = [ "async-io" "default" ]; + }; + "async-io 1.13.0" = rec { + crateName = "async-io"; + version = "1.13.0"; + edition = "2018"; + sha256 = "1byj7lpw0ahk6k63sbc9859v68f28hpaab41dxsjj1ggjdfv9i8g"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "async-lock"; + packageId = "async-lock 2.8.0"; + } + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "concurrent-queue"; + packageId = "concurrent-queue"; + } + { + name = "futures-lite"; + packageId = "futures-lite 1.13.0"; + } + { + name = "log"; + packageId = "log 0.4.20"; + } + { + name = "parking"; + packageId = "parking"; + } + { + name = "polling"; + packageId = "polling 2.8.0"; + } + { + name = "rustix"; + packageId = "rustix 0.37.27"; + usesDefaultFeatures = false; + features = [ "std" "fs" ]; + } + { + name = "slab"; + packageId = "slab"; + } + { + name = "socket2"; + packageId = "socket2 0.4.10"; + features = [ "all" ]; + } + { + name = "waker-fn"; + packageId = "waker-fn"; + } + ]; + buildDependencies = [ + { + name = "autocfg"; + packageId = "autocfg 1.1.0"; + } + ]; + + }; + "async-io 2.3.1" = rec { + crateName = "async-io"; + version = "2.3.1"; + edition = "2021"; + sha256 = "0rggn074kbqxxajci1aq14b17gp75rw9l6rpbazcv9q0bc6ap5wg"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "async-lock"; + packageId = "async-lock 3.3.0"; + } + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "concurrent-queue"; + packageId = "concurrent-queue"; + } + { + name = "futures-io"; + packageId = "futures-io"; + usesDefaultFeatures = false; + features = [ "std" ]; + } + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + usesDefaultFeatures = false; + } + { + name = "parking"; + packageId = "parking"; + } + { + name = "polling"; + packageId = "polling 3.4.0"; + } + { + name = "rustix"; + packageId = "rustix 0.38.28"; + usesDefaultFeatures = false; + features = [ "fs" "net" "std" ]; + } + { + name = "slab"; + packageId = "slab"; + } + { + name = "tracing"; + packageId = "tracing"; + usesDefaultFeatures = false; + } + { + name = "windows-sys"; + packageId = "windows-sys 0.52.0"; + target = { target, features }: (target."windows" or false); + features = [ "Win32_Foundation" ]; + } + ]; + + }; + "async-lock 2.8.0" = rec { + crateName = "async-lock"; + version = "2.8.0"; + edition = "2018"; + sha256 = "0asq5xdzgp3d5m82y5rg7a0k9q0g95jy6mgc7ivl334x7qlp4wi8"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "event-listener"; + packageId = "event-listener 2.5.3"; + } + ]; + + }; + "async-lock 3.3.0" = rec { + crateName = "async-lock"; + version = "3.3.0"; + edition = "2021"; + sha256 = "0yxflkfw46rad4lv86f59b5z555dlfmg1riz1n8830rgi0qb8d6h"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "event-listener"; + packageId = "event-listener 4.0.1"; + usesDefaultFeatures = false; + } + { + name = "event-listener-strategy"; + packageId = "event-listener-strategy"; + usesDefaultFeatures = false; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + } + ]; + features = { + "default" = [ "std" ]; + "std" = [ "event-listener/std" "event-listener-strategy/std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "async-std" = rec { + crateName = "async-std"; + version = "1.12.0"; + edition = "2018"; + sha256 = "0pbgxhyb97h4n0451r26njvr20ywqsbm6y1wjllnp4if82s5nmk2"; + authors = [ + "Stjepan Glavina " + "Yoshua Wuyts " + "Friedel Ziegelmayer " + "Contributors to async-std" + ]; + dependencies = [ + { + name = "async-channel"; + packageId = "async-channel 1.9.0"; + optional = true; + } + { + name = "async-global-executor"; + packageId = "async-global-executor"; + optional = true; + target = { target, features }: (!("unknown" == target."os")); + features = [ "async-io" ]; + } + { + name = "async-io"; + packageId = "async-io 1.13.0"; + optional = true; + target = { target, features }: (!("unknown" == target."os")); + } + { + name = "async-lock"; + packageId = "async-lock 2.8.0"; + optional = true; + } + { + name = "crossbeam-utils"; + packageId = "crossbeam-utils"; + optional = true; + } + { + name = "futures-channel"; + packageId = "futures-channel"; + optional = true; + target = { target, features }: ("wasm32" == target."arch"); + } + { + name = "futures-core"; + packageId = "futures-core"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "futures-io"; + packageId = "futures-io"; + optional = true; + } + { + name = "futures-lite"; + packageId = "futures-lite 1.13.0"; + optional = true; + target = { target, features }: (!("unknown" == target."os")); + } + { + name = "gloo-timers"; + packageId = "gloo-timers"; + optional = true; + target = { target, features }: ("wasm32" == target."arch"); + features = [ "futures" ]; + } + { + name = "kv-log-macro"; + packageId = "kv-log-macro"; + optional = true; + } + { + name = "log"; + packageId = "log 0.4.20"; + optional = true; + features = [ "kv_unstable" ]; + } + { + name = "memchr"; + packageId = "memchr"; + optional = true; + } + { + name = "once_cell"; + packageId = "once_cell"; + optional = true; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + optional = true; + } + { + name = "pin-utils"; + packageId = "pin-utils"; + optional = true; + } + { + name = "slab"; + packageId = "slab"; + optional = true; + } + { + name = "wasm-bindgen-futures"; + packageId = "wasm-bindgen-futures"; + optional = true; + target = { target, features }: ("wasm32" == target."arch"); + } + ]; + features = { + "alloc" = [ "futures-core/alloc" "pin-project-lite" ]; + "async-attributes" = [ "dep:async-attributes" ]; + "async-channel" = [ "dep:async-channel" ]; + "async-global-executor" = [ "dep:async-global-executor" ]; + "async-io" = [ "dep:async-io" ]; + "async-lock" = [ "dep:async-lock" ]; + "async-process" = [ "dep:async-process" ]; + "attributes" = [ "async-attributes" ]; + "crossbeam-utils" = [ "dep:crossbeam-utils" ]; + "default" = [ "std" "async-global-executor" "async-io" "futures-lite" "kv-log-macro" "log" "pin-project-lite" "gloo-timers" ]; + "docs" = [ "attributes" "unstable" "default" ]; + "futures-channel" = [ "dep:futures-channel" ]; + "futures-core" = [ "dep:futures-core" ]; + "futures-io" = [ "dep:futures-io" ]; + "futures-lite" = [ "dep:futures-lite" ]; + "gloo-timers" = [ "dep:gloo-timers" ]; + "kv-log-macro" = [ "dep:kv-log-macro" ]; + "log" = [ "dep:log" ]; + "memchr" = [ "dep:memchr" ]; + "once_cell" = [ "dep:once_cell" ]; + "pin-project-lite" = [ "dep:pin-project-lite" ]; + "pin-utils" = [ "dep:pin-utils" ]; + "slab" = [ "dep:slab" ]; + "std" = [ "alloc" "crossbeam-utils" "futures-core/std" "futures-io" "memchr" "once_cell" "pin-utils" "slab" "wasm-bindgen-futures" "futures-channel" "async-channel" "async-lock" ]; + "surf" = [ "dep:surf" ]; + "tokio02" = [ "async-global-executor/tokio02" ]; + "tokio03" = [ "async-global-executor/tokio03" ]; + "tokio1" = [ "async-global-executor/tokio" ]; + "unstable" = [ "std" "async-io" "async-process" ]; + "wasm-bindgen-futures" = [ "dep:wasm-bindgen-futures" ]; + }; + resolvedDefaultFeatures = [ "alloc" "async-channel" "async-global-executor" "async-io" "async-lock" "crossbeam-utils" "default" "futures-channel" "futures-core" "futures-io" "futures-lite" "gloo-timers" "kv-log-macro" "log" "memchr" "once_cell" "pin-project-lite" "pin-utils" "slab" "std" "wasm-bindgen-futures" ]; + }; + "async-task" = rec { + crateName = "async-task"; + version = "4.7.0"; + edition = "2018"; + sha256 = "16975vx6aqy5yf16fs9xz5vx1zq8mwkzfmykvcilc1j7b6c6xczv"; + authors = [ + "Stjepan Glavina " + ]; + features = { + "default" = [ "std" ]; + "portable-atomic" = [ "dep:portable-atomic" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; "async-trait" = rec { crateName = "async-trait"; version = "0.1.77"; @@ -712,6 +1177,19 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; + "atomic-waker" = rec { + crateName = "atomic-waker"; + version = "1.1.2"; + edition = "2018"; + sha256 = "1h5av1lw56m0jf0fd3bchxq8a30xv0b4wv8s4zkp4s0i7mfvs18m"; + authors = [ + "Stjepan Glavina " + "Contributors to futures-rs" + ]; + features = { + "portable-atomic" = [ "dep:portable-atomic" ]; + }; + }; "atomic-write-file" = rec { crateName = "atomic-write-file"; version = "0.1.2"; @@ -1040,6 +1518,61 @@ rec { } ]; + }; + "blocking" = rec { + crateName = "blocking"; + version = "1.5.1"; + edition = "2018"; + sha256 = "064i3d6b8ln34fgdw49nmx9m36bwi3r3nv8c9xhcrpf4ilz92dva"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "async-channel"; + packageId = "async-channel 2.1.1"; + } + { + name = "async-lock"; + packageId = "async-lock 3.3.0"; + target = { target, features }: (!(builtins.elem "wasm" target."family")); + } + { + name = "async-task"; + packageId = "async-task"; + } + { + name = "fastrand"; + packageId = "fastrand 2.0.1"; + } + { + name = "futures-io"; + packageId = "futures-io"; + usesDefaultFeatures = false; + features = [ "std" ]; + } + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + usesDefaultFeatures = false; + } + { + name = "piper"; + packageId = "piper"; + } + { + name = "tracing"; + packageId = "tracing"; + usesDefaultFeatures = false; + } + ]; + devDependencies = [ + { + name = "futures-lite"; + packageId = "futures-lite 2.2.0"; + } + ]; + }; "build_html" = rec { crateName = "build_html"; @@ -1601,7 +2134,7 @@ rec { "loom" = [ "dep:loom" ]; "portable-atomic" = [ "dep:portable-atomic" ]; }; - resolvedDefaultFeatures = [ "std" ]; + resolvedDefaultFeatures = [ "default" "std" ]; }; "config" = rec { crateName = "config"; @@ -2791,7 +3324,32 @@ rec { ]; }; - "fastrand" = rec { + "fastrand 1.9.0" = rec { + crateName = "fastrand"; + version = "1.9.0"; + edition = "2018"; + sha256 = "1gh12m56265ihdbzh46bhh0jf74i197wm51jg1cw75q7ggi96475"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "instant"; + packageId = "instant"; + target = { target, features }: (("wasm32" == target."arch") && (!("wasi" == target."os"))); + } + ]; + devDependencies = [ + { + name = "instant"; + packageId = "instant"; + target = {target, features}: (("wasm32" == target."arch") && (!("wasi" == target."os"))); + features = [ "wasm-bindgen" ]; + } + ]; + + }; + "fastrand 2.0.1" = rec { crateName = "fastrand"; version = "2.0.1"; edition = "2018"; @@ -3006,7 +3564,7 @@ rec { dependencies = [ { name = "async-channel"; - packageId = "async-channel"; + packageId = "async-channel 2.1.1"; } { name = "async-trait"; @@ -3615,6 +4173,109 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; + "futures-lite 1.13.0" = rec { + crateName = "futures-lite"; + version = "1.13.0"; + edition = "2018"; + sha256 = "1kkbqhaib68nzmys2dc8j9fl2bwzf2s91jfk13lb2q3nwhfdbaa9"; + authors = [ + "Stjepan Glavina " + "Contributors to futures-rs" + ]; + dependencies = [ + { + name = "fastrand"; + packageId = "fastrand 1.9.0"; + optional = true; + } + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-io"; + packageId = "futures-io"; + optional = true; + } + { + name = "memchr"; + packageId = "memchr"; + optional = true; + } + { + name = "parking"; + packageId = "parking"; + optional = true; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + } + { + name = "waker-fn"; + packageId = "waker-fn"; + optional = true; + } + ]; + features = { + "default" = [ "std" ]; + "fastrand" = [ "dep:fastrand" ]; + "futures-io" = [ "dep:futures-io" ]; + "memchr" = [ "dep:memchr" ]; + "parking" = [ "dep:parking" ]; + "std" = [ "alloc" "fastrand" "futures-io" "parking" "memchr" "waker-fn" ]; + "waker-fn" = [ "dep:waker-fn" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "fastrand" "futures-io" "memchr" "parking" "std" "waker-fn" ]; + }; + "futures-lite 2.2.0" = rec { + crateName = "futures-lite"; + version = "2.2.0"; + edition = "2021"; + sha256 = "1flj85i6xm0rjicxixmajrp6rhq8i4bnbzffmrd6h23ln8jshns4"; + authors = [ + "Stjepan Glavina " + "Contributors to futures-rs" + ]; + dependencies = [ + { + name = "fastrand"; + packageId = "fastrand 2.0.1"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "futures-core"; + packageId = "futures-core"; + usesDefaultFeatures = false; + } + { + name = "futures-io"; + packageId = "futures-io"; + optional = true; + } + { + name = "parking"; + packageId = "parking"; + optional = true; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + } + ]; + features = { + "default" = [ "race" "std" ]; + "fastrand" = [ "dep:fastrand" ]; + "futures-io" = [ "dep:futures-io" ]; + "memchr" = [ "dep:memchr" ]; + "parking" = [ "dep:parking" ]; + "race" = [ "fastrand" ]; + "std" = [ "alloc" "fastrand/std" "futures-io" "parking" ]; + }; + resolvedDefaultFeatures = [ "alloc" "default" "fastrand" "futures-io" "parking" "race" "std" ]; + }; "futures-macro" = rec { crateName = "futures-macro"; version = "0.3.29"; @@ -4438,6 +5099,41 @@ rec { }; resolvedDefaultFeatures = [ "v2_58" "v2_60" "v2_62" "v2_64" "v2_66" ]; }; + "gloo-timers" = rec { + crateName = "gloo-timers"; + version = "0.2.6"; + edition = "2018"; + sha256 = "0p2yqcxw0q9kclhwpgshq1r4ijns07nmmagll3lvrgl7pdk5m6cv"; + authors = [ + "Rust and WebAssembly Working Group" + ]; + dependencies = [ + { + name = "futures-channel"; + packageId = "futures-channel"; + optional = true; + } + { + name = "futures-core"; + packageId = "futures-core"; + optional = true; + } + { + name = "js-sys"; + packageId = "js-sys"; + } + { + name = "wasm-bindgen"; + packageId = "wasm-bindgen"; + } + ]; + features = { + "futures" = [ "futures-core" "futures-channel" ]; + "futures-channel" = [ "dep:futures-channel" ]; + "futures-core" = [ "dep:futures-core" ]; + }; + resolvedDefaultFeatures = [ "default" "futures" "futures-channel" "futures-core" ]; + }; "gm-control-panel" = rec { crateName = "gm-control-panel"; version = "0.1.0"; @@ -5580,7 +6276,7 @@ rec { } { name = "socket2"; - packageId = "socket2"; + packageId = "socket2 0.5.5"; optional = true; features = [ "all" ]; } @@ -6082,6 +6778,28 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; + "instant" = rec { + crateName = "instant"; + version = "0.1.12"; + edition = "2018"; + sha256 = "0b2bx5qdlwayriidhrag8vhy10kdfimfhmb3jnjmsz2h9j1bwnvs"; + authors = [ + "sebcrozet " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + } + ]; + features = { + "js-sys" = [ "dep:js-sys" ]; + "stdweb" = [ "dep:stdweb" ]; + "wasm-bindgen" = [ "js-sys" "wasm-bindgen_rs" "web-sys" ]; + "wasm-bindgen_rs" = [ "dep:wasm-bindgen_rs" ]; + "web-sys" = [ "dep:web-sys" ]; + }; + }; "intl-memoizer" = rec { crateName = "intl-memoizer"; version = "0.5.1"; @@ -6127,6 +6845,50 @@ rec { ]; }; + "io-lifetimes" = rec { + crateName = "io-lifetimes"; + version = "1.0.11"; + edition = "2018"; + sha256 = "1hph5lz4wd3drnn6saakwxr497liznpfnv70via6s0v8x6pbkrza"; + authors = [ + "Dan Gohman " + ]; + dependencies = [ + { + name = "hermit-abi"; + packageId = "hermit-abi"; + optional = true; + target = { target, features }: ("hermit" == target."os"); + } + { + name = "libc"; + packageId = "libc"; + optional = true; + target = { target, features }: (!(target."windows" or false)); + } + { + name = "windows-sys"; + packageId = "windows-sys 0.48.0"; + optional = true; + target = { target, features }: (target."windows" or false); + features = [ "Win32_Foundation" "Win32_Storage_FileSystem" "Win32_Networking_WinSock" "Win32_Security" "Win32_System_IO" "Win32_System_Threading" ]; + } + ]; + features = { + "async-std" = [ "dep:async-std" ]; + "close" = [ "libc" "hermit-abi" "windows-sys" ]; + "default" = [ "close" ]; + "fs-err" = [ "dep:fs-err" ]; + "hermit-abi" = [ "dep:hermit-abi" ]; + "libc" = [ "dep:libc" ]; + "mio" = [ "dep:mio" ]; + "os_pipe" = [ "dep:os_pipe" ]; + "socket2" = [ "dep:socket2" ]; + "tokio" = [ "dep:tokio" ]; + "windows-sys" = [ "dep:windows-sys" ]; + }; + resolvedDefaultFeatures = [ "close" "hermit-abi" "libc" "windows-sys" ]; + }; "ipnet" = rec { crateName = "ipnet"; version = "2.9.0"; @@ -6212,7 +6974,7 @@ rec { } { name = "rustix"; - packageId = "rustix"; + packageId = "rustix 0.38.28"; target = { target, features }: (!((target."windows" or false) || ("hermit" == target."os") || ("unknown" == target."os"))); features = [ "termios" ]; } @@ -6226,7 +6988,7 @@ rec { devDependencies = [ { name = "rustix"; - packageId = "rustix"; + packageId = "rustix 0.38.28"; target = {target, features}: (!((target."windows" or false) || ("hermit" == target."os") || ("unknown" == target."os"))); features = [ "stdio" ]; } @@ -6334,6 +7096,10 @@ rec { then lib.cleanSourceWith { filter = sourceFilter; src = ./kifu/core; } else ./kifu/core; dependencies = [ + { + name = "async-std"; + packageId = "async-std"; + } { name = "chrono"; packageId = "chrono"; @@ -6367,10 +7133,6 @@ rec { name = "thiserror"; packageId = "thiserror"; } - { - name = "typeshare"; - packageId = "typeshare"; - } ]; devDependencies = [ { @@ -6397,6 +7159,14 @@ rec { then lib.cleanSourceWith { filter = sourceFilter; src = ./kifu/gtk; } else ./kifu/gtk; dependencies = [ + { + name = "async-channel"; + packageId = "async-channel 2.1.1"; + } + { + name = "async-std"; + packageId = "async-std"; + } { name = "cairo-rs"; packageId = "cairo-rs"; @@ -6453,6 +7223,23 @@ rec { }; resolvedDefaultFeatures = [ "screenplay" ]; }; + "kv-log-macro" = rec { + crateName = "kv-log-macro"; + version = "1.0.7"; + edition = "2018"; + sha256 = "0zwp4bxkkp87rl7xy2dain77z977rvcry1gmr5bssdbn541v7s0d"; + authors = [ + "Yoshua Wuyts " + ]; + dependencies = [ + { + name = "log"; + packageId = "log 0.4.20"; + features = [ "kv_unstable" ]; + } + ]; + + }; "language-tags" = rec { crateName = "language-tags"; version = "0.2.2"; @@ -6690,7 +7477,23 @@ rec { }; resolvedDefaultFeatures = [ "bundled" "bundled_bindings" "cc" "pkg-config" "unlock_notify" "vcpkg" ]; }; - "linux-raw-sys" = rec { + "linux-raw-sys 0.3.8" = rec { + crateName = "linux-raw-sys"; + version = "0.3.8"; + edition = "2018"; + sha256 = "068mbigb3frrxvbi5g61lx25kksy98f2qgkvc4xg8zxznwp98lzg"; + authors = [ + "Dan Gohman " + ]; + features = { + "compiler_builtins" = [ "dep:compiler_builtins" ]; + "core" = [ "dep:core" ]; + "default" = [ "std" "general" "errno" ]; + "rustc-dep-of-std" = [ "core" "compiler_builtins" "no_std" ]; + }; + resolvedDefaultFeatures = [ "errno" "general" "ioctl" "no_std" ]; + }; + "linux-raw-sys 0.4.12" = rec { crateName = "linux-raw-sys"; version = "0.4.12"; edition = "2021"; @@ -6704,7 +7507,7 @@ rec { "default" = [ "std" "general" "errno" ]; "rustc-dep-of-std" = [ "core" "compiler_builtins" "no_std" ]; }; - resolvedDefaultFeatures = [ "elf" "errno" "general" "ioctl" "no_std" ]; + resolvedDefaultFeatures = [ "elf" "errno" "general" "if_ether" "ioctl" "net" "netlink" "no_std" "prctl" ]; }; "lock_api" = rec { crateName = "lock_api"; @@ -6774,6 +7577,21 @@ rec { authors = [ "The Rust Project Developers" ]; + dependencies = [ + { + name = "value-bag"; + packageId = "value-bag"; + optional = true; + usesDefaultFeatures = false; + } + ]; + devDependencies = [ + { + name = "value-bag"; + packageId = "value-bag"; + features = [ "test" ]; + } + ]; features = { "kv_unstable" = [ "value-bag" ]; "kv_unstable_serde" = [ "kv_unstable_std" "value-bag/serde" "serde" ]; @@ -6784,7 +7602,7 @@ rec { "sval_ref" = [ "dep:sval_ref" ]; "value-bag" = [ "dep:value-bag" ]; }; - resolvedDefaultFeatures = [ "std" ]; + resolvedDefaultFeatures = [ "kv_unstable" "std" "value-bag" ]; }; "logger" = rec { crateName = "logger"; @@ -8306,6 +9124,41 @@ rec { ]; }; + "piper" = rec { + crateName = "piper"; + version = "0.2.1"; + edition = "2018"; + sha256 = "1m45fkdq7q5l9mv3b0ra10qwm0kb67rjp2q8y91958gbqjqk33b6"; + authors = [ + "Stjepan Glavina " + "John Nunley " + ]; + dependencies = [ + { + name = "atomic-waker"; + packageId = "atomic-waker"; + } + { + name = "fastrand"; + packageId = "fastrand 2.0.1"; + usesDefaultFeatures = false; + } + { + name = "futures-io"; + packageId = "futures-io"; + optional = true; + } + ]; + features = { + "default" = [ "std" ]; + "futures-io" = [ "dep:futures-io" ]; + "portable-atomic" = [ "atomic-waker/portable-atomic" "portable_atomic_crate" "portable-atomic-util" ]; + "portable-atomic-util" = [ "dep:portable-atomic-util" ]; + "portable_atomic_crate" = [ "dep:portable_atomic_crate" ]; + "std" = [ "fastrand/std" "futures-io" ]; + }; + resolvedDefaultFeatures = [ "default" "futures-io" "std" ]; + }; "pkcs1" = rec { crateName = "pkcs1"; version = "0.7.5"; @@ -8468,6 +9321,106 @@ rec { features = { }; }; + "polling 2.8.0" = rec { + crateName = "polling"; + version = "2.8.0"; + edition = "2018"; + sha256 = "1kixxfq1af1k7gkmmk9yv4j2krpp4fji2r8j4cz6p6d7ihz34bab"; + authors = [ + "Stjepan Glavina " + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags 1.3.2"; + target = { target, features }: (target."windows" or false); + } + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "concurrent-queue"; + packageId = "concurrent-queue"; + target = { target, features }: (target."windows" or false); + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: ((target."unix" or false) || ("fuchsia" == target."os") || ("vxworks" == target."os")); + } + { + name = "log"; + packageId = "log 0.4.20"; + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + target = { target, features }: (target."windows" or false); + } + { + name = "windows-sys"; + packageId = "windows-sys 0.48.0"; + target = { target, features }: (target."windows" or false); + features = [ "Win32_Foundation" "Win32_Networking_WinSock" "Win32_Storage_FileSystem" "Win32_System_IO" "Win32_System_LibraryLoader" "Win32_System_Threading" "Win32_System_WindowsProgramming" ]; + } + ]; + buildDependencies = [ + { + name = "autocfg"; + packageId = "autocfg 1.1.0"; + } + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "polling 3.4.0" = rec { + crateName = "polling"; + version = "3.4.0"; + edition = "2021"; + sha256 = "052am20b5r03nwhpnjw86rv3dwsdabvb07anv3fqxfbs65r4w19h"; + authors = [ + "Stjepan Glavina " + "John Nunley " + ]; + dependencies = [ + { + name = "cfg-if"; + packageId = "cfg-if"; + } + { + name = "concurrent-queue"; + packageId = "concurrent-queue"; + target = { target, features }: (target."windows" or false); + } + { + name = "pin-project-lite"; + packageId = "pin-project-lite"; + target = { target, features }: (target."windows" or false); + } + { + name = "rustix"; + packageId = "rustix 0.38.28"; + usesDefaultFeatures = false; + target = { target, features }: ((target."unix" or false) || ("fuchsia" == target."os") || ("vxworks" == target."os")); + features = [ "event" "fs" "pipe" "process" "std" "time" ]; + } + { + name = "tracing"; + packageId = "tracing"; + usesDefaultFeatures = false; + } + { + name = "windows-sys"; + packageId = "windows-sys 0.52.0"; + target = { target, features }: (target."windows" or false); + features = [ "Wdk_Foundation" "Wdk_Storage_FileSystem" "Win32_Foundation" "Win32_Networking_WinSock" "Win32_Security" "Win32_Storage_FileSystem" "Win32_System_IO" "Win32_System_LibraryLoader" "Win32_System_Threading" "Win32_System_WindowsProgramming" ]; + } + ]; + + }; "powerfmt" = rec { crateName = "powerfmt"; version = "0.2.0"; @@ -9908,7 +10861,129 @@ rec { ]; }; - "rustix" = rec { + "rustix 0.37.27" = rec { + crateName = "rustix"; + version = "0.37.27"; + edition = "2018"; + sha256 = "1lidfswa8wbg358yrrkhfvsw0hzlvl540g4lwqszw09sg8vcma7y"; + authors = [ + "Dan Gohman " + "Jakub Konka " + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags 1.3.2"; + } + { + name = "errno"; + packageId = "errno"; + rename = "libc_errno"; + optional = true; + usesDefaultFeatures = false; + target = { target, features }: ((!(target."rustix_use_libc" or false)) && (!(target."miri" or false)) && ("linux" == target."os") && (("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")) || (("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("powerpc64" == target."arch") || ("riscv64" == target."arch") || ("mips" == target."arch") || ("mips64" == target."arch"))))); + } + { + name = "errno"; + packageId = "errno"; + rename = "libc_errno"; + usesDefaultFeatures = false; + target = { target, features }: ((!(target."windows" or false)) && ((target."rustix_use_libc" or false) || (target."miri" or false) || (!(("linux" == target."os") && (("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")) || (("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("powerpc64" == target."arch") || ("riscv64" == target."arch") || ("mips" == target."arch") || ("mips64" == target."arch")))))))); + } + { + name = "errno"; + packageId = "errno"; + rename = "libc_errno"; + usesDefaultFeatures = false; + target = { target, features }: (target."windows" or false); + } + { + name = "io-lifetimes"; + packageId = "io-lifetimes"; + optional = true; + usesDefaultFeatures = false; + features = [ "close" ]; + } + { + name = "libc"; + packageId = "libc"; + optional = true; + target = { target, features }: ((!(target."rustix_use_libc" or false)) && (!(target."miri" or false)) && ("linux" == target."os") && (("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")) || (("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("powerpc64" == target."arch") || ("riscv64" == target."arch") || ("mips" == target."arch") || ("mips64" == target."arch"))))); + features = [ "extra_traits" ]; + } + { + name = "libc"; + packageId = "libc"; + target = { target, features }: ((!(target."windows" or false)) && ((target."rustix_use_libc" or false) || (target."miri" or false) || (!(("linux" == target."os") && (("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")) || (("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("powerpc64" == target."arch") || ("riscv64" == target."arch") || ("mips" == target."arch") || ("mips64" == target."arch")))))))); + features = [ "extra_traits" ]; + } + { + name = "linux-raw-sys"; + packageId = "linux-raw-sys 0.3.8"; + usesDefaultFeatures = false; + target = { target, features }: ((("android" == target."os") || ("linux" == target."os")) && ((target."rustix_use_libc" or false) || (target."miri" or false) || (!(("linux" == target."os") && (("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")) || (("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("powerpc64" == target."arch") || ("riscv64" == target."arch") || ("mips" == target."arch") || ("mips64" == target."arch")))))))); + features = [ "general" "ioctl" "no_std" ]; + } + { + name = "linux-raw-sys"; + packageId = "linux-raw-sys 0.3.8"; + usesDefaultFeatures = false; + target = { target, features }: ((!(target."rustix_use_libc" or false)) && (!(target."miri" or false)) && ("linux" == target."os") && (("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")) || (("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("powerpc64" == target."arch") || ("riscv64" == target."arch") || ("mips" == target."arch") || ("mips64" == target."arch"))))); + features = [ "general" "errno" "ioctl" "no_std" ]; + } + { + name = "windows-sys"; + packageId = "windows-sys 0.48.0"; + target = { target, features }: (target."windows" or false); + features = [ "Win32_Foundation" "Win32_Networking_WinSock" "Win32_NetworkManagement_IpHelper" "Win32_System_Threading" ]; + } + ]; + devDependencies = [ + { + name = "errno"; + packageId = "errno"; + rename = "libc_errno"; + usesDefaultFeatures = false; + } + { + name = "io-lifetimes"; + packageId = "io-lifetimes"; + usesDefaultFeatures = false; + features = [ "close" ]; + } + { + name = "libc"; + packageId = "libc"; + } + ]; + features = { + "all-apis" = [ "fs" "io_uring" "mm" "net" "param" "process" "procfs" "pty" "rand" "runtime" "termios" "thread" "time" ]; + "all-impls" = [ "os_pipe" "fs-err" ]; + "alloc" = [ "dep:alloc" ]; + "cc" = [ "dep:cc" ]; + "compiler_builtins" = [ "dep:compiler_builtins" ]; + "core" = [ "dep:core" ]; + "default" = [ "std" "use-libc-auxv" ]; + "fs-err" = [ "io-lifetimes/fs-err" ]; + "io-lifetimes" = [ "dep:io-lifetimes" ]; + "io_uring" = [ "fs" "net" ]; + "itoa" = [ "dep:itoa" ]; + "libc" = [ "dep:libc" ]; + "libc_errno" = [ "dep:libc_errno" ]; + "linux_latest" = [ "linux_4_11" ]; + "once_cell" = [ "dep:once_cell" ]; + "os_pipe" = [ "io-lifetimes/os_pipe" ]; + "param" = [ "fs" ]; + "procfs" = [ "once_cell" "itoa" "fs" ]; + "pty" = [ "itoa" "fs" ]; + "rustc-dep-of-std" = [ "core" "alloc" "compiler_builtins" "linux-raw-sys/rustc-dep-of-std" "bitflags/rustc-dep-of-std" ]; + "std" = [ "io-lifetimes" ]; + "use-libc" = [ "libc_errno" "libc" ]; + "use-libc-auxv" = [ "libc" ]; + }; + resolvedDefaultFeatures = [ "fs" "io-lifetimes" "std" ]; + }; + "rustix 0.38.28" = rec { crateName = "rustix"; version = "0.38.28"; edition = "2021"; @@ -9962,14 +11037,14 @@ rec { } { name = "linux-raw-sys"; - packageId = "linux-raw-sys"; + packageId = "linux-raw-sys 0.4.12"; usesDefaultFeatures = false; target = { target, features }: ((("android" == target."os") || ("linux" == target."os")) && ((target."rustix_use_libc" or false) || (target."miri" or false) || (!(("linux" == target."os") && ("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("riscv64" == target."arch") || ((target."rustix_use_experimental_asm" or false) && ("powerpc64" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips32r6" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips64" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips64r6" == target."arch")) || ("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width"))))))); features = [ "general" "ioctl" "no_std" ]; } { name = "linux-raw-sys"; - packageId = "linux-raw-sys"; + packageId = "linux-raw-sys 0.4.12"; usesDefaultFeatures = false; target = { target, features }: ((!(target."rustix_use_libc" or false)) && (!(target."miri" or false)) && ("linux" == target."os") && ("little" == target."endian") && (("arm" == target."arch") || (("aarch64" == target."arch") && ("64" == target."pointer_width")) || ("riscv64" == target."arch") || ((target."rustix_use_experimental_asm" or false) && ("powerpc64" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips32r6" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips64" == target."arch")) || ((target."rustix_use_experimental_asm" or false) && ("mips64r6" == target."arch")) || ("x86" == target."arch") || (("x86_64" == target."arch") && ("64" == target."pointer_width")))); features = [ "general" "errno" "ioctl" "no_std" "elf" ]; @@ -10015,7 +11090,7 @@ rec { "thread" = [ "linux-raw-sys/prctl" ]; "use-libc" = [ "libc_errno" "libc" ]; }; - resolvedDefaultFeatures = [ "alloc" "default" "fs" "std" "termios" "use-libc-auxv" ]; + resolvedDefaultFeatures = [ "alloc" "default" "event" "fs" "net" "pipe" "process" "std" "termios" "time" "use-libc-auxv" ]; }; "rustls-pemfile" = rec { crateName = "rustls-pemfile"; @@ -10706,7 +11781,33 @@ rec { }; resolvedDefaultFeatures = [ "const_generics" "const_new" "union" ]; }; - "socket2" = rec { + "socket2 0.4.10" = rec { + crateName = "socket2"; + version = "0.4.10"; + edition = "2018"; + sha256 = "03ack54dxhgfifzsj14k7qa3r5c9wqy3v6mqhlim99cc03y1cycz"; + authors = [ + "Alex Crichton " + "Thomas de Zeeuw " + ]; + dependencies = [ + { + name = "libc"; + packageId = "libc"; + target = { target, features }: (target."unix" or false); + } + { + name = "winapi"; + packageId = "winapi"; + target = { target, features }: (target."windows" or false); + features = [ "handleapi" "ws2ipdef" "ws2tcpip" ]; + } + ]; + features = { + }; + resolvedDefaultFeatures = [ "all" ]; + }; + "socket2 0.5.5" = rec { crateName = "socket2"; version = "0.5.5"; edition = "2021"; @@ -12010,7 +13111,7 @@ rec { } { name = "fastrand"; - packageId = "fastrand"; + packageId = "fastrand 2.0.1"; } { name = "redox_syscall"; @@ -12019,7 +13120,7 @@ rec { } { name = "rustix"; - packageId = "rustix"; + packageId = "rustix 0.38.28"; target = { target, features }: ((target."unix" or false) || ("wasi" == target."os")); features = [ "fs" ]; } @@ -12425,7 +13526,7 @@ rec { } { name = "socket2"; - packageId = "socket2"; + packageId = "socket2 0.5.5"; optional = true; target = { target, features }: (!(builtins.elem "wasm" target."family")); features = [ "all" ]; @@ -12450,7 +13551,7 @@ rec { } { name = "socket2"; - packageId = "socket2"; + packageId = "socket2 0.5.5"; target = {target, features}: (!(builtins.elem "wasm" target."family")); } { @@ -13556,6 +14657,28 @@ rec { }; resolvedDefaultFeatures = [ "default" "getrandom" "rng" "std" "v4" ]; }; + "value-bag" = rec { + crateName = "value-bag"; + version = "1.7.0"; + edition = "2021"; + sha256 = "02r8wccrzi3bzlkrslkcfw9pwp8kwif9szif2i9arn9dzqx44vhj"; + authors = [ + "Ashley Mannix " + ]; + features = { + "alloc" = [ "value-bag-sval2?/alloc" "value-bag-serde1?/alloc" ]; + "error" = [ "std" ]; + "owned" = [ "alloc" "value-bag-serde1?/owned" ]; + "serde" = [ "serde1" ]; + "serde1" = [ "alloc" "value-bag-serde1" "value-bag-sval2?/serde1" ]; + "std" = [ "alloc" "value-bag-sval2?/std" "value-bag-serde1?/std" ]; + "sval" = [ "sval2" ]; + "sval2" = [ "value-bag-sval2" ]; + "test" = [ "std" ]; + "value-bag-serde1" = [ "dep:value-bag-serde1" ]; + "value-bag-sval2" = [ "dep:value-bag-sval2" ]; + }; + }; "vcpkg" = rec { crateName = "vcpkg"; version = "0.2.15"; @@ -13658,6 +14781,16 @@ rec { } ]; + }; + "waker-fn" = rec { + crateName = "waker-fn"; + version = "1.1.1"; + edition = "2018"; + sha256 = "142n74wlmpwcazfb5v7vhnzj3lb3r97qy8mzpjdpg345aizm3i7k"; + authors = [ + "Stjepan Glavina " + ]; + }; "want" = rec { crateName = "want"; @@ -14549,7 +15682,7 @@ rec { features = { "debug" = [ "impl-debug" ]; }; - resolvedDefaultFeatures = [ "consoleapi" "errhandlingapi" "fileapi" "minwinbase" "minwindef" "ntdef" "ntsecapi" "processenv" "profileapi" "std" "sysinfoapi" "timezoneapi" "winbase" "wincon" "winerror" "winnt" "winsock2" "ws2def" ]; + resolvedDefaultFeatures = [ "consoleapi" "errhandlingapi" "fileapi" "handleapi" "minwinbase" "minwindef" "ntdef" "ntsecapi" "processenv" "profileapi" "std" "sysinfoapi" "timezoneapi" "winbase" "wincon" "winerror" "winnt" "winsock2" "ws2def" "ws2ipdef" "ws2tcpip" ]; }; "winapi-i686-pc-windows-gnu" = rec { crateName = "winapi-i686-pc-windows-gnu"; @@ -14898,7 +16031,7 @@ rec { "Win32_Web" = [ "Win32" ]; "Win32_Web_InternetExplorer" = [ "Win32_Web" ]; }; - resolvedDefaultFeatures = [ "Win32" "Win32_Foundation" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Security_Authentication" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_Security_Cryptography" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_IO" "Win32_System_Memory" "Win32_System_Pipes" "Win32_System_Registry" "Win32_System_SystemServices" "Win32_System_Threading" "Win32_System_Time" "Win32_System_WindowsProgramming" "Win32_UI" "Win32_UI_Shell" "default" ]; + resolvedDefaultFeatures = [ "Win32" "Win32_Foundation" "Win32_NetworkManagement" "Win32_NetworkManagement_IpHelper" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Security_Authentication" "Win32_Security_Authentication_Identity" "Win32_Security_Credentials" "Win32_Security_Cryptography" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_IO" "Win32_System_LibraryLoader" "Win32_System_Memory" "Win32_System_Pipes" "Win32_System_Registry" "Win32_System_SystemServices" "Win32_System_Threading" "Win32_System_Time" "Win32_System_WindowsProgramming" "Win32_UI" "Win32_UI_Shell" "default" ]; }; "windows-sys 0.52.0" = rec { crateName = "windows-sys"; @@ -15145,7 +16278,7 @@ rec { "Win32_Web" = [ "Win32" ]; "Win32_Web_InternetExplorer" = [ "Win32_Web" ]; }; - resolvedDefaultFeatures = [ "Win32" "Win32_Foundation" "Win32_NetworkManagement" "Win32_NetworkManagement_IpHelper" "Win32_Networking" "Win32_Networking_WinSock" "Win32_System" "Win32_System_Com" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_Threading" "Win32_UI" "Win32_UI_Shell" "default" ]; + resolvedDefaultFeatures = [ "Wdk" "Wdk_Foundation" "Wdk_Storage" "Wdk_Storage_FileSystem" "Win32" "Win32_Foundation" "Win32_NetworkManagement" "Win32_NetworkManagement_IpHelper" "Win32_Networking" "Win32_Networking_WinSock" "Win32_Security" "Win32_Storage" "Win32_Storage_FileSystem" "Win32_System" "Win32_System_Com" "Win32_System_Console" "Win32_System_Diagnostics" "Win32_System_Diagnostics_Debug" "Win32_System_IO" "Win32_System_LibraryLoader" "Win32_System_Threading" "Win32_System_WindowsProgramming" "Win32_UI" "Win32_UI_Shell" "default" ]; }; "windows-targets 0.48.5" = rec { crateName = "windows-targets"; diff --git a/Cargo.toml b/Cargo.toml index 1812447..4363926 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ members = [ "ifc", "kifu/core", "kifu/gtk", + "l10n", "memorycache", "nom-training", "result-extended", diff --git a/l10n/Cargo.toml b/l10n/Cargo.toml new file mode 100644 index 0000000..08382b2 --- /dev/null +++ b/l10n/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "l10n" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +chrono = { version = "0.4" } +chrono-tz = { version = "0.8" } +fluent-ergonomics = { path = "../fluent-ergonomics" } +icu = { version = "1" } +icu_locid = { version = "1" } +icu_provider = { version = "1" } +sys-locale = { version = "0.3" } diff --git a/l10n/src/lib.rs b/l10n/src/lib.rs new file mode 100644 index 0000000..bbdc712 --- /dev/null +++ b/l10n/src/lib.rs @@ -0,0 +1,146 @@ +use std::ops::Deref; + +use chrono::{Datelike, FixedOffset, NaiveDate, Timelike}; +use chrono_tz::Tz; +use icu::datetime::options::length; +use icu_locid::locale; +use icu_provider::DataLocale; +use sys_locale::get_locales; + +#[derive(Clone, Copy, Debug)] +pub struct L10N {} + +impl Default for L10N { + fn default() -> Self { + Self {} + } +} + +impl L10N { + fn set_locale(&mut self, locale: String) { + unimplemented!() + } + + fn set_timezone(&mut self, zone: Tz) { + unimplemented!() + } + + // Need to take a message and turn it into a string in the current language. Except I don't + // know yet what form the message should take. Forming an adapter around fluent_ergonomics or + // even around fluent itself. I would want for the message to be statically typed, but then I + // don't know what can be the data type that gets passed in here. + fn format_message(&self) -> String { + unimplemented!() + } + + fn format_date_time_utc( + &self, + time: DateTime, + date_style: length::Date, + time_style: length::Time, + ) -> String { + unimplemented!() + } + + fn format_date_time_local( + &self, + time: DateTime, + date_style: length::Date, + time_style: length::Time, + ) -> String { + unimplemented!() + } + + fn format_date_time_tz( + &self, + time: DateTime, + date_style: length::Date, + time_style: length::Time, + ) -> String { + let options = length::Bag::from_date_time_style(date_style, time_style); + let formatter = icu::datetime::DateTimeFormatter::try_new( + &DataLocale::from(locale!("en-US")), + options.into(), + ) + .unwrap(); + let icu_time: icu::calendar::DateTime = time.into(); + let any = icu_time.to_any(); + + formatter.format_to_string(&any).unwrap() + } + + fn format_date( + &self, + time: NaiveDate, + date_style: length::Date, + time_style: length::Time, + ) -> String { + unimplemented!() + } + + fn format_f64(&self, value: f64) -> String { + unimplemented!() + } +} + +struct DateTime(chrono::DateTime); + +impl Deref for DateTime { + type Target = chrono::DateTime; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From> for DateTime { + fn from(time: chrono::DateTime) -> Self { + Self(time) + } +} + +impl From for icu::calendar::DateTime { + fn from(time: DateTime) -> Self { + // SAFETY: these unwraps should be safe since chrono dates are already valid Gregorian + // dates + icu::calendar::DateTime::try_new_gregorian_datetime( + time.year(), + time.month().try_into().unwrap(), + time.day().try_into().unwrap(), + time.hour().try_into().unwrap(), + time.minute().try_into().unwrap(), + time.second().try_into().unwrap(), + ) + .unwrap() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_formats_a_time_according_to_locale() { + let l10n = L10N::default(); + + let now = NaiveDate::from_ymd_opt(2006, 1, 2) + .unwrap() + .and_hms_opt(3, 4, 5) + .unwrap() + .and_local_timezone(Tz::UTC) + .unwrap() + .into(); + + // 202f is the code-point for a narrow non-breaking space. Presumably this is used in + // particular to ensure that the am/pm marker doesn't get split off from the time + assert_eq!( + l10n.format_date_time_tz(now, length::Date::Long, length::Time::Medium), + "January 2, 2006, 3:04:05\u{202f}AM" + ); + } + + #[test] + fn it_formats_a_number_according_to_locale() { + unimplemented!() + } +}