diff --git a/.cargo/config.in b/.cargo/config.in index 98860091b4ff..bbaa69dcd6e2 100644 --- a/.cargo/config.in +++ b/.cargo/config.in @@ -95,11 +95,6 @@ git = "https://github.com/mozilla/uniffi-rs.git" rev = "c0e64b839018728d8153ce1758d391b7782e2e21" replace-with = "vendored-sources" -[source."git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9"] -git = "https://github.com/rust-diplomat/diplomat" -rev = "8d125999893fedfdf30595e97334c21ec4b18da9" -replace-with = "vendored-sources" - [source."git+https://github.com/rust-lang/rust-bindgen?rev=86f3dbe846020e2ba573d6eb38d1434d0cbcbb40"] git = "https://github.com/rust-lang/rust-bindgen" rev = "86f3dbe846020e2ba573d6eb38d1434d0cbcbb40" @@ -110,11 +105,6 @@ git = "https://github.com/servo/rust-cssparser" rev = "aaa966d9d6ae70c4b8a62bb5e3a14c068bb7dff0" replace-with = "vendored-sources" -[source."git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873"] -git = "https://github.com/unicode-org/icu4x" -rev = "14e9a3a9857be74582abe2dfa7ab799c5eaac873" -replace-with = "vendored-sources" - # Take advantage of the fact that cargo will treat lines starting with # # as comments to add preprocessing directives. This file can thus by copied diff --git a/Cargo.lock b/Cargo.lock index 786de7d62929..741ea404eff3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -885,6 +885,15 @@ dependencies = [ "libc", ] +[[package]] +name = "core_maths" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3" +dependencies = [ + "libm", +] + [[package]] name = "coreaudio-sys" version = "0.2.14" @@ -1341,8 +1350,9 @@ dependencies = [ [[package]] name = "diplomat" -version = "0.5.2" -source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31672b3ebc3c7866c3c98726f7a9a5ac8f13962e77d3c8225f6be49a7b8c5f2" dependencies = [ "diplomat_core", "proc-macro2", @@ -1352,13 +1362,15 @@ dependencies = [ [[package]] name = "diplomat-runtime" -version = "0.5.2" -source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0f23d549a46540e26e5490cd44c64ced0d762959f1ffdec6ab0399634cf3c" [[package]] name = "diplomat_core" -version = "0.5.2" -source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfaa5e13e8b8735d2338f2836c06cd8643902ab87dda1dd07dbb351998ddc127" dependencies = [ "lazy_static", "proc-macro2", @@ -2629,9 +2641,7 @@ dependencies = [ [[package]] name = "icu_capi" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c29e1e7407081a5e425b295ef28526ca4c3cd7ce4475e1769c2863bb18b9305" +version = "1.4.0" dependencies = [ "diplomat", "diplomat-runtime", @@ -2639,17 +2649,15 @@ dependencies = [ "icu_provider", "icu_provider_adapters", "icu_segmenter", - "icu_testdata", - "log", "tinystr", "writeable", ] [[package]] name = "icu_collections" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8302d8dfd6044d3ddb3f807a5ef3d7bbca9a574959c6d6e4dc39aa7012d0d5" +checksum = "137d96353afc8544d437e8a99eceb10ab291352699573b0de5b08bda38c78c60" dependencies = [ "displaydoc", "yoke", @@ -2659,9 +2667,9 @@ dependencies = [ [[package]] name = "icu_locid" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3003f85dccfc0e238ff567693248c59153a46f4e6125ba4020b973cef4d1d335" +checksum = "5c0aa2536adc14c07e2a521e95512b75ed8ef832f0fdf9299d4a0a45d2be2a9d" dependencies = [ "displaydoc", "litemap", @@ -2671,15 +2679,29 @@ dependencies = [ ] [[package]] -name = "icu_provider" -version = "1.2.0" +name = "icu_locid_transform" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dc312a7b6148f7dfe098047ae2494d12d4034f48ade58d4f353000db376e305" +checksum = "57c17d8f6524fdca4471101dd71f0a132eb6382b5d6d7f2970441cb25f6f435a" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider", + "tinystr", + "zerovec", +] + +[[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", @@ -2688,21 +2710,22 @@ dependencies = [ [[package]] name = "icu_provider_adapters" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ae1e2bd0c41728b77e7c46e9afdec5e2127d1eedacc684724667d50c126bd3" +checksum = "a229f978260da7c3aabb68cb7dc7316589936680570fe55e50fdd3f97711a4dd" dependencies = [ "icu_locid", + "icu_locid_transform", "icu_provider", "tinystr", - "yoke", "zerovec", ] [[package]] name = "icu_provider_macros" -version = "1.2.0" -source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2abdd3a62551e8337af119c5899e600ca0c88ec8f23a46c60ba216c803dcf1a" dependencies = [ "proc-macro2", "quote", @@ -2711,30 +2734,23 @@ dependencies = [ [[package]] name = "icu_segmenter" -version = "1.2.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3300a7b6bf187be98a57264ad094f11f2e062c2e8263132af010ff522ee5495" +checksum = "b2dc1e8f4ba33a6a4956770ac5c08570f255d6605519fb3a859a0c0a270a2f8f" dependencies = [ + "core_maths", "displaydoc", "icu_collections", "icu_locid", "icu_provider", - "num-traits", + "icu_segmenter_data", "utf8_iter", "zerovec", ] [[package]] -name = "icu_testdata" -version = "1.2.0" -dependencies = [ - "icu_collections", - "icu_locid", - "icu_provider", - "icu_provider_adapters", - "icu_segmenter", - "zerovec", -] +name = "icu_segmenter_data" +version = "1.4.0" [[package]] name = "id-arena" @@ -3178,9 +3194,9 @@ checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "litemap" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a04a5b2b6f54acba899926491d0a6c59d98012938ca2ab5befb281c034e8f94" +checksum = "f9d642685b028806386b2b6e75685faadd3eb65a85fff7df711ce18446a422da" [[package]] name = "lmdb-rkv" @@ -5551,9 +5567,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef" +checksum = "d5d0e245e80bdc9b4e5356fc45a72184abbc3861992603f515270e9340f5a219" dependencies = [ "displaydoc", "zerovec", @@ -6585,9 +6601,9 @@ dependencies = [ [[package]] name = "writeable" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e49e42bdb1d5dc76f4cd78102f8f0714d32edfa3efb82286eb0f0b1fc0da0f" +checksum = "dad7bb64b8ef9c0aa27b6da38b452b0ee9fd82beaf276a87dd796fb55cbae14e" [[package]] name = "xml-rs" @@ -6649,9 +6665,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1848075a23a28f9773498ee9a0f2cf58fcbad4f8c0ccf84a210ab33c6ae495de" +checksum = "65e71b2e4f287f467794c671e2b8f8a5f3716b3c829079a1c44740148eff07e4" dependencies = [ "serde", "stable_deref_trait", @@ -6661,8 +6677,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.1" -source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e6936f0cce458098a201c245a11bef556c6a0181129c7034d10d76d1ec3a2b8" dependencies = [ "proc-macro2", "quote", @@ -6692,8 +6709,9 @@ dependencies = [ [[package]] name = "zerofrom-derive" -version = "0.1.2" -source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3" dependencies = [ "proc-macro2", "quote", @@ -6703,9 +6721,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.9.4" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "198f54134cd865f437820aa3b43d0ad518af4e68ee161b444cdd15d8e567c8ea" +checksum = "eff4439ae91fb5c72b8abc12f3f2dbf51bd27e6eadb9f8a5bc8898dddb0e27ea" dependencies = [ "yoke", "zerofrom", @@ -6714,13 +6732,13 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.9.4" -source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4e5997cbf58990550ef1f0e5124a05e47e1ebd33a84af25739be6031a62c20" dependencies = [ "proc-macro2", "quote", "syn", - "synstructure", ] [[package]] diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 297ac5f64bd4..5ba9bde152d5 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -881,6 +881,11 @@ parameter. These are directly parallel to the existing versions without CTFontOp introduce any new forms of risk. """ +[[audits.core_maths]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +version = "0.1.0" + [[audits.coreaudio-sys]] who = "Mike Hommey " criteria = "safe-to-deploy" @@ -1313,6 +1318,11 @@ who = "Makoto Kato " criteria = "safe-to-deploy" delta = "0.5.2 -> 0.5.2@git:8d125999893fedfdf30595e97334c21ec4b18da9" +[[audits.diplomat]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.5.2 -> 0.7.0" + [[audits.diplomat-runtime]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -1324,6 +1334,11 @@ who = "Makoto Kato " criteria = "safe-to-deploy" delta = "0.5.2 -> 0.5.2@git:8d125999893fedfdf30595e97334c21ec4b18da9" +[[audits.diplomat-runtime]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.5.2 -> 0.7.0" + [[audits.diplomat_core]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -1335,6 +1350,11 @@ who = "Makoto Kato " criteria = "safe-to-deploy" delta = "0.5.2 -> 0.5.2@git:8d125999893fedfdf30595e97334c21ec4b18da9" +[[audits.diplomat_core]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.5.2 -> 0.7.0" + [[audits.displaydoc]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -1981,30 +2001,61 @@ criteria = "safe-to-deploy" version = "1.2.2" notes = "This crate is C/C++ FFI for ICU4X using diplomat crate. no unsafe and no file access etc on this crate." +[[audits.icu_capi]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "1.2.2 -> 1.4.0" + [[audits.icu_collections]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "1.2.0" notes = "This crate is used by ICU4X for internal data structure. There is no fileaccess and network access. This uses unsafe block, but we confirm data is valid before." +[[audits.icu_collections]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "1.2.0 -> 1.4.0" + [[audits.icu_locid]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "1.2.0" notes = "This has unsafe block to handle ascii string in utf-8 string. I've vetted the one instance of unsafe code." +[[audits.icu_locid]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "1.2.0 -> 1.4.0" + +[[audits.icu_locid_transform]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +version = "1.4.0" +notes = "This crate doesn't contain network and file access. Although this has unsafe block, the reason is added in the comment block. I audited code." + [[audits.icu_provider]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "1.2.0" notes = "Although this has unsafe block, this has a commnet why this is safety and I audited code. Also, this doesn't have file access and network access." +[[audits.icu_provider]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "1.2.0 -> 1.4.0" + [[audits.icu_provider_adapters]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "1.2.0" notes = "This is one of ICU4X data provider crates that depends on data type. This has no unsafe code and uses no ambient capabilities." +[[audits.icu_provider_adapters]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "1.2.0 -> 1.4.0" + [[audits.icu_provider_macros]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -2016,17 +2067,27 @@ who = "Makoto Kato " criteria = "safe-to-deploy" delta = "1.2.0 -> 1.2.0@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873" +[[audits.icu_provider_macros]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "1.2.0 -> 1.4.0" + [[audits.icu_segmenter]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "1.2.1" notes = "Original authors are Makoto Kato and Ting-Yu Lin who work at Mozilla. This crate uses unsafe to matrix calculation, but it is safety to check length. And there is no filesystem / network access." -[[audits.icu_testdata]] +[[audits.icu_segmenter]] who = "Makoto Kato " criteria = "safe-to-deploy" -version = "1.2.0" -notes = "This is just ICU4X data only that is generated by ICU4X datagen. Generated data is in unsafe block to use zero-copy implmentation, but it is safety." +delta = "1.2.1 -> 1.4.0" + +[[audits.icu_segmenter_data]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +version = "1.4.0" +notes = "This crate is data only for icu_segmenter. There is no filesystem / network access." [[audits.idna]] who = "Bobby Holley " @@ -2167,6 +2228,11 @@ criteria = "safe-to-deploy" version = "0.7.0" notes = "This crete has no unsafe code, no file acceess and no network access." +[[audits.litemap]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.7.0 -> 0.7.2" + [[audits.lmdb-rkv]] who = "Bobby Holley " criteria = "safe-to-deploy" @@ -3569,6 +3635,11 @@ who = "Mike Hommey " criteria = "safe-to-deploy" delta = "0.7.0 -> 0.7.1" +[[audits.tinystr]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.7.1 -> 0.7.4" + [[audits.tokio-macros]] who = "Mike Hommey " criteria = "safe-to-run" @@ -4365,6 +4436,11 @@ criteria = "safe-to-deploy" version = "0.5.2" notes = "writeable is a variation of fmt::Write with sink version. This uses `unsafe` block to handle potentially-invalid UTF-8 character. I've vetted the one instance of unsafe code." +[[audits.writeable]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.5.2 -> 0.5.4" + [[audits.xmldecl]] who = "Henri Sivonen " criteria = "safe-to-deploy" @@ -4377,12 +4453,22 @@ criteria = "safe-to-deploy" version = "0.7.1" notes = "This crate is for zero-copy serialization for ICU4X data structure, and maintained by ICU4X team. Since this uses unsafe block for serialization, I audited code." +[[audits.yoke]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.7.1 -> 0.7.3" + [[audits.yoke-derive]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "0.7.1@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873" notes = "This crate is a helper for yoke crate that is ICU4X data structure, and maintained by ICU4X team. Since this uses unsafe block for serialization, all has the comment why this uses unsafe and I audited code." +[[audits.yoke-derive]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +version = "0.7.3" + [[audits.zerofrom]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -4395,18 +4481,33 @@ criteria = "safe-to-deploy" version = "0.1.2@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873" notes = "This is custom derives for `ZeroFrom` that is from zerofrom crate. This has no unsafe code and uses no ambient capabilities." +[[audits.zerofrom-derive]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +version = "0.1.3" + [[audits.zerovec]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "0.9.4" notes = "This crate is zero-copy data structure implmentation. Although this uses unsafe block in several code, it requires for zero-copy. And this has a comment in code why this uses unsafe and I audited code." +[[audits.zerovec]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +delta = "0.9.4 -> 0.10.1" + [[audits.zerovec-derive]] who = "Makoto Kato " criteria = "safe-to-deploy" version = "0.9.4@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873" notes = "This is custom derives for `ZeroVec` that is from zerovec crate. Although this uses unsafe block for zero-copy, this has a comment in code why this uses unsafe and I audited code." +[[audits.zerovec-derive]] +who = "Makoto Kato " +criteria = "safe-to-deploy" +version = "0.10.1" + [[audits.zip]] who = "Mike Hommey " criteria = "safe-to-run" diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 91bc6b7ab481..ee19e221b167 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -55,18 +55,6 @@ notes = "Upstream release plus a couple unpublished changes" audit-as-crates-io = true notes = "Part of the wgpu repository, pinned as the rest of wgpu crates." -[policy.diplomat] -audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" - -[policy.diplomat-runtime] -audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" - -[policy.diplomat_core] -audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" - [policy.firefox-on-glean] audit-as-crates-io = false notes = "The crates.io version of this is just a placeholder to allow public crates to depend on firefox-on-glean." @@ -92,13 +80,13 @@ notes = "Used for fuzzing." criteria = "safe-to-run" notes = "Used for testing." -[policy.icu_provider_macros] +[policy.icu_capi] audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" +notes = "Patched version of upstream" -[policy.icu_testdata] -audit-as-crates-io = false -notes = "Customized ICU4X baked data only that Gecko wants" +[policy.icu_segmenter_data] +audit-as-crates-io = true +notes = "Patched version of upstream" [policy.l10nregistry] dependency-criteria = { fluent-testing = "safe-to-run", tokio = "safe-to-run" } @@ -238,18 +226,6 @@ notes = "Upstream project which we pin." [policy.wr_malloc_size_of] audit-as-crates-io = false -[policy.yoke-derive] -audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" - -[policy.zerofrom-derive] -audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" - -[policy.zerovec-derive] -audit-as-crates-io = true -notes = "Upstream version not to use syn 1.x" - [[exemptions.ahash]] version = "0.7.6" criteria = "safe-to-deploy" diff --git a/third_party/rust/core_maths/.cargo-checksum.json b/third_party/rust/core_maths/.cargo-checksum.json new file mode 100644 index 000000000000..d4906435ab93 --- /dev/null +++ b/third_party/rust/core_maths/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"731a42549f473035217f2a7dd8406fdb938133a86e280750e8af66ecd5400f6c","README.md":"cf4421c888471876bf715ce49aabe59ace32d165b1cd9878fa8d8f5ecd005fc1","src/lib.rs":"3ccbc7d11f612c33b8e5beb966ebda4aee777132ac1568c6a9f77a3d5fe08fda"},"package":"e3b02505ccb8c50b0aa21ace0fc08c3e53adebd4e58caa18a36152803c7709a3"} \ No newline at end of file diff --git a/third_party/rust/core_maths/Cargo.toml b/third_party/rust/core_maths/Cargo.toml new file mode 100644 index 000000000000..d34f18a512e3 --- /dev/null +++ b/third_party/rust/core_maths/Cargo.toml @@ -0,0 +1,27 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +name = "core_maths" +version = "0.1.0" +authors = ["Robert Bastian + +Extension trait for full float functionality in `#[no_std]` backed by [`libm`]. + +Method signatures, implementation, and documentation are copied from as `std` 1.72, +with calls to instrinsics replaced by their `libm` equivalents. + +# Usage +```rust +#[allow(unused_imports)] // will be unused on std targets +use core_maths::*; + +3.9.floor(); +``` + + diff --git a/third_party/rust/core_maths/src/lib.rs b/third_party/rust/core_maths/src/lib.rs new file mode 100644 index 000000000000..810287b273dc --- /dev/null +++ b/third_party/rust/core_maths/src/lib.rs @@ -0,0 +1,1221 @@ +//! Extension trait for full float functionality in `#[no_std]` backed by [`libm`]. +//! +//! Method signatures, implementation, and documentation are copied from as `std` 1.72, +//! with calls to instrinsics replaced by their `libm` equivalents. +//! +//! # Usage +//! ```rust +//! #[allow(unused_imports)] // will be unused on std targets +//! use core_maths::*; +//! +//! 3.9.floor(); +//! ``` + +#![no_std] +#![warn(missing_docs)] + +/// See [`crate`]. +pub trait CoreFloat: Sized + Copy { + /// Returns the largest integer less than or equal to `self`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 3.7_f64; + /// let g = 3.0_f64; + /// let h = -3.7_f64; + /// + /// assert_eq!(CoreFloat::floor(f), 3.0); + /// assert_eq!(CoreFloat::floor(g), 3.0); + /// assert_eq!(CoreFloat::floor(h), -4.0); + /// ``` + fn floor(self) -> Self; + + /// Returns the smallest integer greater than or equal to `self`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 3.01_f64; + /// let g = 4.0_f64; + /// + /// assert_eq!(CoreFloat::ceil(f), 4.0); + /// assert_eq!(CoreFloat::ceil(g), 4.0); + /// ``` + fn ceil(self) -> Self; + + /// Returns the nearest integer to `self`. If a value is half-way between two + /// integers, round away from `0.0`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 3.3_f64; + /// let g = -3.3_f64; + /// let h = -3.7_f64; + /// let i = 3.5_f64; + /// let j = 4.5_f64; + /// + /// assert_eq!(CoreFloat::round(f), 3.0); + /// assert_eq!(CoreFloat::round(g), -3.0); + /// assert_eq!(CoreFloat::round(h), -4.0); + /// assert_eq!(CoreFloat::round(i), 4.0); + /// assert_eq!(CoreFloat::round(j), 5.0); + /// ``` + fn round(self) -> Self; + + /// Returns the integer part of `self`. + /// This means that non-integer numbers are always truncated towards zero. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 3.7_f64; + /// let g = 3.0_f64; + /// let h = -3.7_f64; + /// + /// assert_eq!(CoreFloat::trunc(f), 3.0); + /// assert_eq!(CoreFloat::trunc(g), 3.0); + /// assert_eq!(CoreFloat::trunc(h), -3.0); + /// ``` + fn trunc(self) -> Self; + + /// Returns the fractional part of `self`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 3.6_f64; + /// let y = -3.6_f64; + /// let abs_difference_x = (CoreFloat::fract(x) - CoreFloat::abs(0.6)); + /// let abs_difference_y = (CoreFloat::fract(y) - CoreFloat::abs(-0.6)); + /// + /// assert!(abs_difference_x < 1e-10); + /// assert!(abs_difference_y < 1e-10); + /// ``` + fn fract(self) -> Self; + + /// Computes the absolute value of `self`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 3.5_f64; + /// let y = -3.5_f64; + /// + /// let abs_difference_x = (CoreFloat::abs(x) - CoreFloat::abs(x)); + /// let abs_difference_y = (CoreFloat::abs(y) - (CoreFloat::abs(-y))); + /// + /// assert!(abs_difference_x < 1e-10); + /// assert!(abs_difference_y < 1e-10); + /// + /// assert!(f64::NAN.abs().is_nan()); + /// ``` + fn abs(self) -> Self; + + /// Returns a number that represents the sign of `self`. + /// + /// - `1.0` if the number is positive, `+0.0` or `INFINITY` + /// - `-1.0` if the number is negative, `-0.0` or `NEG_INFINITY` + /// - NaN if the number is NaN + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 3.5_f64; + /// + /// assert_eq!(CoreFloat::signum(f), 1.0); + /// assert_eq!(CoreFloat::signum(f64::NEG_INFINITY), -1.0); + /// + /// assert!(CoreFloat::signum(f64::NAN).is_nan()); + /// ``` + fn signum(self) -> Self; + + /// Returns a number composed of the magnitude of `self` and the sign of + /// `sign`. + /// + /// Equal to `self` if the sign of `self` and `sign` are the same, otherwise + /// equal to `-self`. If `self` is a NaN, then a NaN with the sign bit of + /// `sign` is returned. Note, however, that conserving the sign bit on NaN + /// across arithmetical operations is not generally guaranteed. + /// See [explanation of NaN as a special value](primitive@f32) for more info. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 3.5_f64; + /// + /// assert_eq!(CoreFloat::copysign(f, 0.42), 3.5_f64); + /// assert_eq!(CoreFloat::copysign(f, -0.42), -3.5_f64); + /// assert_eq!(CoreFloat::copysign(-f, 0.42), 3.5_f64); + /// assert_eq!(CoreFloat::copysign(-f, -0.42), -3.5_f64); + /// + /// assert!(CoreFloat::copysign(f64::NAN, 1.0).is_nan()); + /// ``` + fn copysign(self, sign: Self) -> Self; + + /// Fused multiply-add. Computes `(self * a) + b` with only one rounding + /// error, yielding a more accurate result than an unfused multiply-add. + /// + /// Using `mul_add` *may* be more performant than an unfused multiply-add if + /// the target architecture has a dedicated `fma` CPU instruction. However, + /// this is not always true, and will be heavily dependant on designing + /// algorithms with specific target hardware in mind. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let m = 10.0_f64; + /// let x = 4.0_f64; + /// let b = 60.0_f64; + /// + /// // 100.0 + /// let abs_difference = (CoreFloat::mul_add(m, x, b) - ((m * x) + b)).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn mul_add(self, a: Self, b: Self) -> Self; + + /// Calculates Euclidean division, the matching method for `rem_euclid`. + /// + /// This computes the integer `n` such that + /// `self = n * rhs + self.rem_euclid(rhs)`. + /// In other words, the result is `self / rhs` rounded to the integer `n` + /// such that `self >= n * rhs`. + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let a: f64 = 7.0; + /// let b = 4.0; + /// assert_eq!(CoreFloat::div_euclid(a, b), 1.0); // 7.0 > 4.0 * 1.0 + /// assert_eq!(CoreFloat::div_euclid(-a, b), -2.0); // -7.0 >= 4.0 * -2.0 + /// assert_eq!(CoreFloat::div_euclid(a, -b), -1.0); // 7.0 >= -4.0 * -1.0 + /// assert_eq!(CoreFloat::div_euclid(-a, -b), 2.0); // -7.0 >= -4.0 * 2.0 + /// ``` + fn div_euclid(self, rhs: Self) -> Self; + + /// Calculates the least nonnegative remainder of `self (mod rhs)`. + /// + /// In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in + /// most cases. However, due to a floating point round-off error it can + /// result in `r == rhs.abs()`, violating the mathematical definition, if + /// `self` is much smaller than `rhs.abs()` in magnitude and `self < 0.0`. + /// This result is not an element of the function's codomain, but it is the + /// closest floating point number in the real numbers and thus fulfills the + /// property `self == self.div_euclid(rhs) * rhs + self.rem_euclid(rhs)` + /// approximately. + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let a: f64 = 7.0; + /// let b = 4.0; + /// assert_eq!(CoreFloat::rem_euclid(a, b), 3.0); + /// assert_eq!(CoreFloat::rem_euclid(-a, b), 1.0); + /// assert_eq!(CoreFloat::rem_euclid(a, -b), 3.0); + /// assert_eq!(CoreFloat::rem_euclid(-a, -b), 1.0); + /// // limitation due to round-off error + /// assert!(CoreFloat::rem_euclid(-f64::EPSILON, 3.0) != 0.0); + /// ``` + fn rem_euclid(self, rhs: Self) -> Self; + + /// Raises a number to an integer power. + /// + /// Using this function is generally faster than using `powf`. + /// It might have a different sequence of rounding operations than `powf`, + /// so the results are not guaranteed to agree. + /// + /// This method is not available in `libm`, so it uses a custom implementation. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 2.0_f64; + /// let abs_difference = (CoreFloat::powi(x, 2) - (x * x)).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn powi(self, n: i32) -> Self; + + /// Raises a number to a floating point power. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 2.0_f64; + /// let abs_difference = (CoreFloat::powf(x, 2.0) - (x * x)).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn powf(self, n: Self) -> Self; + + /// Returns the square root of a number. + /// + /// Returns NaN if `self` is a negative number other than `-0.0`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let positive = 4.0_f64; + /// let negative = -4.0_f64; + /// let negative_zero = -0.0_f64; + /// + /// let abs_difference = (CoreFloat::sqrt(positive) - 2.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// assert!(CoreFloat::sqrt(negative).is_nan()); + /// assert!(CoreFloat::sqrt(negative_zero) == negative_zero); + /// ``` + fn sqrt(self) -> Self; + + /// Returns `e^(self)`, (the exponential function). + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let one = 1.0_f64; + /// // e^1 + /// let e = CoreFloat::exp(one); + /// + /// // ln(e) - 1 == 0 + /// let abs_difference = (e.ln() - 1.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn exp(self) -> Self; + + /// Returns `2^(self)`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 2.0_f64; + /// + /// // 2^2 - 4 == 0 + /// let abs_difference = (CoreFloat::exp2(f) - 4.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn exp2(self) -> Self; + + /// Returns the natural logarithm of the number. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let one = 1.0_f64; + /// // e^1 + /// let e = one.exp(); + /// + /// // ln(e) - 1 == 0 + /// let abs_difference = (CoreFloat::ln(e) - 1.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn ln(self) -> Self; + + /// Returns the logarithm of the number with respect to an arbitrary base. + /// + /// The result might not be correctly rounded owing to implementation details; + /// `self.log2()` can produce more accurate results for base 2, and + /// `self.log10()` can produce more accurate results for base 10. + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let twenty_five = 25.0_f64; + /// + /// // log5(25) - 2 == 0 + /// let abs_difference = (CoreFloat::log(twenty_five, 5.0) - 2.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn log(self, base: Self) -> Self; + + /// Returns the base 2 logarithm of the number. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let four = 4.0_f64; + /// + /// // log2(4) - 2 == 0 + /// let abs_difference = (CoreFloat::log2(four) - 2.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn log2(self) -> Self; + + /// Returns the base 10 logarithm of the number. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let hundred = 100.0_f64; + /// + /// // log10(100) - 2 == 0 + /// let abs_difference = (CoreFloat::log10(hundred) - 2.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn log10(self) -> Self; + + /// Returns the cube root of a number. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 8.0_f64; + /// + /// // x^(1/3) - 2 == 0 + /// let abs_difference = (CoreFloat::cbrt(x) - 2.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn cbrt(self) -> Self; + + /// Compute the distance between the origin and a point (`x`, `y`) on the + /// Euclidean plane. Equivalently, compute the length of the hypotenuse of a + /// right-angle triangle with other sides having length `x.abs()` and + /// `y.abs()`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 2.0_f64; + /// let y = 3.0_f64; + /// + /// // sqrt(x^2 + y^2) + /// let abs_difference = (CoreFloat::hypot(x, y) - (x.powi(2) + y.powi(2)).sqrt()).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn hypot(self, other: Self) -> Self; + + /// Computes the sine of a number (in radians). + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = std::f64::consts::FRAC_PI_2; + /// + /// let abs_difference = (CoreFloat::sin(x) - 1.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn sin(self) -> Self; + + /// Computes the cosine of a number (in radians). + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 2.0 * std::f64::consts::PI; + /// + /// let abs_difference = (CoreFloat::cos(x) - 1.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn cos(self) -> Self; + + /// Computes the tangent of a number (in radians). + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = std::f64::consts::FRAC_PI_4; + /// + /// let abs_difference = (CoreFloat::tan(x) - 1.0).abs(); + /// + /// assert!(abs_difference < 1e-14); + /// ``` + fn tan(self) -> Self; + + /// Computes the arcsine of a number. Return value is in radians in + /// the range [-pi/2, pi/2] or NaN if the number is outside the range + /// [-1, 1]. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = std::f64::consts::FRAC_PI_2; + /// + /// // asin(sin(pi/2)) + /// let abs_difference = (CoreFloat::asin(f.sin()) - std::f64::consts::FRAC_PI_2).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn asin(self) -> Self; + + /// Computes the arccosine of a number. Return value is in radians in + /// the range [0, pi] or NaN if the number is outside the range + /// [-1, 1]. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = std::f64::consts::FRAC_PI_4; + /// + /// // acos(cos(pi/4)) + /// let abs_difference = (CoreFloat::acos(f.cos()) - std::f64::consts::FRAC_PI_4).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn acos(self) -> Self; + + /// Computes the arctangent of a number. Return value is in radians in the + /// range [-pi/2, pi/2]; + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let f = 1.0_f64; + /// + /// // atan(tan(1)) + /// let abs_difference = (CoreFloat::atan(f.tan()) - 1.0).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn atan(self) -> Self; + + /// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians. + /// + /// * `x = 0`, `y = 0`: `0` + /// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]` + /// * `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]` + /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// // Positive angles measured counter-clockwise + /// // from positive x axis + /// // -pi/4 radians (45 deg clockwise) + /// let x1 = 3.0_f64; + /// let y1 = -3.0_f64; + /// + /// // 3pi/4 radians (135 deg counter-clockwise) + /// let x2 = -3.0_f64; + /// let y2 = 3.0_f64; + /// + /// let abs_difference_1 = (CoreFloat::atan2(y1, x1) - (-std::f64::consts::FRAC_PI_4)).abs(); + /// let abs_difference_2 = (CoreFloat::atan2(y2, x2) - (3.0 * std::f64::consts::FRAC_PI_4)).abs(); + /// + /// assert!(abs_difference_1 < 1e-10); + /// assert!(abs_difference_2 < 1e-10); + /// ``` + fn atan2(self, other: Self) -> Self; + + /// Simultaneously computes the sine and cosine of the number, `x`. Returns + /// `(sin(x), cos(x))`. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = std::f64::consts::FRAC_PI_4; + /// let f = CoreFloat::sin_cos(x); + /// + /// let abs_difference_0 = (f.0 - x.sin()).abs(); + /// let abs_difference_1 = (f.1 - x.cos()).abs(); + /// + /// assert!(abs_difference_0 < 1e-10); + /// assert!(abs_difference_1 < 1e-10); + /// ``` + fn sin_cos(self) -> (Self, Self) { + (self.sin(), self.cos()) + } + + /// Returns `e^(self) - 1` in a way that is accurate even if the + /// number is close to zero. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 1e-16_f64; + /// + /// // for very small x, e^x is approximately 1 + x + x^2 / 2 + /// let approx = x + x * x / 2.0; + /// let abs_difference = (CoreFloat::exp_m1(x) - approx).abs(); + /// + /// assert!(abs_difference < 1e-20); + /// ``` + fn exp_m1(self) -> Self; + + /// Returns `ln(1+n)` (natural logarithm) more accurately than if + /// the operations were performed separately. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 1e-16_f64; + /// + /// // for very small x, ln(1 + x) is approximately x - x^2 / 2 + /// let approx = x - x * x / 2.0; + /// let abs_difference = (CoreFloat::ln_1p(x) - approx).abs(); + /// + /// assert!(abs_difference < 1e-20); + /// ``` + fn ln_1p(self) -> Self; + + /// Hyperbolic sine function. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let e = std::f64::consts::E; + /// let x = 1.0_f64; + /// + /// let f = CoreFloat::sinh(x); + /// // Solving sinh() at 1 gives `(e^2-1)/(2e)` + /// let g = ((e * e) - 1.0) / (2.0 * e); + /// let abs_difference = (f - g).abs(); + /// + /// assert!(abs_difference < 1e-10); + /// ``` + fn sinh(self) -> Self; + + /// Hyperbolic cosine function. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let e = std::f64::consts::E; + /// let x = 1.0_f64; + /// let f = CoreFloat::cosh(x); + /// // Solving cosh() at 1 gives this result + /// let g = ((e * e) + 1.0) / (2.0 * e); + /// let abs_difference = (f - g).abs(); + /// + /// // Same result + /// assert!(abs_difference < 1.0e-10); + /// ``` + fn cosh(self) -> Self; + + /// Hyperbolic tangent function. + /// + /// This implementation uses `libm` instead of the Rust intrinsic. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let e = std::f64::consts::E; + /// let x = 1.0_f64; + /// + /// let f = CoreFloat::tanh(x); + /// // Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))` + /// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2)); + /// let abs_difference = (f - g).abs(); + /// + /// assert!(abs_difference < 1.0e-10); + /// ``` + fn tanh(self) -> Self; + + /// Inverse hyperbolic sine function. + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 1.0_f64; + /// let f = CoreFloat::asinh(x.sinh()); + /// + /// let abs_difference = (f - x).abs(); + /// + /// assert!(abs_difference < 1.0e-10); + /// ``` + fn asinh(self) -> Self; + + /// Inverse hyperbolic cosine function. + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let x = 1.0_f64; + /// let f = CoreFloat::acosh(x.cosh()); + /// + /// let abs_difference = (f - x).abs(); + /// + /// assert!(abs_difference < 1.0e-10); + /// ``` + fn acosh(self) -> Self; + + /// Inverse hyperbolic tangent function. + /// + /// This method does not use an intrinsic in `std`, so its code is copied. + /// + /// # Examples + /// + /// ``` + /// use core_maths::*; + /// let e = std::f64::consts::E; + /// let f = CoreFloat::atanh(e.tanh()); + /// + /// let abs_difference = (f - e).abs(); + /// + /// assert!(abs_difference < 1.0e-10); + /// ``` + fn atanh(self) -> Self; +} + +impl CoreFloat for f32 { + #[inline] + fn floor(self) -> Self { + libm::floorf(self) + } + + #[inline] + fn ceil(self) -> Self { + libm::ceilf(self) + } + + #[inline] + fn round(self) -> Self { + libm::roundf(self) + } + + #[inline] + fn trunc(self) -> Self { + libm::truncf(self) + } + + #[inline] + fn fract(self) -> Self { + self - self.trunc() + } + + #[inline] + fn abs(self) -> Self { + libm::fabsf(self) + } + + #[inline] + fn signum(self) -> Self { + if self.is_nan() { + Self::NAN + } else { + 1.0_f32.copysign(self) + } + } + + #[inline] + fn copysign(self, sign: Self) -> Self { + libm::copysignf(self, sign) + } + + #[inline] + fn mul_add(self, a: Self, b: Self) -> Self { + libm::fmaf(self, a, b) + } + + #[inline] + fn div_euclid(self, rhs: Self) -> Self { + let q = (self / rhs).trunc(); + if self % rhs < 0.0 { + return if rhs > 0.0 { q - 1.0 } else { q + 1.0 }; + } + q + } + + #[inline] + fn rem_euclid(self, rhs: Self) -> Self { + let r = self % rhs; + if r < 0.0 { + r + rhs.abs() + } else { + r + } + } + + #[inline] + fn powi(self, exp: i32) -> Self { + if exp == 0 { + return 1.0; + } + + let mut base = if exp < 0 { self.recip() } else { self }; + let mut exp = exp.unsigned_abs(); + let mut acc = 1.0; + + while exp > 1 { + if (exp & 1) == 1 { + acc *= base; + } + exp /= 2; + base = base * base; + } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc * base + } + + #[inline] + fn powf(self, n: Self) -> Self { + libm::powf(self, n) + } + + #[inline] + fn sqrt(self) -> Self { + libm::sqrtf(self) + } + + #[inline] + fn exp(self) -> Self { + libm::expf(self) + } + + #[inline] + fn exp2(self) -> Self { + libm::exp2f(self) + } + + #[inline] + fn ln(self) -> Self { + libm::logf(self) + } + + #[inline] + fn log(self, base: Self) -> Self { + self.ln() / base.ln() + } + + #[inline] + fn log2(self) -> Self { + libm::log2f(self) + } + + #[inline] + fn log10(self) -> Self { + libm::log10f(self) + } + + #[inline] + fn cbrt(self) -> Self { + libm::cbrtf(self) + } + + #[inline] + fn hypot(self, other: Self) -> Self { + libm::hypotf(self, other) + } + + #[inline] + fn sin(self) -> Self { + libm::sinf(self) + } + + #[inline] + fn cos(self) -> Self { + libm::cosf(self) + } + + #[inline] + fn tan(self) -> Self { + libm::tanf(self) + } + + #[inline] + fn asin(self) -> Self { + libm::asinf(self) + } + + #[inline] + fn acos(self) -> Self { + libm::acosf(self) + } + + #[inline] + fn atan(self) -> Self { + libm::atanf(self) + } + + #[inline] + fn atan2(self, other: Self) -> Self { + libm::atan2f(self, other) + } + + #[inline] + fn exp_m1(self) -> Self { + libm::expm1f(self) + } + + #[inline] + fn ln_1p(self) -> Self { + libm::log1pf(self) + } + + #[inline] + fn sinh(self) -> Self { + libm::sinhf(self) + } + + #[inline] + fn cosh(self) -> Self { + libm::coshf(self) + } + + #[inline] + fn tanh(self) -> Self { + libm::tanhf(self) + } + + #[inline] + fn asinh(self) -> Self { + let ax = self.abs(); + let ix = 1.0 / ax; + (ax + (ax / (Self::hypot(1.0, ix) + ix))) + .ln_1p() + .copysign(self) + } + + #[inline] + fn acosh(self) -> Self { + if self < 1.0 { + Self::NAN + } else { + (self + ((self - 1.0).sqrt() * (self + 1.0).sqrt())).ln() + } + } + + #[inline] + fn atanh(self) -> Self { + 0.5 * ((2.0 * self) / (1.0 - self)).ln_1p() + } +} + +impl CoreFloat for f64 { + #[inline] + fn floor(self) -> Self { + libm::floor(self) + } + + #[inline] + fn ceil(self) -> Self { + libm::ceil(self) + } + + #[inline] + fn round(self) -> Self { + libm::round(self) + } + + #[inline] + fn trunc(self) -> Self { + libm::trunc(self) + } + + #[inline] + fn fract(self) -> Self { + self - self.trunc() + } + + #[inline] + fn abs(self) -> Self { + libm::fabs(self) + } + + #[inline] + fn signum(self) -> Self { + if self.is_nan() { + Self::NAN + } else { + 1.0_f64.copysign(self) + } + } + + #[inline] + fn copysign(self, sign: Self) -> Self { + libm::copysign(self, sign) + } + + #[inline] + fn mul_add(self, a: Self, b: Self) -> Self { + libm::fma(self, a, b) + } + + #[inline] + fn div_euclid(self, rhs: Self) -> Self { + let q = (self / rhs).trunc(); + if self % rhs < 0.0 { + return if rhs > 0.0 { q - 1.0 } else { q + 1.0 }; + } + q + } + + #[inline] + fn rem_euclid(self, rhs: Self) -> Self { + let r = self % rhs; + if r < 0.0 { + r + rhs.abs() + } else { + r + } + } + + #[inline] + fn powi(self, exp: i32) -> Self { + if exp == 0 { + return 1.0; + } + + let mut base = if exp < 0 { self.recip() } else { self }; + let mut exp = exp.unsigned_abs(); + let mut acc = 1.0; + + while exp > 1 { + if (exp & 1) == 1 { + acc *= base; + } + exp /= 2; + base = base * base; + } + + // since exp!=0, finally the exp must be 1. + // Deal with the final bit of the exponent separately, since + // squaring the base afterwards is not necessary and may cause a + // needless overflow. + acc * base + } + + #[inline] + fn powf(self, n: Self) -> Self { + libm::pow(self, n) + } + + #[inline] + fn sqrt(self) -> Self { + libm::sqrt(self) + } + + #[inline] + fn exp(self) -> Self { + libm::exp(self) + } + + #[inline] + fn exp2(self) -> Self { + libm::exp2(self) + } + + #[inline] + fn ln(self) -> Self { + libm::log(self) + } + + #[inline] + fn log(self, base: Self) -> Self { + self.ln() / base.ln() + } + + #[inline] + fn log2(self) -> Self { + libm::log2(self) + } + + #[inline] + fn log10(self) -> Self { + libm::log10(self) + } + + #[inline] + fn cbrt(self) -> Self { + libm::cbrt(self) + } + + #[inline] + fn hypot(self, other: Self) -> Self { + libm::hypot(self, other) + } + + #[inline] + fn sin(self) -> Self { + libm::sin(self) + } + + #[inline] + fn cos(self) -> Self { + libm::cos(self) + } + + #[inline] + fn tan(self) -> Self { + libm::tan(self) + } + + #[inline] + fn asin(self) -> Self { + libm::asin(self) + } + + #[inline] + fn acos(self) -> Self { + libm::acos(self) + } + + #[inline] + fn atan(self) -> Self { + libm::atan(self) + } + + #[inline] + fn atan2(self, other: Self) -> Self { + libm::atan2(self, other) + } + + #[inline] + fn exp_m1(self) -> Self { + libm::expm1(self) + } + + #[inline] + fn ln_1p(self) -> Self { + libm::log1p(self) + } + + #[inline] + fn sinh(self) -> Self { + libm::sinh(self) + } + + #[inline] + fn cosh(self) -> Self { + libm::cosh(self) + } + + #[inline] + fn tanh(self) -> Self { + libm::tanh(self) + } + + #[inline] + fn asinh(self) -> Self { + let ax = self.abs(); + let ix = 1.0 / ax; + (ax + (ax / (Self::hypot(1.0, ix) + ix))) + .ln_1p() + .copysign(self) + } + + #[inline] + fn acosh(self) -> Self { + if self < 1.0 { + Self::NAN + } else { + (self + ((self - 1.0).sqrt() * (self + 1.0).sqrt())).ln() + } + } + + #[inline] + fn atanh(self) -> Self { + 0.5 * ((2.0 * self) / (1.0 - self)).ln_1p() + } +} diff --git a/third_party/rust/diplomat-runtime/.cargo-checksum.json b/third_party/rust/diplomat-runtime/.cargo-checksum.json index 105d1c58938e..fa0aae0776a1 100644 --- a/third_party/rust/diplomat-runtime/.cargo-checksum.json +++ b/third_party/rust/diplomat-runtime/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"7fc35f8643067872335fe85cf4a6a4289c1b82156cf1216d223b44513b8d0d98","LICENSE-APACHE":"639c20c7f14fb122750d5ad1a6cfb116d9bf8d103e709ee40949e5a12a731666","LICENSE-MIT":"3337fe6e4a3830ad87c23cb9d6d750f9a1e5c45efc08de9c76c1a207fc6966c4","src/lib.rs":"6c019d412bb5534abd3869a16574599dcff730b89a576c3cf4c5590a1d449d17","src/result.rs":"2b07ce3cbb02a141abc35742f307cc4ef2b097ce610e04d92a50c469f354401d","src/wasm_glue.rs":"f26aa119aa291a3cfafc16b73f713a391718294a51e2c656d0093cf1fd2befac","src/writeable.rs":"80d8a93feba545fcb3150b8daf546f3e060b0c8c11f13917409dd455abe0c3bd"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"ea77755aae387e62c45564000302e3c7a5ceda3be2f9ef8664e26ee871627b88","LICENSE-APACHE":"639c20c7f14fb122750d5ad1a6cfb116d9bf8d103e709ee40949e5a12a731666","LICENSE-MIT":"3337fe6e4a3830ad87c23cb9d6d750f9a1e5c45efc08de9c76c1a207fc6966c4","src/lib.rs":"1f42457d57ec23fd89f05af631eb73728f37a9790cd604ce1ce94ef153869fb0","src/result.rs":"2b07ce3cbb02a141abc35742f307cc4ef2b097ce610e04d92a50c469f354401d","src/wasm_glue.rs":"3712ccddfeacb98a37be9354a315cc013d9b6ba0bf2f351e0a806112d1f87c15","src/writeable.rs":"80d8a93feba545fcb3150b8daf546f3e060b0c8c11f13917409dd455abe0c3bd"},"package":"f7b0f23d549a46540e26e5490cd44c64ced0d762959f1ffdec6ab0399634cf3c"} \ No newline at end of file diff --git a/third_party/rust/diplomat-runtime/Cargo.toml b/third_party/rust/diplomat-runtime/Cargo.toml index 4a692e8539c8..99c0e4c6ed1d 100644 --- a/third_party/rust/diplomat-runtime/Cargo.toml +++ b/third_party/rust/diplomat-runtime/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "diplomat-runtime" -version = "0.5.2" +version = "0.7.0" authors = [ "Shadaj Laddad ", "Manish Goregaokar ", @@ -25,10 +25,12 @@ keywords = [ "codegen", ] categories = ["development-tools"] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/rust-diplomat/diplomat" [lib] path = "src/lib.rs" -[dependencies] +[dependencies.log] +version = "0.4" +optional = true diff --git a/third_party/rust/diplomat-runtime/src/lib.rs b/third_party/rust/diplomat-runtime/src/lib.rs index b6aa6dbb5c6e..fa1c5d7dda20 100644 --- a/third_party/rust/diplomat-runtime/src/lib.rs +++ b/third_party/rust/diplomat-runtime/src/lib.rs @@ -5,9 +5,8 @@ extern crate alloc; use alloc::alloc::Layout; #[cfg(target_arch = "wasm32")] +// defines `extern "C" diplomat_init()` mod wasm_glue; -#[cfg(target_arch = "wasm32")] -pub use wasm_glue::{console_log, console_trace, console_warn}; mod writeable; pub use writeable::DiplomatWriteable; diff --git a/third_party/rust/diplomat-runtime/src/wasm_glue.rs b/third_party/rust/diplomat-runtime/src/wasm_glue.rs index 5fdc0452186f..98a46139a3e9 100644 --- a/third_party/rust/diplomat-runtime/src/wasm_glue.rs +++ b/third_party/rust/diplomat-runtime/src/wasm_glue.rs @@ -1,43 +1,94 @@ -// minimal WASM logger based on https://github.com/DeMille/wasm-glue -extern "C" { - fn trace_js(ptr: *const u8, len: usize); - fn warn_js(ptr: *const u8, len: usize); - fn log_js(ptr: *const u8, len: usize); -} - -/// Throw an exception. -pub fn console_trace(msg: &str) { - unsafe { - trace_js(msg.as_ptr(), msg.len()); - } -} - -/// Write a message to `console.warn`. -pub fn console_warn(msg: &str) { - unsafe { warn_js(msg.as_ptr(), msg.len()) } -} - -/// Write a message to `console.log`. -pub fn console_log(msg: &str) { - unsafe { log_js(msg.as_ptr(), msg.len()) } -} +use alloc::format; +use core::panic::PanicInfo; #[no_mangle] -pub unsafe extern "C" fn diplomat_init() { +unsafe extern "C" fn diplomat_init() { #[cfg(debug_assertions)] - // Sets a custom panic hook using `trace_js`, which by default crates a JS error - std::panic::set_hook(Box::new(|info| { - let file = info.location().unwrap().file(); - let line = info.location().unwrap().line(); - let col = info.location().unwrap().column(); - - let msg = match info.payload().downcast_ref::<&'static str>() { - Some(&s) => s, - None => match info.payload().downcast_ref::() { - Some(s) => s.as_str(), - None => "Box", - }, - }; - console_trace(&format!("Panicked at '{msg}', {file}:{line}:{col}")); - })); + std::panic::set_hook(Box::new(panic_handler)); + #[cfg(feature = "log")] + log::set_logger(&ConsoleLogger) + .map(|()| log::set_max_level(log::LevelFilter::Debug)) + .unwrap(); +} + +fn panic_handler(info: &PanicInfo) { + let msg = match info.payload().downcast_ref::<&'static str>() { + Some(&s) => s, + None => match info.payload().downcast_ref::() { + Some(s) => s.as_str(), + None => "Box", + }, + }; + + let msg = match info.location() { + Some(l) => format!( + "wasm panicked at {}:{}:{}:\n{msg}", + l.file(), + l.line(), + l.column(), + ), + None => format!("wasm panicked at :\n{msg}"), + }; + + extern "C" { + fn diplomat_throw_error_js(ptr: *const u8, len: usize); + } + + unsafe { diplomat_throw_error_js(msg.as_ptr(), msg.len()) } +} + +#[cfg(feature = "log")] +struct ConsoleLogger; + +#[cfg(feature = "log")] +impl log::Log for ConsoleLogger { + #[inline] + fn enabled(&self, metadata: &log::Metadata) -> bool { + metadata.level() <= log::max_level() + } + + fn log(&self, record: &log::Record) { + if !self.enabled(record.metadata()) { + return; + } + + let out = match record.level() { + log::Level::Error => { + extern "C" { + fn diplomat_console_error_js(ptr: *const u8, len: usize); + } + diplomat_console_error_js + } + log::Level::Warn => { + extern "C" { + fn diplomat_console_warn_js(ptr: *const u8, len: usize); + } + diplomat_console_warn_js + } + log::Level::Info => { + extern "C" { + fn diplomat_console_info_js(ptr: *const u8, len: usize); + } + diplomat_console_info_js + } + log::Level::Debug => { + extern "C" { + fn diplomat_console_log_js(ptr: *const u8, len: usize); + } + diplomat_console_log_js + } + log::Level::Trace => { + extern "C" { + fn diplomat_console_debug_js(ptr: *const u8, len: usize); + } + diplomat_console_debug_js + } + }; + + let msg = alloc::format!("{}", record.args()); + + unsafe { out(msg.as_ptr(), msg.len()) }; + } + + fn flush(&self) {} } diff --git a/third_party/rust/diplomat/.cargo-checksum.json b/third_party/rust/diplomat/.cargo-checksum.json index 72395383f4f4..e68087c07344 100644 --- a/third_party/rust/diplomat/.cargo-checksum.json +++ b/third_party/rust/diplomat/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"8ae49bf1abfabd0c4013a0629f806795773baeca9e99605e485c6d9060d5f18e","LICENSE-APACHE":"639c20c7f14fb122750d5ad1a6cfb116d9bf8d103e709ee40949e5a12a731666","LICENSE-MIT":"3337fe6e4a3830ad87c23cb9d6d750f9a1e5c45efc08de9c76c1a207fc6966c4","src/enum_convert.rs":"c0068cb8b563043030186cd9a0be6a4eac1a5f1761fe3646a99528e6d3dc5f54","src/lib.rs":"e606ade5f7cc5b43f56b07511b34fe5c0eb2e53640a347d17585062bf9cdea7c","src/snapshots/diplomat__tests__cfgd_struct.snap":"2874497e83ba3f43541d90869bfa428973c5b23df7fec2826e187d530f1a620b","src/snapshots/diplomat__tests__cfged_method-2.snap":"45f4c58a153cfc8a01d24fcd4474cd7ff84e34ed8b75e718143c16edd884c510","src/snapshots/diplomat__tests__cfged_method.snap":"b478d2d14e01209b45032b092bf91a2068f08f704b2395bc3ebd2ada21141077","src/snapshots/diplomat__tests__method_taking_mutable_slice.snap":"eafa335a999e416a044d32106e096ef57b7f41fb2f74b03d4adce13e7179b03d","src/snapshots/diplomat__tests__method_taking_mutable_str.snap":"e4c65337861a78b3c9762545fcdbccc1169bab9183ff750fc467a5367dba9c56","src/snapshots/diplomat__tests__method_taking_slice.snap":"eb2d7d00381ddef71411c170ce27d2490acfe9322bc3de397fe1cedcedeeee7b","src/snapshots/diplomat__tests__method_taking_str.snap":"92aa38d8618f0d52d5bc967a8d67a87f4b9cdc4f8651c624a9cc7b73033dbaa4","src/snapshots/diplomat__tests__mod_with_enum.snap":"fc225e910aa1afe496eb8d4da4342894f7786c53e12725b2f70018cf5230dddc","src/snapshots/diplomat__tests__mod_with_rust_result.snap":"48e30564d2cf0477db7062c58842b264d0cfec1d635e7dbaf12c12a2e9f1ab31","src/snapshots/diplomat__tests__mod_with_writeable_result.snap":"6ddbc34dbf7d362366cddda70c87a2f25d7ba0821ccbab90b5a79748f1064593","src/snapshots/diplomat__tests__multilevel_borrows.snap":"708fb54c2c3b8498aac83c20af891e12212874b94691fd734fd57f500ce54666","src/snapshots/diplomat__tests__self_params.snap":"1f6652799973e4afa751afebd6306e71ea439640cc1cae9848c5757d060bf699","src/transparent_convert.rs":"dde901986a6709a21f359596e85bc4fd009bb645c79b698d5af8e2a603996ac4"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"42a489a0e146bba3fe0d2c1e9abc24f8f24164404b88c687a53c575864ac7a7e","LICENSE-APACHE":"639c20c7f14fb122750d5ad1a6cfb116d9bf8d103e709ee40949e5a12a731666","LICENSE-MIT":"3337fe6e4a3830ad87c23cb9d6d750f9a1e5c45efc08de9c76c1a207fc6966c4","src/enum_convert.rs":"c0068cb8b563043030186cd9a0be6a4eac1a5f1761fe3646a99528e6d3dc5f54","src/lib.rs":"e05eb7285e68c64ee6936868cb3b39bfac041ee722bb4ecd6fb892fdf8bcff06","src/snapshots/diplomat__tests__cfgd_struct.snap":"2874497e83ba3f43541d90869bfa428973c5b23df7fec2826e187d530f1a620b","src/snapshots/diplomat__tests__cfged_method-2.snap":"b2ff2801b5f1e08bf660c63a5b8763cf99326e0b9d13cdcc9ae82532825727b2","src/snapshots/diplomat__tests__cfged_method.snap":"b478d2d14e01209b45032b092bf91a2068f08f704b2395bc3ebd2ada21141077","src/snapshots/diplomat__tests__method_taking_mutable_slice.snap":"eafa335a999e416a044d32106e096ef57b7f41fb2f74b03d4adce13e7179b03d","src/snapshots/diplomat__tests__method_taking_mutable_str.snap":"e4c65337861a78b3c9762545fcdbccc1169bab9183ff750fc467a5367dba9c56","src/snapshots/diplomat__tests__method_taking_slice.snap":"eb2d7d00381ddef71411c170ce27d2490acfe9322bc3de397fe1cedcedeeee7b","src/snapshots/diplomat__tests__method_taking_str.snap":"92aa38d8618f0d52d5bc967a8d67a87f4b9cdc4f8651c624a9cc7b73033dbaa4","src/snapshots/diplomat__tests__mod_with_enum.snap":"fc225e910aa1afe496eb8d4da4342894f7786c53e12725b2f70018cf5230dddc","src/snapshots/diplomat__tests__mod_with_rust_result.snap":"48e30564d2cf0477db7062c58842b264d0cfec1d635e7dbaf12c12a2e9f1ab31","src/snapshots/diplomat__tests__mod_with_writeable_result.snap":"6ddbc34dbf7d362366cddda70c87a2f25d7ba0821ccbab90b5a79748f1064593","src/snapshots/diplomat__tests__multilevel_borrows.snap":"708fb54c2c3b8498aac83c20af891e12212874b94691fd734fd57f500ce54666","src/snapshots/diplomat__tests__self_params.snap":"1f6652799973e4afa751afebd6306e71ea439640cc1cae9848c5757d060bf699","src/transparent_convert.rs":"dde901986a6709a21f359596e85bc4fd009bb645c79b698d5af8e2a603996ac4"},"package":"a31672b3ebc3c7866c3c98726f7a9a5ac8f13962e77d3c8225f6be49a7b8c5f2"} \ No newline at end of file diff --git a/third_party/rust/diplomat/Cargo.toml b/third_party/rust/diplomat/Cargo.toml index c0587af469e3..af5ef28fa691 100644 --- a/third_party/rust/diplomat/Cargo.toml +++ b/third_party/rust/diplomat/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "diplomat" -version = "0.5.2" +version = "0.7.0" authors = [ "Shadaj Laddad ", "Manish Goregaokar ", @@ -25,20 +25,21 @@ keywords = [ "codegen", ] categories = ["development-tools"] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/rust-diplomat/diplomat" [lib] path = "src/lib.rs" proc-macro = true -[dependencies] -proc-macro2 = "1.0.27" -quote = "1.0" - [dependencies.diplomat_core] -version = "0.5.2" -path = "../core" +version = "0.7.0" + +[dependencies.proc-macro2] +version = "1.0.27" + +[dependencies.quote] +version = "1.0" [dependencies.syn] version = "2.0" @@ -47,6 +48,8 @@ features = [ "extra-traits", ] -[dev-dependencies] -insta = "1.7.1" -tempfile = "3.2.0" +[dev-dependencies.insta] +version = "1.7.1" + +[dev-dependencies.tempfile] +version = "3.2.0" diff --git a/third_party/rust/diplomat/src/lib.rs b/third_party/rust/diplomat/src/lib.rs index 19e41d6028ac..dad44bff62a4 100644 --- a/third_party/rust/diplomat/src/lib.rs +++ b/third_party/rust/diplomat/src/lib.rs @@ -7,11 +7,10 @@ use diplomat_core::ast; mod enum_convert; mod transparent_convert; -fn cfgs_to_stream(attrs: &[String]) -> proc_macro2::TokenStream { - attrs.iter().fold(quote!(), |prev, attr| { - let attr = attr.parse::().unwrap(); - quote!(#prev #attr) - }) +fn cfgs_to_stream(attrs: &[Attribute]) -> proc_macro2::TokenStream { + attrs + .iter() + .fold(quote!(), |prev, attr| quote!(#prev #attr)) } fn gen_params_at_boundary(param: &ast::Param, expanded_params: &mut Vec) { @@ -197,7 +196,7 @@ fn gen_custom_type_method(strct: &ast::CustomType, m: &ast::Method) -> Item { }) .collect::>(); - let cfg = cfgs_to_stream(&m.cfg_attrs); + let cfg = cfgs_to_stream(&m.attrs.cfg); if writeable_flushes.is_empty() { Item::Fn(syn::parse_quote! { @@ -241,7 +240,7 @@ impl AttributeInfo { if seg == "opaque" { opaque = true; return false; - } else if seg == "rust_link" || seg == "out" { + } else if seg == "rust_link" || seg == "out" || seg == "attr" { // diplomat-tool reads these, not diplomat::bridge. // throw them away so rustc doesn't complain about unknown attributes return false; @@ -291,6 +290,12 @@ fn gen_bridge(input: ItemMod) -> ItemMod { if info.opaque { panic!("#[diplomat::opaque] not allowed on enums") } + for v in &mut e.variants { + let info = AttributeInfo::extract(&mut v.attrs); + if info.opaque { + panic!("#[diplomat::opaque] not allowed on enum variants"); + } + } *e = syn::parse_quote! { #[repr(C)] #e @@ -331,7 +336,7 @@ fn gen_bridge(input: ItemMod) -> ItemMod { (quote! {}, quote! {}) }; - let cfg = cfgs_to_stream(custom_type.cfg_attrs()); + let cfg = cfgs_to_stream(&custom_type.attrs().cfg); // for now, body is empty since all we need to do is drop the box // TODO(#13): change to take a `*mut` and handle DST boxes appropriately diff --git a/third_party/rust/diplomat/src/snapshots/diplomat__tests__cfged_method-2.snap b/third_party/rust/diplomat/src/snapshots/diplomat__tests__cfged_method-2.snap index c917e1947de9..b026704b8dc5 100644 --- a/third_party/rust/diplomat/src/snapshots/diplomat__tests__cfged_method-2.snap +++ b/third_party/rust/diplomat/src/snapshots/diplomat__tests__cfged_method-2.snap @@ -13,8 +13,8 @@ mod ffi { } } #[no_mangle] - #[cfg(feature = "bar")] #[cfg(feature = "foo")] + #[cfg(feature = "bar")] extern "C" fn Foo_bar(s: u8) { Foo::bar(s) } diff --git a/third_party/rust/diplomat_core/.cargo-checksum.json b/third_party/rust/diplomat_core/.cargo-checksum.json index d0548cab6552..9944440dc0f4 100644 --- a/third_party/rust/diplomat_core/.cargo-checksum.json +++ b/third_party/rust/diplomat_core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ae4ad17c17bb15562639ac1f33e4870a245ef3e3be44090b7c77a001e27e7847","LICENSE-APACHE":"639c20c7f14fb122750d5ad1a6cfb116d9bf8d103e709ee40949e5a12a731666","LICENSE-MIT":"3337fe6e4a3830ad87c23cb9d6d750f9a1e5c45efc08de9c76c1a207fc6966c4","src/ast/attrs.rs":"df6cfb066fb921c72d1db6caa54e23034c0db98e6ab25269c941a402e910bd5c","src/ast/docs.rs":"254046792b18abbb07a9104d2fabc085e2ee63a69f63655cb1f349eb7d5fcd03","src/ast/enums.rs":"4d08ad2a6082d8c83b5470cf451d78da46a74fec1bd672ec5f6eb034933c1c12","src/ast/idents.rs":"05c7245ce6cb0d46b070f92a4996247545e1699da66d546bfd039a1e3a1a717d","src/ast/lifetimes.rs":"edf23c23de1527a9a628f9c0036998ffee173fd03d77176ec337dc9bc71d5095","src/ast/methods.rs":"193857701ed6fd7dc8b0fec550b3bbfa3c865233d81ece9f75f99e7c7a303b03","src/ast/mod.rs":"3cb72d09defd13487d110fa794390dc2fca5b06bd0918f74d683c6fc26614621","src/ast/modules.rs":"030b5d1a3e85334df0dce0334fbdc39b8a62f351a9b7a44b00cfd3d418297703","src/ast/paths.rs":"469e6184b24567b5c2b445aa69b8a6fcd9dc0682189ebce75050870d7197e523","src/ast/snapshots/diplomat_core__ast__enums__tests__enum_with_discr.snap":"40eeef62000de13291f7c7cb737cd68defc9613c70b6a1660d50a3503c1c67c1","src/ast/snapshots/diplomat_core__ast__enums__tests__simple_enum.snap":"ef3d53415593fc6045c90d53e9a21a8515e3a7fc43859d33d86a03e92413e514","src/ast/snapshots/diplomat_core__ast__methods__tests__cfged_method.snap":"57a28e10b9089324d72bd58c689cd13c6054cae5a501fe4051179df4de4d9fc6","src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods-2.snap":"4a2b2c5fbef8b0d7a47903e19f82498d2c1cf470287892313bea97a3ddd88ad6","src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods.snap":"e466d005550cfd12627717f74534cc59f5e6d4e435bf5f99764eb95669afd7d1","src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods-2.snap":"9bb60225e6ca1d676cb88b6482bd23d531d799cbbe54d483dc80cd13b216bc08","src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods.snap":"ddfae79cde8658ccd197c9b92d31f4d9be56e52086797cf4ec3df1026c36d9e5","src/ast/snapshots/diplomat_core__ast__modules__tests__import_in_non_diplomat_not_analyzed.snap":"3e0026f442c6162bb5497a76370f662aa8ca1f9c808edde69739dffc99819b75","src/ast/snapshots/diplomat_core__ast__modules__tests__method_visibility.snap":"8914e0eaecdf855a70966875e700742265feef8137dac74b8d2059ffd972e29b","src/ast/snapshots/diplomat_core__ast__modules__tests__simple_mod.snap":"dc0c4705db8b979e45cd42701282e3380048e0aebedde540528e1180cb872e1b","src/ast/snapshots/diplomat_core__ast__structs__tests__simple_struct.snap":"eb63f34275a6bf03bad5920c96484608061dc7361d8a5da03a9bb60cb53db789","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-2.snap":"75c377161d51dc0c4d7d91b59b04c1de62b5dffaa1a2c9cac7841ce359f82d9d","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-3.snap":"418ff306adad93373b277f1a2fa02d1c9e66c54534d2f675288e05dcdec9696f","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-4.snap":"d247786f82ee693792c1309e89c5ade648c9e53c8c6c337a0eb297a91146d022","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-5.snap":"9a7b7dde9399f300bfcd739506ded5113021880629d75291b962984ec1e8fe8c","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-6.snap":"ff1e3b2867786c467ef1148d2837da441a23e4b32d7a284a438ff5c317bafc81","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-7.snap":"b5a8f071bb237ac52dbc208d78a7b63c938ef23da5954c7d186d06521333d49f","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes.snap":"6306fae6bc6fbaf5eb679bf3313877259f9ccc09232da568fd98fe8e20eab284","src/ast/snapshots/diplomat_core__ast__types__tests__typename_boxes-2.snap":"97946b1e3118aec7ac7490f0bf38ba45013bb63c5d6bac12e3dd20fc7103348f","src/ast/snapshots/diplomat_core__ast__types__tests__typename_boxes.snap":"e3a1a07e2bfa0869918c973983b658a8e4123203f86a54a743dc6aff6a984f65","src/ast/snapshots/diplomat_core__ast__types__tests__typename_named.snap":"30b58ef9e59641eea9dfba9b965256d7a5d8667e241b7a209eb7d09208d75f7e","src/ast/snapshots/diplomat_core__ast__types__tests__typename_option-2.snap":"c8b559341b0c0c376c4feb666d6cfb37ca8ee57eaae52831b963d8ace8b2e063","src/ast/snapshots/diplomat_core__ast__types__tests__typename_option.snap":"2b9409a8e150badfc2dac1602e8654bfbb88f8795fc71f356ac25be8f67fb4b2","src/ast/snapshots/diplomat_core__ast__types__tests__typename_primitives-2.snap":"506dcd6ea86644d4043229804bf615c8bc34cd20feef2204cd755674bf3cd00f","src/ast/snapshots/diplomat_core__ast__types__tests__typename_primitives-3.snap":"b92cd7f7cb2877c83ed8fac16d27b670e0e9d501cd6b3f70db84b322b686405f","src/ast/snapshots/diplomat_core__ast__types__tests__typename_primitives.snap":"c086765d65faac19f529a03f50ca0566cfe4e9a10b32f608ae4b9c3ad27ffdad","src/ast/snapshots/diplomat_core__ast__types__tests__typename_references-2.snap":"3ced7f6c3e2078d9534dff84e5e4a200efa84bf94435fde478c9e02b4a2b2053","src/ast/snapshots/diplomat_core__ast__types__tests__typename_references.snap":"77d5bcd560adff2216e349e0c87cff988501aef22848fbf1906b6b622ffe47cf","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result-2.snap":"257ca08f5836a21dfd871d11939ba167c336ed3b870e92a64efffca0fd1be028","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result-3.snap":"4210a8443eb02300e75e9eecb303dc2b0d10957901b7f1f82c0c66bc6c202798","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result-4.snap":"2e552e3acfe7334184f6a96b92a2aaf8a3539ea690ba378066159e822ab28927","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result.snap":"78b46313c00d7d2c830dbd482f8373a32ef5ae2104a1c83c74f9f12a62e0c99b","src/ast/snapshots/diplomat_core__ast__validity__tests__non_opaque_move.snap":"306bd6b571d09c4c9818d5b0bf60e2133e91247baa11fcfa38e2fc36d84358ac","src/ast/snapshots/diplomat_core__ast__validity__tests__opaque_checks_with_error.snap":"47febefdb2c7b41ab9ad197686b7729a68a706560dec6d429e0bb845ed67b0a1","src/ast/snapshots/diplomat_core__ast__validity__tests__opaque_checks_with_safe_use.snap":"4d5cd288ce61bd0ddd64bdf48bc9d87230087826597b3da80bb375ae11eaad22","src/ast/snapshots/diplomat_core__ast__validity__tests__opaque_ffi.snap":"229cadc16aa8748d4c53fb74702e240aa68bd4c82cc5912bd4118b99490fdc8d","src/ast/snapshots/diplomat_core__ast__validity__tests__option_invalid.snap":"8047a015af428da524a2f92e219358ebf33c78dff0b4c8b1055aea56db534b2a","src/ast/snapshots/diplomat_core__ast__validity__tests__option_valid.snap":"e4cdd3e7eab0a301a33cafd816fd4d0b52ae4e787dd2b5bd411f4b5c60830b7e","src/ast/snapshots/diplomat_core__ast__validity__tests__zst_non_opaque.snap":"c633eef30f39a376b86bca26338bf89d5ca3b6acc657ece8af144f1fd36cbc4d","src/ast/structs.rs":"84dfbf61253be28f6d5dd88906770f9af68e49950d2378e3581e2d4489cbfb18","src/ast/types.rs":"bc0e0e544387f3309c2fd32bbca176c8b3b38374d030e002ce1b4ea6b75c96e8","src/ast/validity.rs":"2bf93e65295f9ae5144bf04b642df8abe1f73b2db42eae41dcee040c8608b519","src/environment.rs":"2b767884b4e92119a9cfd0d88a47a64966f494f2cf8663729900dcb77bd16588","src/hir/defs.rs":"b035bf46e17ef5225fc430c485b03160f20164af0802689ea5e6ab1e8ebc1afe","src/hir/elision.rs":"f687c62e85fe634e6a086f5dd1871bd2fedfcffc73351fdfe1fea06883e31025","src/hir/lifetimes.rs":"b706f2c62b3217fdf8075fceeb5b0345c76acf1eb39941e182237407485bed5a","src/hir/lowering.rs":"c476cc8fa64d0aa3c67dbf2c51baa7d6b508adcb9db4f635264eebf0a4c10acd","src/hir/methods.rs":"4d5def24154ba6a917d4435555908f4ce6fbe95cd1a3ce4f14b0aa1e44cf38e7","src/hir/mod.rs":"fb5a446e2f94ee32efc5625120c7292d999502603cc5c5cb56fe469207982778","src/hir/paths.rs":"e120abdf0864b7e87c4c706fb4e4ad76db89049f3eeffdd3246bec4d091d8155","src/hir/primitives.rs":"c1cf8202aa95331590777a4f429ea5d68da4f64ddc8eddadce612246416953d3","src/hir/snapshots/diplomat_core__hir__elision__tests__borrowing_fields.snap":"eafdd16fb9ebfcebebd0517f361f8653b00275318aa27e44086a860b6f0bc39d","src/hir/snapshots/diplomat_core__hir__elision__tests__simple_mod.snap":"935af3ef7d70a9e9e659fcf2215e18f41bc32ab034430d7303d534cd0e294909","src/hir/ty_position.rs":"87fad133539d7c9bda7900791923d8c5198b33dbe368336e0ecf9e629781b4cf","src/hir/type_context.rs":"bc1c1e84639d724973a5d5acb108501e7414399ee6bcd2ceb4b11c700ab148b3","src/hir/types.rs":"01122d50f86dc5caaf31d844d2f8e37bfe1c7a88884b78128701d0f97d37247f","src/lib.rs":"23da7804b822960757426835da904118c7afafa59cf631fb1d4b946c7af28f64"},"package":null} \ No newline at end of file +{"files":{"Cargo.toml":"a9618d876e30e96ace4eae7928d0be4ff1999d884a68dfed64aac5c32c9465e6","LICENSE-APACHE":"639c20c7f14fb122750d5ad1a6cfb116d9bf8d103e709ee40949e5a12a731666","LICENSE-MIT":"3337fe6e4a3830ad87c23cb9d6d750f9a1e5c45efc08de9c76c1a207fc6966c4","src/ast/attrs.rs":"d07bd18257a157c74407d4c28a26144dccad34dc82a8b3826f2619dcca25e737","src/ast/docs.rs":"f515cf8aed78811934512874adb2840620aeebac519aa3a2af4e3b4e982ebe82","src/ast/enums.rs":"3ed67cb4a1e15d73e9f8c8c0a68aa675d8ca8f7f8239e5c766bc879cc89b92e6","src/ast/idents.rs":"05c7245ce6cb0d46b070f92a4996247545e1699da66d546bfd039a1e3a1a717d","src/ast/lifetimes.rs":"2d53eff8c2dcf6d253cbdc46ffd95b05661006e31884831a2db01aab64aca43d","src/ast/methods.rs":"9a9155c5e9fb8bdfdde83885801a6de96b9eb9ff4fff128fc1b9ccb4b2c11e3b","src/ast/mod.rs":"765a9f32a4941aef324271c7ad0e03b64bdbbdafea99b5da04f2abbb4433bcd6","src/ast/modules.rs":"d86b61da1c63d3baeec25762acea87dab58d15b8a46cb29c4c4c4b8062efbfef","src/ast/paths.rs":"480bef69cb395eb931a7e086ccde7b49f508ace10e61367002c4b072b9dd4b44","src/ast/snapshots/diplomat_core__ast__attrs__tests__attr.snap":"a67d1d88995e5140fae1b85175885c79e833a6c09d30df164bb800cf70bb9725","src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-2.snap":"1fbb268bb55cad81803555e0552948bfa9ee1edc161f76b0e26bb5c16ac8389b","src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-3.snap":"ed4ba8423cb7605fd7a5e3faf35baafa58ce6758b50da2c98ccc0cd60792bfff","src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-4.snap":"ed4ba8423cb7605fd7a5e3faf35baafa58ce6758b50da2c98ccc0cd60792bfff","src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-5.snap":"2cbfa3d75adb944b19a4e0abdfa5cf7f9a4f82cdcd4d4b0efdbf1c857dc12aaf","src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs.snap":"0f42d7d22c82d1950aea7a59ead36701d6d572efe0d0969608afa58d8780e052","src/ast/snapshots/diplomat_core__ast__enums__tests__enum_with_discr.snap":"e59ebcc9a8e252cc2b9da45f43cd4022c69e7b26c3cf98c7badc73b1b09c4889","src/ast/snapshots/diplomat_core__ast__enums__tests__simple_enum.snap":"1aad7fb70fdf6c8af8b7a43c4d84850c91af7ae737901f71c6aea14f8e713862","src/ast/snapshots/diplomat_core__ast__methods__tests__cfged_method.snap":"dd2f1be92b0187c61db019a486b28e08f6f850280e4fedc8e117c8097ed92e11","src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods-2.snap":"ac71d6ef7f5853af89a5c5ae6a1161ae1f812eebae52699f9108669187de9317","src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods.snap":"2f3bf29aadae11c2e05e11f2b450330dc730c3999539b4df5afeebddb7208c4c","src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods-2.snap":"9c1d9da205ee5e80f100172c8b0e952763281317094b93faee88402569b58531","src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods.snap":"e3b5d600642175cc9d0377d81978bd53a3dc8e46b0388a7c54fed057701b11ca","src/ast/snapshots/diplomat_core__ast__modules__tests__import_in_non_diplomat_not_analyzed.snap":"2016cea66b1cb0edd259af3c2f70e7c9c4efff98f39c08a21e7832dbf99a46fe","src/ast/snapshots/diplomat_core__ast__modules__tests__method_visibility.snap":"357fab6f3f0249ec298fe37a380cb90ec86a9e80a9647145bdd736aef30c5ec9","src/ast/snapshots/diplomat_core__ast__modules__tests__simple_mod.snap":"5a544b0c474ecad8bab1d615e296bc6b4962caf4cdd630423d4133de468a13db","src/ast/snapshots/diplomat_core__ast__structs__tests__simple_struct.snap":"22ba644eaaa88b76911525460bd4f42f911985a0b63913de0efb44d0c19a320d","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-2.snap":"75c377161d51dc0c4d7d91b59b04c1de62b5dffaa1a2c9cac7841ce359f82d9d","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-3.snap":"418ff306adad93373b277f1a2fa02d1c9e66c54534d2f675288e05dcdec9696f","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-4.snap":"d247786f82ee693792c1309e89c5ade648c9e53c8c6c337a0eb297a91146d022","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-5.snap":"9a7b7dde9399f300bfcd739506ded5113021880629d75291b962984ec1e8fe8c","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-6.snap":"ff1e3b2867786c467ef1148d2837da441a23e4b32d7a284a438ff5c317bafc81","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes-7.snap":"b5a8f071bb237ac52dbc208d78a7b63c938ef23da5954c7d186d06521333d49f","src/ast/snapshots/diplomat_core__ast__types__tests__lifetimes.snap":"6306fae6bc6fbaf5eb679bf3313877259f9ccc09232da568fd98fe8e20eab284","src/ast/snapshots/diplomat_core__ast__types__tests__typename_boxes-2.snap":"97946b1e3118aec7ac7490f0bf38ba45013bb63c5d6bac12e3dd20fc7103348f","src/ast/snapshots/diplomat_core__ast__types__tests__typename_boxes.snap":"e3a1a07e2bfa0869918c973983b658a8e4123203f86a54a743dc6aff6a984f65","src/ast/snapshots/diplomat_core__ast__types__tests__typename_named.snap":"30b58ef9e59641eea9dfba9b965256d7a5d8667e241b7a209eb7d09208d75f7e","src/ast/snapshots/diplomat_core__ast__types__tests__typename_option-2.snap":"c8b559341b0c0c376c4feb666d6cfb37ca8ee57eaae52831b963d8ace8b2e063","src/ast/snapshots/diplomat_core__ast__types__tests__typename_option.snap":"2b9409a8e150badfc2dac1602e8654bfbb88f8795fc71f356ac25be8f67fb4b2","src/ast/snapshots/diplomat_core__ast__types__tests__typename_primitives-2.snap":"506dcd6ea86644d4043229804bf615c8bc34cd20feef2204cd755674bf3cd00f","src/ast/snapshots/diplomat_core__ast__types__tests__typename_primitives-3.snap":"b92cd7f7cb2877c83ed8fac16d27b670e0e9d501cd6b3f70db84b322b686405f","src/ast/snapshots/diplomat_core__ast__types__tests__typename_primitives.snap":"c086765d65faac19f529a03f50ca0566cfe4e9a10b32f608ae4b9c3ad27ffdad","src/ast/snapshots/diplomat_core__ast__types__tests__typename_references-2.snap":"3ced7f6c3e2078d9534dff84e5e4a200efa84bf94435fde478c9e02b4a2b2053","src/ast/snapshots/diplomat_core__ast__types__tests__typename_references.snap":"77d5bcd560adff2216e349e0c87cff988501aef22848fbf1906b6b622ffe47cf","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result-2.snap":"257ca08f5836a21dfd871d11939ba167c336ed3b870e92a64efffca0fd1be028","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result-3.snap":"4210a8443eb02300e75e9eecb303dc2b0d10957901b7f1f82c0c66bc6c202798","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result-4.snap":"2e552e3acfe7334184f6a96b92a2aaf8a3539ea690ba378066159e822ab28927","src/ast/snapshots/diplomat_core__ast__types__tests__typename_result.snap":"78b46313c00d7d2c830dbd482f8373a32ef5ae2104a1c83c74f9f12a62e0c99b","src/ast/snapshots/diplomat_core__ast__validity__tests__non_opaque_move.snap":"306bd6b571d09c4c9818d5b0bf60e2133e91247baa11fcfa38e2fc36d84358ac","src/ast/snapshots/diplomat_core__ast__validity__tests__opaque_checks_with_error.snap":"47febefdb2c7b41ab9ad197686b7729a68a706560dec6d429e0bb845ed67b0a1","src/ast/snapshots/diplomat_core__ast__validity__tests__opaque_checks_with_safe_use.snap":"4d5cd288ce61bd0ddd64bdf48bc9d87230087826597b3da80bb375ae11eaad22","src/ast/snapshots/diplomat_core__ast__validity__tests__opaque_ffi.snap":"229cadc16aa8748d4c53fb74702e240aa68bd4c82cc5912bd4118b99490fdc8d","src/ast/snapshots/diplomat_core__ast__validity__tests__option_invalid.snap":"8047a015af428da524a2f92e219358ebf33c78dff0b4c8b1055aea56db534b2a","src/ast/snapshots/diplomat_core__ast__validity__tests__option_valid.snap":"e4cdd3e7eab0a301a33cafd816fd4d0b52ae4e787dd2b5bd411f4b5c60830b7e","src/ast/snapshots/diplomat_core__ast__validity__tests__zst_non_opaque.snap":"c633eef30f39a376b86bca26338bf89d5ca3b6acc657ece8af144f1fd36cbc4d","src/ast/structs.rs":"fe07e161899bb9a90423b34ae055598317202529abb07d092c7f6f10649a0fa2","src/ast/types.rs":"7d6736219e743d897493c52b2e953e134127419dd4c9bc432557d53f67fbb268","src/ast/validity.rs":"9c206b32509708ddb769bdf4e482cca8c27cf6feb36d73fef72d2cbc21f25d63","src/environment.rs":"2b767884b4e92119a9cfd0d88a47a64966f494f2cf8663729900dcb77bd16588","src/hir/attrs.rs":"f5c73fc4d4c4840a551e4d504e624d33a87df703f0b1e7b0154d5aa3e521a8e2","src/hir/defs.rs":"3d61794ba1606798a3df9f964349b70a2c12c877c2f1f350e2cd1e6367d02136","src/hir/elision.rs":"c4bafbc9fe1cb24ae1acc193b303cba89dbc944a929efb3bcd38f8177bba344f","src/hir/lifetimes.rs":"ba9ca97fe368d530df29087a3dd92d243e17f4d160321dcbe6d596235bf60791","src/hir/lowering.rs":"94a7d18081565fcffccb78c11f7b3d42f818f24b0fe091a08a34c90cb296f075","src/hir/methods.rs":"bac468df43bf7d6fa97afecba59bd51fbb2f84aec2be7c3b925fa01fa1f955c5","src/hir/mod.rs":"19d6f01952586154d3720269d20d70e1defc690ccfb1c59f1106db29c458555f","src/hir/paths.rs":"67d766d9b98a63dba8dbb97365fd46bc58e9f123a6a1f6797761ca2a124a6c9a","src/hir/primitives.rs":"77e637b04a6e7c2e674d25356b9da6b0c795d9db607f73c30577d0b64121345c","src/hir/snapshots/diplomat_core__hir__elision__tests__borrowing_fields.snap":"eafdd16fb9ebfcebebd0517f361f8653b00275318aa27e44086a860b6f0bc39d","src/hir/snapshots/diplomat_core__hir__elision__tests__simple_mod.snap":"dc771bcdfe2978b59bc6bbbfa29f137b087083ddfa5c1b30dc86722cda49c769","src/hir/ty_position.rs":"914b0967cbada083905db5fc3b5a0ee27fe42f2f8ee35f6dec5d4318292a9663","src/hir/type_context.rs":"5346c2777aaa300439b351d0d09c82a5be793dde0aab18d5123095490e94f3f9","src/hir/types.rs":"40702061fc7e583fe47669fe0467fe70ce474413133cb23695b81e0ce77fae56","src/lib.rs":"6bca84ef449b737270c0da7e8ae9dc82cfbd57e83c078b20c9894050274ed7e7"},"package":"bfaa5e13e8b8735d2338f2836c06cd8643902ab87dda1dd07dbb351998ddc127"} \ No newline at end of file diff --git a/third_party/rust/diplomat_core/Cargo.toml b/third_party/rust/diplomat_core/Cargo.toml index cb9b45a1d0e4..ddc7d945fa5c 100644 --- a/third_party/rust/diplomat_core/Cargo.toml +++ b/third_party/rust/diplomat_core/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "diplomat_core" -version = "0.5.2" +version = "0.7.0" authors = [ "Shadaj Laddad ", "Manish Goregaokar ", @@ -25,8 +25,9 @@ keywords = [ "codegen", ] categories = ["development-tools"] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/rust-diplomat/diplomat" +resolver = "1" [package.metadata.docs.rs] all-features = true @@ -34,20 +35,26 @@ all-features = true [lib] path = "src/lib.rs" -[dependencies] -lazy_static = "1.4.0" -proc-macro2 = "1.0.27" -quote = "1.0" -smallvec = "1.9.0" - [dependencies.displaydoc] version = "0.2" optional = true +[dependencies.lazy_static] +version = "1.4.0" + +[dependencies.proc-macro2] +version = "1.0.27" + +[dependencies.quote] +version = "1.0" + [dependencies.serde] version = "1.0" features = ["derive"] +[dependencies.smallvec] +version = "1.9.0" + [dependencies.strck_ident] version = "0.1" features = ["rust"] @@ -59,8 +66,8 @@ features = [ "extra-traits", ] -[dev-dependencies] -insta = "1.7.1" +[dev-dependencies.insta] +version = "1.7.1" [features] hir = [] diff --git a/third_party/rust/diplomat_core/src/ast/attrs.rs b/third_party/rust/diplomat_core/src/ast/attrs.rs index 43b5fed9e0ff..7be6704e20bd 100644 --- a/third_party/rust/diplomat_core/src/ast/attrs.rs +++ b/third_party/rust/diplomat_core/src/ast/attrs.rs @@ -1,10 +1,207 @@ //! This module contains utilities for dealing with Rust attributes -use syn::Attribute; +use serde::ser::{SerializeStruct, Serializer}; +use serde::Serialize; +use syn::parse::{Error as ParseError, Parse, ParseStream}; +use syn::{Attribute, Ident, LitStr, Meta, Token}; -pub(crate) fn extract_cfg_attrs(attrs: &[Attribute]) -> impl Iterator + '_ { - attrs - .iter() - .filter(|&a| a.path().is_ident("cfg")) - .map(|a| quote::quote!(#a).to_string()) +/// The list of attributes on a type +#[derive(Clone, PartialEq, Eq, Hash, Debug, Default)] +#[non_exhaustive] +pub struct Attrs { + pub cfg: Vec, + pub attrs: Vec, +} + +impl Attrs { + fn add_attr(&mut self, attr: Attr) { + match attr { + Attr::Cfg(attr) => self.cfg.push(attr), + Attr::DiplomatBackendAttr(attr) => self.attrs.push(attr), + } + } + + /// Merge attributes that should be inherited from the parent + pub(crate) fn merge_parent_attrs(&mut self, other: &Attrs) { + self.cfg.extend(other.cfg.iter().cloned()) + } + pub(crate) fn add_attrs(&mut self, attrs: &[Attribute]) { + for attr in syn_attr_to_ast_attr(attrs) { + self.add_attr(attr) + } + } + pub(crate) fn from_attrs(attrs: &[Attribute]) -> Self { + let mut this = Self::default(); + this.add_attrs(attrs); + this + } +} + +impl From<&[Attribute]> for Attrs { + fn from(other: &[Attribute]) -> Self { + Self::from_attrs(other) + } +} + +enum Attr { + Cfg(Attribute), + DiplomatBackendAttr(DiplomatBackendAttr), + // More goes here +} + +fn syn_attr_to_ast_attr(attrs: &[Attribute]) -> impl Iterator + '_ { + let cfg_path: syn::Path = syn::parse_str("cfg").unwrap(); + let dattr_path: syn::Path = syn::parse_str("diplomat::attr").unwrap(); + attrs.iter().filter_map(move |a| { + if a.path() == &cfg_path { + Some(Attr::Cfg(a.clone())) + } else if a.path() == &dattr_path { + Some(Attr::DiplomatBackendAttr( + a.parse_args() + .expect("Failed to parse malformed diplomat::attr"), + )) + } else { + None + } + }) +} + +impl Serialize for Attrs { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + // 1 is the number of fields in the struct. + let mut state = serializer.serialize_struct("Attrs", 1)?; + let cfg: Vec<_> = self + .cfg + .iter() + .map(|a| quote::quote!(#a).to_string()) + .collect(); + state.serialize_field("cfg", &cfg)?; + state.end() + } +} + +/// A `#[diplomat::attr(...)]` attribute +/// +/// Its contents must start with single element that is a CFG-expression +/// (so it may contain `foo = bar`, `foo = "bar"`, `ident`, `*` atoms, +/// and `all()`, `not()`, and `any()` combiners), and then be followed by one +/// or more backend-specific attributes, which can be any valid meta-item +#[derive(Clone, PartialEq, Eq, Hash, Debug, Serialize)] +#[non_exhaustive] +pub struct DiplomatBackendAttr { + pub cfg: DiplomatBackendAttrCfg, + #[serde(serialize_with = "serialize_meta")] + pub meta: Meta, +} + +fn serialize_meta(m: &Meta, s: S) -> Result +where + S: Serializer, +{ + quote::quote!(#m).to_string().serialize(s) +} + +#[derive(Clone, PartialEq, Eq, Hash, Debug, Serialize)] +#[non_exhaustive] +pub enum DiplomatBackendAttrCfg { + Not(Box), + Any(Vec), + All(Vec), + Star, + BackendName(String), + NameValue(String, String), +} + +impl Parse for DiplomatBackendAttrCfg { + fn parse(input: ParseStream<'_>) -> syn::Result { + let lookahead = input.lookahead1(); + if lookahead.peek(Ident) { + let name: Ident = input.parse()?; + if name == "not" { + let content; + let _paren = syn::parenthesized!(content in input); + Ok(DiplomatBackendAttrCfg::Not(Box::new(content.parse()?))) + } else if name == "any" || name == "all" { + let content; + let _paren = syn::parenthesized!(content in input); + let list = content.parse_terminated(Self::parse, Token![,])?; + let vec = list.into_iter().collect(); + if name == "any" { + Ok(DiplomatBackendAttrCfg::Any(vec)) + } else { + Ok(DiplomatBackendAttrCfg::All(vec)) + } + } else if input.peek(Token![=]) { + let _t: Token![=] = input.parse()?; + if input.peek(Ident) { + let value: Ident = input.parse()?; + Ok(DiplomatBackendAttrCfg::NameValue( + name.to_string(), + value.to_string(), + )) + } else { + let value: LitStr = input.parse()?; + Ok(DiplomatBackendAttrCfg::NameValue( + name.to_string(), + value.value(), + )) + } + } else { + Ok(DiplomatBackendAttrCfg::BackendName(name.to_string())) + } + } else if lookahead.peek(Token![*]) { + let _t: Token![*] = input.parse()?; + Ok(DiplomatBackendAttrCfg::Star) + } else { + Err(ParseError::new( + input.span(), + "CFG portion of #[diplomat::attr] fails to parse", + )) + } + } +} + +/// Meant to be used with Attribute::parse_args() +impl Parse for DiplomatBackendAttr { + fn parse(input: ParseStream<'_>) -> syn::Result { + let cfg = input.parse()?; + let _comma: Token![,] = input.parse()?; + let meta = input.parse()?; + Ok(Self { cfg, meta }) + } +} + +#[cfg(test)] +mod tests { + use insta; + + use syn; + + use super::{DiplomatBackendAttr, DiplomatBackendAttrCfg}; + + #[test] + fn test_cfgs() { + let attr_cfg: DiplomatBackendAttrCfg = syn::parse_quote!(*); + insta::assert_yaml_snapshot!(attr_cfg); + let attr_cfg: DiplomatBackendAttrCfg = syn::parse_quote!(cpp); + insta::assert_yaml_snapshot!(attr_cfg); + let attr_cfg: DiplomatBackendAttrCfg = syn::parse_quote!(has = overloading); + insta::assert_yaml_snapshot!(attr_cfg); + let attr_cfg: DiplomatBackendAttrCfg = syn::parse_quote!(has = "overloading"); + insta::assert_yaml_snapshot!(attr_cfg); + let attr_cfg: DiplomatBackendAttrCfg = + syn::parse_quote!(any(all(*, cpp, has="overloading"), not(js))); + insta::assert_yaml_snapshot!(attr_cfg); + } + + #[test] + fn test_attr() { + let attr: syn::Attribute = + syn::parse_quote!(#[diplomat::attr(any(cpp, has = "overloading"), namespacing)]); + let attr: DiplomatBackendAttr = attr.parse_args().unwrap(); + insta::assert_yaml_snapshot!(attr); + } } diff --git a/third_party/rust/diplomat_core/src/ast/docs.rs b/third_party/rust/diplomat_core/src/ast/docs.rs index 058384857981..29f23102276a 100644 --- a/third_party/rust/diplomat_core/src/ast/docs.rs +++ b/third_party/rust/diplomat_core/src/ast/docs.rs @@ -14,6 +14,7 @@ pub struct Docs(String, Vec); /// Note that this only controls markdown generated by this code. Existing markdown /// in the Rust documentation will not be sanitized in any way. #[derive(PartialEq, Eq, Clone, Debug)] +#[non_exhaustive] pub enum MarkdownStyle { /// Regular markdown with no specific extensions, compatible with most common flavors Normal, @@ -73,9 +74,12 @@ impl Docs { if rust_link.display == RustLinkDisplay::Compact { has_compact = true; } else if rust_link.display == RustLinkDisplay::Normal { + if !lines.is_empty() { + write!(lines, "\n\n").unwrap(); + } write!( lines, - "\n\nSee the [Rust documentation for {backtick}{name}{backtick}]({link}) for more information.", + "See the [Rust documentation for {backtick}{name}{backtick}]({link}) for more information.", name = rust_link.path.elements.last().unwrap(), link = docs_url_gen.gen_for_rust_link(rust_link) ) @@ -83,7 +87,10 @@ impl Docs { } } if has_compact { - write!(lines, "\n\n Additional information: ").unwrap(); + if !lines.is_empty() { + write!(lines, "\n\n").unwrap(); + } + write!(lines, "Additional information: ").unwrap(); for (i, rust_link) in self .1 .iter() @@ -111,6 +118,7 @@ impl Docs { } #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] +#[non_exhaustive] pub enum RustLinkDisplay { /// A nice expanded representation that includes the type name /// @@ -125,6 +133,7 @@ pub enum RustLinkDisplay { } #[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug, PartialOrd, Ord)] +#[non_exhaustive] pub struct RustLink { pub path: Path, pub typ: DocType, @@ -189,6 +198,7 @@ impl fmt::Display for RustLink { } #[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug, PartialOrd, Ord)] +#[non_exhaustive] pub enum DocType { Struct, StructField, diff --git a/third_party/rust/diplomat_core/src/ast/enums.rs b/third_party/rust/diplomat_core/src/ast/enums.rs index ed60a205cebc..20f012fa4209 100644 --- a/third_party/rust/diplomat_core/src/ast/enums.rs +++ b/third_party/rust/diplomat_core/src/ast/enums.rs @@ -1,18 +1,19 @@ -use serde::{Deserialize, Serialize}; +use serde::Serialize; use super::docs::Docs; -use super::{attrs, Ident, Method}; +use super::{Attrs, Ident, Method}; use quote::ToTokens; /// A fieldless enum declaration in an FFI module. -#[derive(Clone, Serialize, Deserialize, Debug, Hash, PartialEq, Eq)] +#[derive(Clone, Serialize, Debug, Hash, PartialEq, Eq)] +#[non_exhaustive] pub struct Enum { pub name: Ident, pub docs: Docs, - /// A list of variants of the enum. (name, discriminant, docs) - pub variants: Vec<(Ident, isize, Docs)>, + /// A list of variants of the enum. (name, discriminant, docs, attrs) + pub variants: Vec<(Ident, isize, Docs, Attrs)>, pub methods: Vec, - pub cfg_attrs: Vec, + pub attrs: Attrs, } impl From<&syn::ItemEnum> for Enum { @@ -27,7 +28,6 @@ impl From<&syn::ItemEnum> for Enum { panic!("Enums cannot have generic parameters"); } - let cfg_attrs = attrs::extract_cfg_attrs(&enm.attrs).collect(); Enum { name: (&enm.ident).into(), docs: Docs::from_attrs(&enm.attrs), @@ -56,11 +56,12 @@ impl From<&syn::ItemEnum> for Enum { (&v.ident).into(), new_discriminant, Docs::from_attrs(&v.attrs), + (&*v.attrs).into(), ) }) .collect(), methods: vec![], - cfg_attrs, + attrs: (&*enm.attrs).into(), } } } diff --git a/third_party/rust/diplomat_core/src/ast/lifetimes.rs b/third_party/rust/diplomat_core/src/ast/lifetimes.rs index 5530d59db862..83fbbeb7b811 100644 --- a/third_party/rust/diplomat_core/src/ast/lifetimes.rs +++ b/third_party/rust/diplomat_core/src/ast/lifetimes.rs @@ -395,6 +395,7 @@ pub(crate) struct LifetimeNode { /// A lifetime, analogous to [`syn::Lifetime`]. #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] pub enum Lifetime { /// The `'static` lifetime. Static, diff --git a/third_party/rust/diplomat_core/src/ast/methods.rs b/third_party/rust/diplomat_core/src/ast/methods.rs index 8498c97463a4..1ae6a7740f4f 100644 --- a/third_party/rust/diplomat_core/src/ast/methods.rs +++ b/third_party/rust/diplomat_core/src/ast/methods.rs @@ -1,15 +1,17 @@ -use serde::{Deserialize, Serialize}; +use serde::Serialize; use std::ops::ControlFlow; -use super::attrs; use super::docs::Docs; -use super::{Ident, Lifetime, LifetimeEnv, Mutability, Path, PathType, TypeName, ValidityError}; +use super::{ + Attrs, Ident, Lifetime, LifetimeEnv, Mutability, Path, PathType, TypeName, ValidityError, +}; use crate::Env; /// A method declared in the `impl` associated with an FFI struct. /// Includes both static and non-static methods, which can be distinguished /// by inspecting [`Method::self_param`]. -#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Serialize, Debug)] +#[non_exhaustive] pub struct Method { /// The name of the method as initially declared. pub name: Ident, @@ -36,7 +38,7 @@ pub struct Method { /// /// These are strings instead of `syn::Attribute` or `proc_macro2::TokenStream` /// because those types are not `PartialEq`, `Hash`, `Serialize`, etc. - pub cfg_attrs: Vec, + pub attrs: Attrs, } impl Method { @@ -45,7 +47,7 @@ impl Method { m: &syn::ImplItemFn, self_path_type: PathType, impl_generics: Option<&syn::Generics>, - cfg_attrs: &[String], + impl_attrs: &Attrs, ) -> Method { let self_ident = self_path_type.path.elements.last().unwrap(); let method_ident = &m.sig.ident; @@ -89,8 +91,8 @@ impl Method { return_ty.as_ref(), ); - let mut cfg_attrs = cfg_attrs.to_owned(); - cfg_attrs.extend(attrs::extract_cfg_attrs(&m.attrs)); + let mut attrs: Attrs = (&*m.attrs).into(); + attrs.merge_parent_attrs(impl_attrs); Method { name: Ident::from(method_ident), @@ -100,7 +102,7 @@ impl Method { params: all_params, return_type: return_ty, lifetime_env, - cfg_attrs, + attrs, } } @@ -242,7 +244,8 @@ impl Method { } /// The `self` parameter taken by a [`Method`]. -#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Serialize, Debug)] +#[non_exhaustive] pub struct SelfParam { /// The lifetime and mutability of the `self` param, if it's a reference. pub reference: Option<(Lifetime, Mutability)>, @@ -273,7 +276,8 @@ impl SelfParam { } /// A parameter taken by a [`Method`], not including `self`. -#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Serialize, Debug)] +#[non_exhaustive] pub struct Param { /// The name of the parameter in the original method declaration. pub name: Ident, @@ -315,6 +319,7 @@ pub enum LifetimeKind { #[derive(Default, Debug)] /// Parameters in a method that might be borrowed in the return type. +#[non_exhaustive] pub struct BorrowedParams<'a>( pub Option<&'a SelfParam>, pub Vec<(&'a Param, LifetimeKind)>, @@ -326,9 +331,10 @@ impl BorrowedParams<'_> { /// param will be called if present. pub fn return_names<'a>(&'a self, self_name: &'a Ident) -> impl Iterator { self.0.iter().map(move |_| self_name).chain( - self.1.iter().filter_map(|&(param, ltk)| { - (ltk == LifetimeKind::ReturnValue).then(|| ¶m.name) - }), + self.1 + .iter() + .filter(|(_, ltk)| (*ltk == LifetimeKind::ReturnValue)) + .map(|(param, _)| ¶m.name), ) } @@ -337,7 +343,8 @@ impl BorrowedParams<'_> { pub fn static_names(&self) -> impl Iterator { self.1 .iter() - .filter_map(|&(param, ltk)| (ltk == LifetimeKind::Static).then(|| ¶m.name)) + .filter(|(_, ltk)| (*ltk == LifetimeKind::Static)) + .map(|(param, _)| ¶m.name) } /// Returns `true` if a provided param name is included in the borrowed params, @@ -378,7 +385,7 @@ mod tests { use crate::ast::Ident; - use super::{Method, Path, PathType}; + use super::{Attrs, Method, Path, PathType}; #[test] fn static_methods() { @@ -392,7 +399,7 @@ mod tests { }, PathType::new(Path::empty().sub_path(Ident::from("MyStructContainingMethod"))), None, - &[] + &Attrs::default() )); insta::assert_yaml_snapshot!(Method::from_syn( @@ -408,7 +415,7 @@ mod tests { }, PathType::new(Path::empty().sub_path(Ident::from("MyStructContainingMethod"))), None, - &[] + &Attrs::default() )); } @@ -425,7 +432,7 @@ mod tests { }, PathType::new(Path::empty().sub_path(Ident::from("MyStructContainingMethod"))), None, - &[] + &Attrs::default() )); } @@ -439,7 +446,7 @@ mod tests { }, PathType::new(Path::empty().sub_path(Ident::from("MyStructContainingMethod"))), None, - &[] + &Attrs::default() )); insta::assert_yaml_snapshot!(Method::from_syn( @@ -451,7 +458,7 @@ mod tests { }, PathType::new(Path::empty().sub_path(Ident::from("MyStructContainingMethod"))), None, - &[] + &Attrs::default() )); } @@ -461,7 +468,7 @@ mod tests { &syn::parse_quote! { $($tokens)* }, PathType::new(Path::empty().sub_path(Ident::from("MyStructContainingMethod"))), None, - &[] + &Attrs::default() ); let borrowed_params = method.borrowed_params(); diff --git a/third_party/rust/diplomat_core/src/ast/mod.rs b/third_party/rust/diplomat_core/src/ast/mod.rs index c034c1f89370..cb055c0554ea 100644 --- a/third_party/rust/diplomat_core/src/ast/mod.rs +++ b/third_party/rust/diplomat_core/src/ast/mod.rs @@ -2,7 +2,8 @@ /// generates a simplified version of the Rust AST that captures special /// types such as opaque structs, [`Box`], and [`Result`] with utilities /// for handling such types. -pub(crate) mod attrs; +pub mod attrs; +pub use attrs::Attrs; mod methods; pub use methods::{BorrowedParams, Method, Param, SelfParam}; diff --git a/third_party/rust/diplomat_core/src/ast/modules.rs b/third_party/rust/diplomat_core/src/ast/modules.rs index 5c1a266aefce..db4ccf37b882 100644 --- a/third_party/rust/diplomat_core/src/ast/modules.rs +++ b/third_party/rust/diplomat_core/src/ast/modules.rs @@ -2,11 +2,11 @@ use std::collections::{BTreeMap, HashSet}; use std::fmt::Write as _; use quote::ToTokens; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use syn::{ImplItem, Item, ItemMod, UseTree, Visibility}; use super::{ - attrs, CustomType, Enum, Ident, Method, ModSymbol, Mutability, OpaqueStruct, Path, PathType, + Attrs, CustomType, Enum, Ident, Method, ModSymbol, Mutability, OpaqueStruct, Path, PathType, RustLink, Struct, ValidityError, }; use crate::environment::*; @@ -59,7 +59,8 @@ impl DiplomatStructAttribute { } } -#[derive(Clone, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Debug)] +#[non_exhaustive] pub struct Module { pub name: Ident, pub imports: Vec<(Path, Ident)>, @@ -176,7 +177,7 @@ impl Module { syn::Type::Path(s) => PathType::from(s), _ => panic!("Self type not found"), }; - let cfg_attrs: Vec<_> = attrs::extract_cfg_attrs(&imp.attrs).collect(); + let attrs = Attrs::from(&*imp.attrs); let mut new_methods = imp .items @@ -186,7 +187,7 @@ impl Module { _ => None, }) .filter(|m| matches!(m.vis, Visibility::Public(_))) - .map(|m| Method::from_syn(m, self_path.clone(), Some(&imp.generics), &cfg_attrs)) + .map(|m| Method::from_syn(m, self_path.clone(), Some(&imp.generics), &attrs)) .collect(); let self_ident = self_path.path.elements.last().unwrap(); @@ -242,7 +243,8 @@ fn extract_imports(base_path: &Path, use_tree: &UseTree, out: &mut Vec<(Path, Id } } -#[derive(Serialize, Deserialize, Clone, Debug)] +#[derive(Serialize, Clone, Debug)] +#[non_exhaustive] pub struct File { pub modules: BTreeMap, } diff --git a/third_party/rust/diplomat_core/src/ast/paths.rs b/third_party/rust/diplomat_core/src/ast/paths.rs index fd2e07fce228..8bd9129081c4 100644 --- a/third_party/rust/diplomat_core/src/ast/paths.rs +++ b/third_party/rust/diplomat_core/src/ast/paths.rs @@ -4,6 +4,7 @@ use std::fmt; use super::Ident; #[derive(Hash, Eq, PartialEq, Deserialize, Serialize, Clone, Debug, Ord, PartialOrd)] +#[non_exhaustive] pub struct Path { pub elements: Vec, } diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__attr.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__attr.snap new file mode 100644 index 000000000000..d105a73ed5ee --- /dev/null +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__attr.snap @@ -0,0 +1,12 @@ +--- +source: core/src/ast/attrs.rs +expression: attr +--- +cfg: + Any: + - BackendName: cpp + - NameValue: + - has + - overloading +meta: namespacing + diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-2.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-2.snap new file mode 100644 index 000000000000..cc58dea4c164 --- /dev/null +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-2.snap @@ -0,0 +1,6 @@ +--- +source: core/src/ast/attrs.rs +expression: attr_cfg +--- +BackendName: cpp + diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-3.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-3.snap new file mode 100644 index 000000000000..635fcc978266 --- /dev/null +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-3.snap @@ -0,0 +1,8 @@ +--- +source: core/src/ast/attrs.rs +expression: attr_cfg +--- +NameValue: + - has + - overloading + diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-4.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-4.snap new file mode 100644 index 000000000000..635fcc978266 --- /dev/null +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-4.snap @@ -0,0 +1,8 @@ +--- +source: core/src/ast/attrs.rs +expression: attr_cfg +--- +NameValue: + - has + - overloading + diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-5.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-5.snap new file mode 100644 index 000000000000..5f7daa1da8f5 --- /dev/null +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs-5.snap @@ -0,0 +1,14 @@ +--- +source: core/src/ast/attrs.rs +expression: attr_cfg +--- +Any: + - All: + - Star + - BackendName: cpp + - NameValue: + - has + - overloading + - Not: + BackendName: js + diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs.snap new file mode 100644 index 000000000000..658b25dba391 --- /dev/null +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__attrs__tests__cfgs.snap @@ -0,0 +1,6 @@ +--- +source: core/src/ast/attrs.rs +expression: attr_cfg +--- +Star + diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__enum_with_discr.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__enum_with_discr.snap index 278f28303955..18b94c4fbb62 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__enum_with_discr.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__enum_with_discr.snap @@ -16,18 +16,23 @@ variants: - -1 - - "" - [] + - cfg: [] - - Def - 0 - - "" - [] + - cfg: [] - - Ghi - 1 - - "" - [] + - cfg: [] - - Jkl - 2 - - "" - [] + - cfg: [] methods: [] -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__simple_enum.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__simple_enum.snap index 76a0fa674df3..4a551dc56200 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__simple_enum.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__enums__tests__simple_enum.snap @@ -16,10 +16,13 @@ variants: - 0 - - "" - [] + - cfg: [] - - Def - 1 - - Some more docs. - [] + - cfg: [] methods: [] -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__cfged_method.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__cfged_method.snap index a4c80c413203..a57895b583e3 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__cfged_method.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__cfged_method.snap @@ -1,6 +1,6 @@ --- source: core/src/ast/methods.rs -expression: "Method::from_syn(&syn::parse_quote! {\n /// Some docs.\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInStruct)]\n #[cfg(any(feature = \"foo\", not(feature = \"bar\")))] fn\n foo(x : u64, y : MyCustomStruct) {}\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &[])" +expression: "Method::from_syn(&syn::parse_quote! {\n /// Some docs.\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInStruct)]\n #[cfg(any(feature = \"foo\", not(feature = \"bar\")))] fn\n foo(x : u64, y : MyCustomStruct) {}\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &Attrs::default())" --- name: foo docs: @@ -27,6 +27,7 @@ params: lifetimes: [] return_type: ~ lifetime_env: {} -cfg_attrs: - - "# [cfg (any (feature = \"foo\" , not (feature = \"bar\")))]" +attrs: + cfg: + - "# [cfg (any (feature = \"foo\" , not (feature = \"bar\")))]" diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods-2.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods-2.snap index d807dbe22828..0f39f8d84866 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods-2.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods-2.snap @@ -1,6 +1,6 @@ --- source: core/src/ast/methods.rs -expression: "Method::from_syn(&syn::parse_quote! {\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInStruct)] fn\n foo(& mut self, x : u64, y : MyCustomStruct) -> u64 { x }\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &[])" +expression: "Method::from_syn(&syn::parse_quote! {\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInStruct)] fn\n foo(& mut self, x : u64, y : MyCustomStruct) -> u64 { x }\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &Attrs::default())" --- name: foo docs: @@ -36,5 +36,6 @@ params: return_type: Primitive: u64 lifetime_env: {} -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods.snap index e0fd9a1711da..7c2f4058136f 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__nonstatic_methods.snap @@ -1,6 +1,6 @@ --- source: core/src/ast/methods.rs -expression: "Method::from_syn(&syn::parse_quote! {\n fn foo(& self, x : u64, y : MyCustomStruct) {}\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &[])" +expression: "Method::from_syn(&syn::parse_quote! {\n fn foo(& self, x : u64, y : MyCustomStruct) {}\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &Attrs::default())" --- name: foo docs: @@ -29,5 +29,6 @@ params: lifetimes: [] return_type: ~ lifetime_env: {} -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods-2.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods-2.snap index 8a76fe97db28..c20bd6a0d496 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods-2.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods-2.snap @@ -1,6 +1,6 @@ --- source: core/src/ast/methods.rs -expression: "Method::from_syn(&syn::parse_quote! {\n /// Some docs.\n /// Some more docs.\n ///\n /// Even more docs.\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInEnum)] fn\n foo(x : u64, y : MyCustomStruct) -> u64 { x }\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &[])" +expression: "Method::from_syn(&syn::parse_quote! {\n /// Some docs.\n /// Some more docs.\n ///\n /// Even more docs.\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInEnum)] fn\n foo(x : u64, y : MyCustomStruct) -> u64 { x }\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &Attrs::default())" --- name: foo docs: @@ -28,5 +28,6 @@ params: return_type: Primitive: u64 lifetime_env: {} -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods.snap index 08086b20b27f..3891350577b0 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__methods__tests__static_methods.snap @@ -1,6 +1,6 @@ --- source: core/src/ast/methods.rs -expression: "Method::from_syn(&syn::parse_quote! {\n /// Some docs.\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInStruct)] fn\n foo(x : u64, y : MyCustomStruct) {}\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &[])" +expression: "Method::from_syn(&syn::parse_quote! {\n /// Some docs.\n #[diplomat :: rust_link(foo :: Bar :: batz, FnInStruct)] fn\n foo(x : u64, y : MyCustomStruct) {}\n },\n PathType::new(Path::empty().sub_path(Ident::from(\"MyStructContainingMethod\"))),\n None, &Attrs::default())" --- name: foo docs: @@ -27,5 +27,6 @@ params: lifetimes: [] return_type: ~ lifetime_env: {} -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__import_in_non_diplomat_not_analyzed.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__import_in_non_diplomat_not_analyzed.snap index 67c1d665ccb0..3e38f88a8b89 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__import_in_non_diplomat_not_analyzed.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__import_in_non_diplomat_not_analyzed.snap @@ -17,7 +17,8 @@ modules: fields: [] methods: [] output_only: false - cfg_attrs: [] + attrs: + cfg: [] sub_modules: [] other: name: other diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__method_visibility.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__method_visibility.snap index ee09aa6b788c..179444b3512e 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__method_visibility.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__method_visibility.snap @@ -23,8 +23,10 @@ declared_types: params: [] return_type: ~ lifetime_env: {} - cfg_attrs: [] + attrs: + cfg: [] output_only: false - cfg_attrs: [] + attrs: + cfg: [] sub_modules: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__simple_mod.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__simple_mod.snap index 611d3efbccea..9e853a747366 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__simple_mod.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__modules__tests__simple_mod.snap @@ -44,7 +44,8 @@ declared_types: - NonOpaqueStruct lifetimes: [] lifetime_env: {} - cfg_attrs: [] + attrs: + cfg: [] - name: set_a docs: - "" @@ -65,9 +66,11 @@ declared_types: Primitive: i32 return_type: ~ lifetime_env: {} - cfg_attrs: [] + attrs: + cfg: [] output_only: false - cfg_attrs: [] + attrs: + cfg: [] OpaqueStruct: Opaque: name: OpaqueStruct @@ -91,7 +94,8 @@ declared_types: - OpaqueStruct lifetimes: [] lifetime_env: {} - cfg_attrs: [] + attrs: + cfg: [] - name: get_string docs: - "" @@ -114,8 +118,10 @@ declared_types: - String lifetimes: [] lifetime_env: {} - cfg_attrs: [] + attrs: + cfg: [] mutability: Immutable - cfg_attrs: [] + attrs: + cfg: [] sub_modules: [] diff --git a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__structs__tests__simple_struct.snap b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__structs__tests__simple_struct.snap index 0de9adef93d0..e99b309c1657 100644 --- a/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__structs__tests__simple_struct.snap +++ b/third_party/rust/diplomat_core/src/ast/snapshots/diplomat_core__ast__structs__tests__simple_struct.snap @@ -28,5 +28,6 @@ fields: - [] methods: [] output_only: true -cfg_attrs: [] +attrs: + cfg: [] diff --git a/third_party/rust/diplomat_core/src/ast/structs.rs b/third_party/rust/diplomat_core/src/ast/structs.rs index e79613820019..2fb1db4838c0 100644 --- a/third_party/rust/diplomat_core/src/ast/structs.rs +++ b/third_party/rust/diplomat_core/src/ast/structs.rs @@ -1,10 +1,11 @@ -use serde::{Deserialize, Serialize}; +use serde::Serialize; use super::docs::Docs; -use super::{attrs, Ident, LifetimeEnv, Method, Mutability, PathType, TypeName}; +use super::{Attrs, Ident, LifetimeEnv, Method, Mutability, PathType, TypeName}; /// A struct declaration in an FFI module that is not opaque. -#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[derive(Clone, PartialEq, Eq, Hash, Serialize, Debug)] +#[non_exhaustive] pub struct Struct { pub name: Ident, pub docs: Docs, @@ -12,7 +13,7 @@ pub struct Struct { pub fields: Vec<(Ident, TypeName, Docs)>, pub methods: Vec, pub output_only: bool, - pub cfg_attrs: Vec, + pub attrs: Attrs, } impl Struct { @@ -37,7 +38,6 @@ impl Struct { .collect(); let lifetimes = LifetimeEnv::from_struct_item(strct, &fields[..]); - let cfg_attrs = attrs::extract_cfg_attrs(&strct.attrs).collect(); Struct { name: (&strct.ident).into(), @@ -46,7 +46,7 @@ impl Struct { fields, methods: vec![], output_only, - cfg_attrs, + attrs: (&*strct.attrs).into(), } } } @@ -54,27 +54,27 @@ impl Struct { /// A struct annotated with [`diplomat::opaque`] whose fields are not visible. /// Opaque structs cannot be passed by-value across the FFI boundary, so they /// must be boxed or passed as references. -#[derive(Clone, Serialize, Deserialize, Debug, Hash, PartialEq, Eq)] +#[derive(Clone, Serialize, Debug, Hash, PartialEq, Eq)] +#[non_exhaustive] pub struct OpaqueStruct { pub name: Ident, pub docs: Docs, pub lifetimes: LifetimeEnv, pub methods: Vec, pub mutability: Mutability, - pub cfg_attrs: Vec, + pub attrs: Attrs, } impl OpaqueStruct { /// Extract a [`OpaqueStruct`] metadata value from an AST node. pub fn new(strct: &syn::ItemStruct, mutability: Mutability) -> Self { - let cfg_attrs = attrs::extract_cfg_attrs(&strct.attrs).collect(); OpaqueStruct { name: Ident::from(&strct.ident), docs: Docs::from_attrs(&strct.attrs), lifetimes: LifetimeEnv::from_struct_item(strct, &[]), methods: vec![], mutability, - cfg_attrs, + attrs: (&*strct.attrs).into(), } } } diff --git a/third_party/rust/diplomat_core/src/ast/types.rs b/third_party/rust/diplomat_core/src/ast/types.rs index 178fa2699921..689d639cbd28 100644 --- a/third_party/rust/diplomat_core/src/ast/types.rs +++ b/third_party/rust/diplomat_core/src/ast/types.rs @@ -9,13 +9,14 @@ use std::fmt; use std::ops::ControlFlow; use super::{ - Docs, Enum, Ident, Lifetime, LifetimeEnv, LifetimeTransitivity, Method, NamedLifetime, + Attrs, Docs, Enum, Ident, Lifetime, LifetimeEnv, LifetimeTransitivity, Method, NamedLifetime, OpaqueStruct, Path, RustLink, Struct, ValidityError, }; use crate::Env; /// A type declared inside a Diplomat-annotated module. -#[derive(Clone, Serialize, Deserialize, Debug, Hash, PartialEq, Eq)] +#[derive(Clone, Serialize, Debug, Hash, PartialEq, Eq)] +#[non_exhaustive] pub enum CustomType { /// A non-opaque struct whose fields will be visible across the FFI boundary. Struct(Struct), @@ -44,11 +45,11 @@ impl CustomType { } } - pub fn cfg_attrs(&self) -> &[String] { + pub fn attrs(&self) -> &Attrs { match self { - CustomType::Struct(strct) => &strct.cfg_attrs, - CustomType::Opaque(strct) => &strct.cfg_attrs, - CustomType::Enum(enm) => &enm.cfg_attrs, + CustomType::Struct(strct) => &strct.attrs, + CustomType::Opaque(strct) => &strct.attrs, + CustomType::Enum(enm) => &enm.attrs, } } @@ -126,7 +127,8 @@ impl CustomType { /// A symbol declared in a module, which can either be a pointer to another path, /// or a custom type defined directly inside that module -#[derive(Clone, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Debug)] +#[non_exhaustive] pub enum ModSymbol { /// A symbol that is a pointer to another path. Alias(Path), @@ -138,6 +140,7 @@ pub enum ModSymbol { /// A named type that is just a path, e.g. `std::borrow::Cow<'a, T>`. #[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[non_exhaustive] pub struct PathType { pub path: Path, pub lifetimes: Vec, @@ -299,6 +302,7 @@ impl From for PathType { } #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[allow(clippy::exhaustive_enums)] // there are only two kinds of mutability we care about pub enum Mutability { Mutable, Immutable, @@ -361,6 +365,7 @@ impl Mutability { /// Unlike [`CustomType`], which represents a type declaration, [`TypeName`]s can compose /// types through references and boxing, and can also capture unresolved paths. #[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] +#[non_exhaustive] pub enum TypeName { /// A built-in Rust scalar primitive. Primitive(PrimitiveType), @@ -882,6 +887,7 @@ impl TypeName { } } +#[non_exhaustive] pub enum LifetimeOrigin { Named, Reference, @@ -973,6 +979,7 @@ impl fmt::Display for PathType { /// A built-in Rust primitive scalar type. #[derive(Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Debug)] #[allow(non_camel_case_types)] +#[allow(clippy::exhaustive_enums)] // there are only these (scalar types) pub enum PrimitiveType { i8, u8, diff --git a/third_party/rust/diplomat_core/src/ast/validity.rs b/third_party/rust/diplomat_core/src/ast/validity.rs index c1f37bfa677a..e8c68e2251b3 100644 --- a/third_party/rust/diplomat_core/src/ast/validity.rs +++ b/third_party/rust/diplomat_core/src/ast/validity.rs @@ -2,6 +2,7 @@ use super::{Ident, Path, TypeName}; #[cfg_attr(feature = "displaydoc", derive(displaydoc::Display))] #[derive(Debug, Clone)] +#[non_exhaustive] pub enum ValidityError { /// An oqaue type crosses the FFI boundary as a value. #[cfg_attr( diff --git a/third_party/rust/diplomat_core/src/hir/attrs.rs b/third_party/rust/diplomat_core/src/hir/attrs.rs new file mode 100644 index 000000000000..6a55f52e2793 --- /dev/null +++ b/third_party/rust/diplomat_core/src/hir/attrs.rs @@ -0,0 +1,194 @@ +//! #[diplomat::attr] and other attributes + +use crate::ast; +use crate::ast::attrs::DiplomatBackendAttrCfg; +use crate::hir::LoweringError; + +use quote::ToTokens; +use syn::{LitStr, Meta}; + +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct Attrs { + pub disable: bool, + pub rename: Option, + // more to be added: rename, namespace, etc +} + +/// Where the attribute was found. Some attributes are only allowed in some contexts +/// (e.g. namespaces cannot be specified on methods) +#[non_exhaustive] // might add module attrs in the future +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum AttributeContext { + Struct { out: bool }, + Enum, + EnumVariant, + Opaque, + Method, +} + +impl Attrs { + pub fn from_ast( + ast: &ast::Attrs, + validator: &(impl AttributeValidator + ?Sized), + context: AttributeContext, + errors: &mut Vec, + ) -> Self { + let mut this = Attrs::default(); + let support = validator.attrs_supported(); + for attr in &ast.attrs { + if validator.satisfies_cfg(&attr.cfg) { + match &attr.meta { + Meta::Path(p) => { + if p.is_ident("disable") { + if this.disable { + errors.push(LoweringError::Other( + "Duplicate `disable` attribute".into(), + )); + } else if !support.disabling { + errors.push(LoweringError::Other(format!( + "`disable` not supported in backend {}", + validator.primary_name() + ))) + } else if context == AttributeContext::EnumVariant { + errors.push(LoweringError::Other( + "`disable` cannot be used on enum variants".into(), + )) + } else { + this.disable = true; + } + } else { + errors.push(LoweringError::Other(format!( + "Unknown diplomat attribute {p:?}: expected one of: `disable, rename`" + ))); + } + } + Meta::NameValue(nv) => { + let p = &nv.path; + if p.is_ident("rename") { + if this.rename.is_some() { + errors.push(LoweringError::Other( + "Duplicate `rename` attribute".into(), + )); + } else if !support.renaming { + errors.push(LoweringError::Other(format!( + "`rename` not supported in backend {}", + validator.primary_name() + ))) + } else { + let v = nv.value.to_token_stream(); + let l = syn::parse2::(v); + if let Ok(ref l) = l { + this.rename = Some(l.value()) + } else { + errors.push(LoweringError::Other(format!( + "Found diplomat attribute {p:?}: expected string as `rename` argument" + ))); + } + } + } else { + errors.push(LoweringError::Other(format!( + "Unknown diplomat attribute {p:?}: expected one of: `disable, rename`" + ))); + } + } + other => { + errors.push(LoweringError::Other(format!( + "Unknown diplomat attribute {other:?}: expected one of: `disable, rename`" + ))); + } + } + } + } + + this + } +} + +#[non_exhaustive] +#[derive(Copy, Clone, Debug, Default)] +pub struct BackendAttrSupport { + pub disabling: bool, + pub renaming: bool, + // more to be added: rename, namespace, etc +} + +/// Defined by backends when validating attributes +pub trait AttributeValidator { + /// The primary name of the backend, for use in diagnostics + fn primary_name(&self) -> &str; + /// Does this backend satisfy `cfg(backend_name)`? + /// (Backends are allowed to satisfy multiple backend names, useful when there + /// are multiple backends for a language) + fn is_backend(&self, backend_name: &str) -> bool; + /// does this backend satisfy cfg(name = value)? + fn is_name_value(&self, name: &str, value: &str) -> bool; + /// What backedn attrs does this support? + fn attrs_supported(&self) -> BackendAttrSupport; + + /// Provided, checks if type satisfies a `DiplomatBackendAttrCfg` + fn satisfies_cfg(&self, cfg: &DiplomatBackendAttrCfg) -> bool { + match *cfg { + DiplomatBackendAttrCfg::Not(ref c) => !self.satisfies_cfg(c), + DiplomatBackendAttrCfg::Any(ref cs) => cs.iter().any(|c| self.satisfies_cfg(c)), + DiplomatBackendAttrCfg::All(ref cs) => cs.iter().all(|c| self.satisfies_cfg(c)), + DiplomatBackendAttrCfg::Star => true, + DiplomatBackendAttrCfg::BackendName(ref n) => self.is_backend(n), + DiplomatBackendAttrCfg::NameValue(ref n, ref v) => self.is_name_value(n, v), + } + } + + // Provided, constructs an attribute + fn attr_from_ast( + &self, + ast: &ast::Attrs, + context: AttributeContext, + errors: &mut Vec, + ) -> Attrs { + Attrs::from_ast(ast, self, context, errors) + } +} + +/// A basic attribute validator +#[non_exhaustive] +#[derive(Default)] +pub struct BasicAttributeValidator { + /// The primary name of this backend (should be unique, ideally) + pub backend_name: String, + /// The attributes supported + pub support: BackendAttrSupport, + /// Additional names for this backend + pub other_backend_names: Vec, + /// override is_name_value() + #[allow(clippy::type_complexity)] // dyn fn is not that complex + pub is_name_value: Option bool>>, +} + +impl BasicAttributeValidator { + pub fn new(backend_name: &str) -> Self { + BasicAttributeValidator { + backend_name: backend_name.into(), + ..Self::default() + } + } +} + +impl AttributeValidator for BasicAttributeValidator { + fn primary_name(&self) -> &str { + &self.backend_name + } + fn is_backend(&self, backend_name: &str) -> bool { + self.backend_name == backend_name + || self.other_backend_names.iter().any(|n| n == backend_name) + } + fn is_name_value(&self, name: &str, value: &str) -> bool { + if let Some(ref nv) = self.is_name_value { + nv(name, value) + } else { + false + } + } + fn attrs_supported(&self) -> BackendAttrSupport { + self.support + } +} diff --git a/third_party/rust/diplomat_core/src/hir/defs.rs b/third_party/rust/diplomat_core/src/hir/defs.rs index 175640bb4b48..6622acba013d 100644 --- a/third_party/rust/diplomat_core/src/hir/defs.rs +++ b/third_party/rust/diplomat_core/src/hir/defs.rs @@ -1,14 +1,16 @@ //! Type definitions for structs, output structs, opaque structs, and enums. -use super::{Everywhere, IdentBuf, Method, OutputOnly, TyPosition, Type}; +use super::{Attrs, Everywhere, IdentBuf, Method, OutputOnly, TyPosition, Type}; use crate::ast::Docs; +#[non_exhaustive] pub enum ReturnableStructDef<'tcx> { Struct(&'tcx StructDef), OutStruct(&'tcx OutStructDef), } #[derive(Copy, Clone, Debug)] +#[non_exhaustive] pub enum TypeDef<'tcx> { Struct(&'tcx StructDef), OutStruct(&'tcx OutStructDef), @@ -21,11 +23,13 @@ pub type OutStructDef = StructDef; /// Structs that can be either inputs or outputs in methods. #[derive(Debug)] +#[non_exhaustive] pub struct StructDef { pub docs: Docs, pub name: IdentBuf, pub fields: Vec>, pub methods: Vec, + pub attrs: Attrs, } /// A struct whose contents are opaque across the FFI boundary, and can only @@ -37,19 +41,23 @@ pub struct StructDef { /// /// A struct marked with `#[diplomat::opaque]`. #[derive(Debug)] +#[non_exhaustive] pub struct OpaqueDef { pub docs: Docs, pub name: IdentBuf, pub methods: Vec, + pub attrs: Attrs, } /// The enum type. #[derive(Debug)] +#[non_exhaustive] pub struct EnumDef { pub docs: Docs, pub name: IdentBuf, pub variants: Vec, pub methods: Vec, + pub attrs: Attrs, } /// A field on a [`OutStruct`]s. @@ -57,6 +65,7 @@ pub type OutStructField = StructField; /// A field on a [`Struct`]s. #[derive(Debug)] +#[non_exhaustive] pub struct StructField { pub docs: Docs, pub name: IdentBuf, @@ -65,10 +74,12 @@ pub struct StructField { /// A variant of an [`Enum`]. #[derive(Debug)] +#[non_exhaustive] pub struct EnumVariant { pub docs: Docs, pub name: IdentBuf, pub discriminant: isize, + pub attrs: Attrs, } impl StructDef

{ @@ -77,22 +88,25 @@ impl StructDef

{ name: IdentBuf, fields: Vec>, methods: Vec, + attrs: Attrs, ) -> Self { Self { docs, name, fields, methods, + attrs, } } } impl OpaqueDef { - pub(super) fn new(docs: Docs, name: IdentBuf, methods: Vec) -> Self { + pub(super) fn new(docs: Docs, name: IdentBuf, methods: Vec, attrs: Attrs) -> Self { Self { docs, name, methods, + attrs, } } } @@ -103,12 +117,14 @@ impl EnumDef { name: IdentBuf, variants: Vec, methods: Vec, + attrs: Attrs, ) -> Self { Self { docs, name, variants, methods, + attrs, } } } @@ -163,4 +179,13 @@ impl<'tcx> TypeDef<'tcx> { Self::Enum(ty) => &ty.methods, } } + + pub fn attrs(&self) -> &'tcx Attrs { + match *self { + Self::Struct(ty) => &ty.attrs, + Self::OutStruct(ty) => &ty.attrs, + Self::Opaque(ty) => &ty.attrs, + Self::Enum(ty) => &ty.attrs, + } + } } diff --git a/third_party/rust/diplomat_core/src/hir/elision.rs b/third_party/rust/diplomat_core/src/hir/elision.rs index 18debd557bd5..1e1a239ca1e3 100644 --- a/third_party/rust/diplomat_core/src/hir/elision.rs +++ b/third_party/rust/diplomat_core/src/hir/elision.rs @@ -97,7 +97,7 @@ //! [Nomicon]: https://doc.rust-lang.org/nomicon/lifetime-elision.html use super::{ - lower_ident, Lifetime, LifetimeEnv, LoweringError, MaybeStatic, MethodLifetime, TypeLifetime, + Lifetime, LifetimeEnv, LoweringContext, MaybeStatic, MethodLifetime, TypeLifetime, TypeLifetimes, }; use crate::ast; @@ -181,7 +181,7 @@ pub(super) struct BaseLifetimeLowerer<'ast> { /// is lowered into its HIR representation, if present. According to elision /// rules, this reference has the highest precedence as the lifetime that /// goes into elision in the output, and so it's checked first. -pub struct SelfParamLifetimeLowerer<'ast> { +pub(super) struct SelfParamLifetimeLowerer<'ast> { base: BaseLifetimeLowerer<'ast>, } @@ -192,7 +192,7 @@ pub struct SelfParamLifetimeLowerer<'ast> { /// didn't claim the potential output elided lifetime, then if there's a /// single lifetime (elided or not) in the inputs, it will claim the /// potential output elided lifetime. -pub struct ParamLifetimeLowerer<'ast> { +pub(super) struct ParamLifetimeLowerer<'ast> { elision_source: ElisionSource, base: BaseLifetimeLowerer<'ast>, } @@ -205,7 +205,7 @@ pub struct ParamLifetimeLowerer<'ast> { /// that lifetime. If none did and there is elision in the output, then /// rustc should have errored and said the elision was ambiguous, meaning /// that state should be impossible so it panics. -pub struct ReturnLifetimeLowerer<'ast> { +pub(super) struct ReturnLifetimeLowerer<'ast> { elision_source: ElisionSource, base: BaseLifetimeLowerer<'ast>, } @@ -246,14 +246,11 @@ impl<'ast> BaseLifetimeLowerer<'ast> { impl<'ast> SelfParamLifetimeLowerer<'ast> { /// Returns a new [`SelfParamLifetimeLowerer`]. - pub fn new( - lifetime_env: &'ast ast::LifetimeEnv, - errors: &mut Vec, - ) -> Option { + pub fn new(lifetime_env: &'ast ast::LifetimeEnv, ctx: &mut LoweringContext) -> Option { let mut hir_nodes = Some(SmallVec::new()); for ast_node in lifetime_env.nodes.iter() { - let lifetime = lower_ident(ast_node.lifetime.name(), "named lifetime", errors); + let lifetime = ctx.lower_ident(ast_node.lifetime.name(), "named lifetime"); match (lifetime, &mut hir_nodes) { (Some(lifetime), Some(hir_nodes)) => { hir_nodes.push(Lifetime::new( @@ -420,7 +417,7 @@ mod tests { env.insert(crate::ast::Path::empty(), top_symbols); - let tcx = crate::hir::TypeContext::from_ast(&env).unwrap(); + let tcx = crate::hir::TypeContext::from_ast(&env, crate::hir::BasicAttributeValidator::new("test-backend")).unwrap(); tcx }} diff --git a/third_party/rust/diplomat_core/src/hir/lifetimes.rs b/third_party/rust/diplomat_core/src/hir/lifetimes.rs index 914b414ef444..d360ad17ca21 100644 --- a/third_party/rust/diplomat_core/src/hir/lifetimes.rs +++ b/third_party/rust/diplomat_core/src/hir/lifetimes.rs @@ -96,6 +96,7 @@ where /// Wrapper type for `TypeLifetime` and `MethodLifetime`, indicating that it may /// be the `'static` lifetime. #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] +#[allow(clippy::exhaustive_enums)] // this will only ever have two variants pub enum MaybeStatic { Static, NonStatic(T), diff --git a/third_party/rust/diplomat_core/src/hir/lowering.rs b/third_party/rust/diplomat_core/src/hir/lowering.rs index 882cf78a5418..7dc35af7fba8 100644 --- a/third_party/rust/diplomat_core/src/hir/lowering.rs +++ b/third_party/rust/diplomat_core/src/hir/lowering.rs @@ -1,9 +1,10 @@ use super::{ - Borrow, EnumDef, EnumPath, EnumVariant, IdentBuf, LifetimeEnv, LifetimeLowerer, LookupId, - MaybeOwn, Method, NonOptional, OpaqueDef, OpaquePath, Optional, OutStructDef, OutStructField, - OutStructPath, OutType, Param, ParamLifetimeLowerer, ParamSelf, PrimitiveType, - ReturnLifetimeLowerer, ReturnType, ReturnableStructPath, SelfParamLifetimeLowerer, SelfType, - Slice, StructDef, StructField, StructPath, SuccessType, Type, + AttributeContext, AttributeValidator, Borrow, EnumDef, EnumPath, EnumVariant, IdentBuf, + LifetimeEnv, LifetimeLowerer, LookupId, MaybeOwn, Method, NonOptional, OpaqueDef, OpaquePath, + Optional, OutStructDef, OutStructField, OutStructPath, OutType, Param, ParamLifetimeLowerer, + ParamSelf, PrimitiveType, ReturnLifetimeLowerer, ReturnType, ReturnableStructPath, + SelfParamLifetimeLowerer, SelfType, Slice, StructDef, StructField, StructPath, SuccessType, + Type, }; use crate::{ast, Env}; use core::fmt; @@ -11,6 +12,7 @@ use strck_ident::IntoCk; /// An error from lowering the AST to the HIR. #[derive(Debug)] +#[non_exhaustive] pub enum LoweringError { /// The purpose of having this is that translating to the HIR has enormous /// potential for really detailed error handling and giving suggestions. @@ -31,52 +33,43 @@ impl fmt::Display for LoweringError { } } -/// Lowers an [`ast::Ident`]s into an [`hir::IdentBuf`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -pub fn lower_ident( - ident: &ast::Ident, - context: &'static str, - errors: &mut Vec, -) -> Option { - match ident.as_str().ck() { - Ok(name) => Some(name.to_owned()), - Err(e) => { - errors.push(LoweringError::Other(format!( - "Ident `{ident}` from {context} could not be turned into a Rust ident: {e}" - ))); - None - } - } +pub(super) struct LoweringContext<'ast, 'errors> { + pub lookup_id: &'ast LookupId<'ast>, + pub errors: &'errors mut Vec, + pub env: &'ast Env, + pub attr_validator: Box, } -/// Lowers an AST definition. -pub(super) trait TypeLowerer: Sized { - /// Type of the AST definition that gets lowered. - type AstDef; - - /// Lowers the AST definition into `Self`. +impl<'ast, 'errors> LoweringContext<'ast, 'errors> { + /// Lowers an [`ast::Ident`]s into an [`hir::IdentBuf`]. /// /// If there are any errors, they're pushed to `errors` and `None` is returned. - fn lower( - ast_def: &Self::AstDef, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, - ) -> Option; + pub(super) fn lower_ident( + &mut self, + ident: &ast::Ident, + context: &'static str, + ) -> Option { + match ident.as_str().ck() { + Ok(name) => Some(name.to_owned()), + Err(e) => { + self.errors.push(LoweringError::Other(format!( + "Ident `{ident}` from {context} could not be turned into a Rust ident: {e}" + ))); + None + } + } + } /// Lowers multiple items at once - fn lower_all( - ast_defs: &[(&ast::Path, &Self::AstDef)], - lookup_id: &LookupId, - env: &Env, - errors: &mut Vec, - ) -> Option> { + fn lower_all( + &mut self, + ast_defs: &[(&ast::Path, &'ast Ast)], + lower: impl Fn(&mut Self, &'ast Ast, &ast::Path) -> Option, + ) -> Option> { let mut hir_types = Some(Vec::with_capacity(ast_defs.len())); for (in_path, ast_def) in ast_defs { - let hir_type = Self::lower(ast_def, lookup_id, in_path, env, errors); + let hir_type = lower(self, ast_def, in_path); match (hir_type, &mut hir_types) { (Some(hir_type), Some(hir_types)) => hir_types.push(hir_type), @@ -86,80 +79,101 @@ pub(super) trait TypeLowerer: Sized { hir_types } -} -impl TypeLowerer for EnumDef { - type AstDef = ast::Enum; + pub(super) fn lower_all_enums( + &mut self, + ast_defs: &[(&ast::Path, &'ast ast::Enum)], + ) -> Option> { + self.lower_all(ast_defs, Self::lower_enum) + } + pub(super) fn lower_all_structs( + &mut self, + ast_defs: &[(&ast::Path, &'ast ast::Struct)], + ) -> Option> { + self.lower_all(ast_defs, Self::lower_struct) + } + pub(super) fn lower_all_out_structs( + &mut self, + ast_defs: &[(&ast::Path, &'ast ast::Struct)], + ) -> Option> { + self.lower_all(ast_defs, Self::lower_out_struct) + } + pub(super) fn lower_all_opaques( + &mut self, + ast_defs: &[(&ast::Path, &'ast ast::OpaqueStruct)], + ) -> Option> { + self.lower_all(ast_defs, Self::lower_opaque) + } - fn lower( - ast_enum: &Self::AstDef, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, - ) -> Option { - let name = lower_ident(&ast_enum.name, "enum name", errors); + fn lower_enum(&mut self, ast_enum: &'ast ast::Enum, in_path: &ast::Path) -> Option { + let name = self.lower_ident(&ast_enum.name, "enum name"); let mut variants = Some(Vec::with_capacity(ast_enum.variants.len())); - for (ident, discriminant, docs) in ast_enum.variants.iter() { - let name = lower_ident(ident, "enum variant", errors); - + for (ident, discriminant, docs, attrs) in ast_enum.variants.iter() { + let name = self.lower_ident(ident, "enum variant"); + let attrs = self.attr_validator.attr_from_ast( + attrs, + AttributeContext::EnumVariant, + self.errors, + ); match (name, &mut variants) { (Some(name), Some(variants)) => { variants.push(EnumVariant { docs: docs.clone(), name, discriminant: *discriminant, + attrs, }); } _ => variants = None, } } - let methods = lower_all_methods(&ast_enum.methods[..], lookup_id, in_path, env, errors); + let methods = self.lower_all_methods(&ast_enum.methods[..], in_path); + let attrs = + self.attr_validator + .attr_from_ast(&ast_enum.attrs, AttributeContext::Enum, self.errors); Some(EnumDef::new( ast_enum.docs.clone(), name?, variants?, methods?, + attrs, )) } -} -impl TypeLowerer for OpaqueDef { - type AstDef = ast::OpaqueStruct; - - fn lower( - ast_opaque: &Self::AstDef, - lookup_id: &LookupId, + fn lower_opaque( + &mut self, + ast_opaque: &'ast ast::OpaqueStruct, in_path: &ast::Path, - env: &Env, - errors: &mut Vec, - ) -> Option { - let name = lower_ident(&ast_opaque.name, "opaque name", errors); + ) -> Option { + let name = self.lower_ident(&ast_opaque.name, "opaque name"); - let methods = lower_all_methods(&ast_opaque.methods[..], lookup_id, in_path, env, errors); - - Some(OpaqueDef::new(ast_opaque.docs.clone(), name?, methods?)) + let methods = self.lower_all_methods(&ast_opaque.methods[..], in_path); + let attrs = self.attr_validator.attr_from_ast( + &ast_opaque.attrs, + AttributeContext::Opaque, + self.errors, + ); + Some(OpaqueDef::new( + ast_opaque.docs.clone(), + name?, + methods?, + attrs, + )) } -} -impl TypeLowerer for StructDef { - type AstDef = ast::Struct; - - fn lower( - ast_struct: &Self::AstDef, - lookup_id: &LookupId, + fn lower_struct( + &mut self, + ast_struct: &'ast ast::Struct, in_path: &ast::Path, - env: &Env, - errors: &mut Vec, - ) -> Option { - let name = lower_ident(&ast_struct.name, "struct name", errors); + ) -> Option { + let name = self.lower_ident(&ast_struct.name, "struct name"); let fields = if ast_struct.fields.is_empty() { - errors.push(LoweringError::Other(format!( + self.errors.push(LoweringError::Other(format!( "struct `{}` is a ZST because it has no fields", ast_struct.name ))); @@ -168,15 +182,8 @@ impl TypeLowerer for StructDef { let mut fields = Some(Vec::with_capacity(ast_struct.fields.len())); for (name, ty, docs) in ast_struct.fields.iter() { - let name = lower_ident(name, "struct field name", errors); - let ty = lower_type( - ty, - Some(&mut &ast_struct.lifetimes), - lookup_id, - in_path, - env, - errors, - ); + let name = self.lower_ident(name, "struct field name"); + let ty = self.lower_type(ty, Some(&mut &ast_struct.lifetimes), in_path); match (name, ty, &mut fields) { (Some(name), Some(ty), Some(fields)) => fields.push(StructField { @@ -191,31 +198,30 @@ impl TypeLowerer for StructDef { fields }; - let methods = lower_all_methods(&ast_struct.methods[..], lookup_id, in_path, env, errors); - + let methods = self.lower_all_methods(&ast_struct.methods[..], in_path); + let attrs = self.attr_validator.attr_from_ast( + &ast_struct.attrs, + AttributeContext::Struct { out: false }, + self.errors, + ); Some(StructDef::new( ast_struct.docs.clone(), name?, fields?, methods?, + attrs, )) } -} -impl TypeLowerer for OutStructDef { - type AstDef = ast::Struct; - - fn lower( - ast_out_struct: &Self::AstDef, - lookup_id: &LookupId, + fn lower_out_struct( + &mut self, + ast_out_struct: &'ast ast::Struct, in_path: &ast::Path, - env: &Env, - errors: &mut Vec, - ) -> Option { - let name = lower_ident(&ast_out_struct.name, "out-struct name", errors); + ) -> Option { + let name = self.lower_ident(&ast_out_struct.name, "out-struct name"); let fields = if ast_out_struct.fields.is_empty() { - errors.push(LoweringError::Other(format!( + self.errors.push(LoweringError::Other(format!( "struct `{}` is a ZST because it has no fields", ast_out_struct.name ))); @@ -224,15 +230,8 @@ impl TypeLowerer for OutStructDef { let mut fields = Some(Vec::with_capacity(ast_out_struct.fields.len())); for (name, ty, docs) in ast_out_struct.fields.iter() { - let name = lower_ident(name, "out-struct field name", errors); - let ty = lower_out_type( - ty, - Some(&mut &ast_out_struct.lifetimes), - lookup_id, - in_path, - env, - errors, - ); + let name = self.lower_ident(name, "out-struct field name"); + let ty = self.lower_out_type(ty, Some(&mut &ast_out_struct.lifetimes), in_path); match (name, ty, &mut fields) { (Some(name), Some(ty), Some(fields)) => fields.push(OutStructField { @@ -247,191 +246,183 @@ impl TypeLowerer for OutStructDef { fields }; - let methods = - lower_all_methods(&ast_out_struct.methods[..], lookup_id, in_path, env, errors); - + let methods = self.lower_all_methods(&ast_out_struct.methods[..], in_path); + let attrs = self.attr_validator.attr_from_ast( + &ast_out_struct.attrs, + AttributeContext::Struct { out: true }, + self.errors, + ); Some(OutStructDef::new( ast_out_struct.docs.clone(), name?, fields?, methods?, + attrs, )) } -} -/// Lowers an [`ast::Method`]s an [`hir::Method`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -fn lower_method( - method: &ast::Method, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option { - let name = lower_ident(&method.name, "method name", errors); + /// Lowers an [`ast::Method`]s an [`hir::Method`]. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + fn lower_method(&mut self, method: &'ast ast::Method, in_path: &ast::Path) -> Option { + let name = self.lower_ident(&method.name, "method name"); - let (ast_params, takes_writeable) = match method.params.split_last() { - Some((last, remaining)) if last.is_writeable() => (remaining, true), - _ => (&method.params[..], false), - }; + let (ast_params, takes_writeable) = match method.params.split_last() { + Some((last, remaining)) if last.is_writeable() => (remaining, true), + _ => (&method.params[..], false), + }; - let self_param_ltl = SelfParamLifetimeLowerer::new(&method.lifetime_env, errors); + let self_param_ltl = SelfParamLifetimeLowerer::new(&method.lifetime_env, self); - let (param_self, param_ltl) = if let Some(self_param) = method.self_param.as_ref() { - lower_self_param( - self_param, - self_param_ltl, - lookup_id, - &method.full_path_name, - in_path, - env, - errors, - ) - .map(|(param_self, param_ltl)| (Some(Some(param_self)), Some(param_ltl))) - .unwrap_or((None, None)) - } else { - ( - Some(None), - self_param_ltl.map(SelfParamLifetimeLowerer::no_self_ref), - ) - }; + let (param_self, param_ltl) = if let Some(self_param) = method.self_param.as_ref() { + self.lower_self_param(self_param, self_param_ltl, &method.full_path_name, in_path) + .map(|(param_self, param_ltl)| (Some(Some(param_self)), Some(param_ltl))) + .unwrap_or((None, None)) + } else { + ( + Some(None), + self_param_ltl.map(SelfParamLifetimeLowerer::no_self_ref), + ) + }; - let (params, return_ltl) = - lower_many_params(ast_params, param_ltl, lookup_id, in_path, env, errors) + let (params, return_ltl) = self + .lower_many_params(ast_params, param_ltl, in_path) .map(|(params, return_ltl)| (Some(params), Some(return_ltl))) .unwrap_or((None, None)); - let (output, lifetime_env) = lower_return_type( - method.return_type.as_ref(), - takes_writeable, - return_ltl, - lookup_id, - in_path, - env, - errors, - )?; + let (output, lifetime_env) = self.lower_return_type( + method.return_type.as_ref(), + takes_writeable, + return_ltl, + in_path, + )?; - Some(Method { - docs: method.docs.clone(), - name: name?, - lifetime_env, - param_self: param_self?, - params: params?, - output, - }) -} - -/// Lowers many [`ast::Method`]s into a vector of [`hir::Method`]s. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -fn lower_all_methods( - ast_methods: &[ast::Method], - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option> { - let mut methods = Some(Vec::with_capacity(ast_methods.len())); - - for method in ast_methods { - let method = lower_method(method, lookup_id, in_path, env, errors); - match (method, &mut methods) { - (Some(method), Some(methods)) => { - methods.push(method); - } - _ => methods = None, - } + let attrs = + self.attr_validator + .attr_from_ast(&method.attrs, AttributeContext::Enum, self.errors); + Some(Method { + docs: method.docs.clone(), + name: name?, + lifetime_env, + param_self: param_self?, + params: params?, + output, + attrs, + }) } - methods -} + /// Lowers many [`ast::Method`]s into a vector of [`hir::Method`]s. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + fn lower_all_methods( + &mut self, + ast_methods: &'ast [ast::Method], + in_path: &ast::Path, + ) -> Option> { + let mut methods = Some(Vec::with_capacity(ast_methods.len())); -/// Lowers an [`ast::TypeName`]s into a [`hir::Type`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -fn lower_type( - ty: &ast::TypeName, - ltl: Option<&mut L>, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option { - match ty { - ast::TypeName::Primitive(prim) => Some(Type::Primitive(PrimitiveType::from_ast(*prim))), - ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { - ast::CustomType::Struct(strct) => { - if let Some(tcx_id) = lookup_id.resolve_struct(strct) { - let lifetimes = ltl?.lower_generics(&path.lifetimes[..], ty.is_self()); - - Some(Type::Struct(StructPath::new(lifetimes, tcx_id))) - } else if lookup_id.resolve_out_struct(strct).is_some() { - errors.push(LoweringError::Other(format!("found struct in input that is marked with #[diplomat::out]: {ty} in {path}"))); - None - } else { - unreachable!("struct `{}` wasn't found in the set of structs or out-structs, this is a bug.", strct.name); - } - } - ast::CustomType::Opaque(_) => { - errors.push(LoweringError::Other(format!( - "Opaque passed by value in input: {path}" - ))); - None - } - ast::CustomType::Enum(enm) => { - let tcx_id = lookup_id - .resolve_enum(enm) - .expect("can't find enum in lookup map, which contains all enums from env"); - - Some(Type::Enum(EnumPath::new(tcx_id))) + for method in ast_methods { + let method = self.lower_method(method, in_path); + match (method, &mut methods) { + (Some(method), Some(methods)) => { + methods.push(method); } + _ => methods = None, } } - ast::TypeName::Reference(lifetime, mutability, ref_ty) => match ref_ty.as_ref() { + + methods + } + + /// Lowers an [`ast::TypeName`]s into a [`hir::Type`]. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + fn lower_type( + &mut self, + ty: &ast::TypeName, + ltl: Option<&mut L>, + in_path: &ast::Path, + ) -> Option { + match ty { + ast::TypeName::Primitive(prim) => Some(Type::Primitive(PrimitiveType::from_ast(*prim))), ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { - ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { - let borrow = Borrow::new(ltl.lower_lifetime(lifetime), *mutability); - let lifetimes = ltl.lower_generics(&path.lifetimes[..], ref_ty.is_self()); - let tcx_id = lookup_id.resolve_opaque(opaque).expect( + match path.resolve(in_path, self.env) { + ast::CustomType::Struct(strct) => { + if let Some(tcx_id) = self.lookup_id.resolve_struct(strct) { + let lifetimes = ltl?.lower_generics(&path.lifetimes[..], ty.is_self()); + + Some(Type::Struct(StructPath::new(lifetimes, tcx_id))) + } else if self.lookup_id.resolve_out_struct(strct).is_some() { + self.errors.push(LoweringError::Other(format!("found struct in input that is marked with #[diplomat::out]: {ty} in {path}"))); + None + } else { + unreachable!("struct `{}` wasn't found in the set of structs or out-structs, this is a bug.", strct.name); + } + } + ast::CustomType::Opaque(_) => { + self.errors.push(LoweringError::Other(format!( + "Opaque passed by value in input: {path}" + ))); + None + } + ast::CustomType::Enum(enm) => { + let tcx_id = self.lookup_id.resolve_enum(enm).expect( + "can't find enum in lookup map, which contains all enums from env", + ); + + Some(Type::Enum(EnumPath::new(tcx_id))) + } + } + } + ast::TypeName::Reference(lifetime, mutability, ref_ty) => match ref_ty.as_ref() { + ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { + match path.resolve(in_path, self.env) { + ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { + let borrow = Borrow::new(ltl.lower_lifetime(lifetime), *mutability); + let lifetimes = + ltl.lower_generics(&path.lifetimes[..], ref_ty.is_self()); + let tcx_id = self.lookup_id.resolve_opaque(opaque).expect( "can't find opaque in lookup map, which contains all opaques from env", ); - Type::Opaque(OpaquePath::new(lifetimes, Optional(false), borrow, tcx_id)) - }), - _ => { - errors.push(LoweringError::Other(format!("found &T in input where T is a custom type, but not opaque. T = {ref_ty}"))); - None + Type::Opaque(OpaquePath::new( + lifetimes, + Optional(false), + borrow, + tcx_id, + )) + }), + _ => { + self.errors.push(LoweringError::Other(format!("found &T in input where T is a custom type, but not opaque. T = {ref_ty}"))); + None + } } } - } - _ => { - errors.push(LoweringError::Other(format!("found &T in input where T isn't a custom type and therefore not opaque. T = {ref_ty}"))); - None - } - }, - ast::TypeName::Box(box_ty) => { - errors.push(match box_ty.as_ref() { + _ => { + self.errors.push(LoweringError::Other(format!("found &T in input where T isn't a custom type and therefore not opaque. T = {ref_ty}"))); + None + } + }, + ast::TypeName::Box(box_ty) => { + self.errors.push(match box_ty.as_ref() { ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { + match path.resolve(in_path, self.env) { ast::CustomType::Opaque(_) => LoweringError::Other(format!("found Box in input where T is an opaque, but owned opaques aren't allowed in inputs. try &T instead? T = {path}")), _ => LoweringError::Other(format!("found Box in input where T is a custom type but not opaque. non-opaques can't be behind pointers, and opaques in inputs can't be owned. T = {path}")), } } _ => LoweringError::Other(format!("found Box in input where T isn't a custom type. T = {box_ty}")), }); - None - } - ast::TypeName::Option(opt_ty) => { - match opt_ty.as_ref() { + None + } + ast::TypeName::Option(opt_ty) => { + match opt_ty.as_ref() { ast::TypeName::Reference(lifetime, mutability, ref_ty) => match ref_ty.as_ref() { - ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => match path.resolve(in_path, env) { + ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => match path.resolve(in_path, self.env) { ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { let borrow = Borrow::new(ltl.lower_lifetime(lifetime), *mutability); let lifetimes = ltl.lower_generics(&path.lifetimes, ref_ty.is_self()); - let tcx_id = lookup_id.resolve_opaque(opaque).expect( + let tcx_id = self.lookup_id.resolve_opaque(opaque).expect( "can't find opaque in lookup map, which contains all opaques from env", ); @@ -443,164 +434,164 @@ fn lower_type( )) }), _ => { - errors.push(LoweringError::Other(format!("found Option<&T> in input where T is a custom type, but it's not opaque. T = {ref_ty}"))); + self.errors.push(LoweringError::Other(format!("found Option<&T> in input where T is a custom type, but it's not opaque. T = {ref_ty}"))); None } }, _ => { - errors.push(LoweringError::Other(format!("found Option<&T> in input, but T isn't a custom type and therefore not opaque. T = {ref_ty}"))); + self.errors.push(LoweringError::Other(format!("found Option<&T> in input, but T isn't a custom type and therefore not opaque. T = {ref_ty}"))); None } }, ast::TypeName::Box(box_ty) => { // we could see whats in the box here too - errors.push(LoweringError::Other(format!("found Option> in input, but box isn't allowed in inputs. T = {box_ty}"))); + self.errors.push(LoweringError::Other(format!("found Option> in input, but box isn't allowed in inputs. T = {box_ty}"))); None } _ => { - errors.push(LoweringError::Other(format!("found Option in input, where T isn't a reference but Option in inputs requires that T is a reference to an opaque. T = {opt_ty}"))); + self.errors.push(LoweringError::Other(format!("found Option in input, where T isn't a reference but Option in inputs requires that T is a reference to an opaque. T = {opt_ty}"))); None } } - } - ast::TypeName::Result(_, _, _) => { - errors.push(LoweringError::Other( - "Results can only appear as the top-level return type of methods".into(), - )); - None - } - ast::TypeName::Writeable => { - errors.push(LoweringError::Other( - "Writeables can only appear as the last parameter of a method".into(), - )); - None - } - ast::TypeName::StrReference(lifetime) => { - Some(Type::Slice(Slice::Str(ltl?.lower_lifetime(lifetime)))) - } - ast::TypeName::PrimitiveSlice(lifetime, mutability, prim) => { - let borrow = Borrow::new(ltl?.lower_lifetime(lifetime), *mutability); - let prim = PrimitiveType::from_ast(*prim); + } + ast::TypeName::Result(_, _, _) => { + self.errors.push(LoweringError::Other( + "Results can only appear as the top-level return type of methods".into(), + )); + None + } + ast::TypeName::Writeable => { + self.errors.push(LoweringError::Other( + "Writeables can only appear as the last parameter of a method".into(), + )); + None + } + ast::TypeName::StrReference(lifetime) => { + Some(Type::Slice(Slice::Str(ltl?.lower_lifetime(lifetime)))) + } + ast::TypeName::PrimitiveSlice(lifetime, mutability, prim) => { + let borrow = Borrow::new(ltl?.lower_lifetime(lifetime), *mutability); + let prim = PrimitiveType::from_ast(*prim); - Some(Type::Slice(Slice::Primitive(borrow, prim))) - } - ast::TypeName::Unit => { - errors.push(LoweringError::Other("Unit types can only appear as the return value of a method, or as the Ok/Err variants of a returned result".into())); - None + Some(Type::Slice(Slice::Primitive(borrow, prim))) + } + ast::TypeName::Unit => { + self.errors.push(LoweringError::Other("Unit types can only appear as the return value of a method, or as the Ok/Err variants of a returned result".into())); + None + } } } -} -/// Lowers an [`ast::TypeName`]s into an [`hir::OutType`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -fn lower_out_type( - ty: &ast::TypeName, - ltl: Option<&mut L>, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option { - match ty { - ast::TypeName::Primitive(prim) => Some(OutType::Primitive(PrimitiveType::from_ast(*prim))), - ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { - ast::CustomType::Struct(strct) => { - let lifetimes = ltl?.lower_generics(&path.lifetimes, ty.is_self()); - - if let Some(tcx_id) = lookup_id.resolve_struct(strct) { - Some(OutType::Struct(ReturnableStructPath::Struct( - StructPath::new(lifetimes, tcx_id), - ))) - } else if let Some(tcx_id) = lookup_id.resolve_out_struct(strct) { - Some(OutType::Struct(ReturnableStructPath::OutStruct( - OutStructPath::new(lifetimes, tcx_id), - ))) - } else { - unreachable!("struct `{}` wasn't found in the set of structs or out-structs, this is a bug.", strct.name); - } - } - ast::CustomType::Opaque(_) => { - errors.push(LoweringError::Other(format!( - "Opaque passed by value in input: {path}" - ))); - None - } - ast::CustomType::Enum(enm) => { - let tcx_id = lookup_id - .resolve_enum(enm) - .expect("can't find enum in lookup map, which contains all enums from env"); - - Some(OutType::Enum(EnumPath::new(tcx_id))) - } + /// Lowers an [`ast::TypeName`]s into an [`hir::OutType`]. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + fn lower_out_type( + &mut self, + ty: &ast::TypeName, + ltl: Option<&mut L>, + in_path: &ast::Path, + ) -> Option { + match ty { + ast::TypeName::Primitive(prim) => { + Some(OutType::Primitive(PrimitiveType::from_ast(*prim))) } - } - ast::TypeName::Reference(lifetime, mutability, ref_ty) => match ref_ty.as_ref() { ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { - ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { - let borrow = Borrow::new(ltl.lower_lifetime(lifetime), *mutability); - let lifetimes = ltl.lower_generics(&path.lifetimes, ref_ty.is_self()); - let tcx_id = lookup_id.resolve_opaque(opaque).expect( - "can't find opaque in lookup map, which contains all opaques from env", - ); + match path.resolve(in_path, self.env) { + ast::CustomType::Struct(strct) => { + let lifetimes = ltl?.lower_generics(&path.lifetimes, ty.is_self()); - OutType::Opaque(OpaquePath::new( - lifetimes, - Optional(false), - MaybeOwn::Borrow(borrow), - tcx_id, - )) - }), - _ => { - errors.push(LoweringError::Other(format!("found &T in output where T is a custom type, but not opaque. T = {ref_ty}"))); + if let Some(tcx_id) = self.lookup_id.resolve_struct(strct) { + Some(OutType::Struct(ReturnableStructPath::Struct( + StructPath::new(lifetimes, tcx_id), + ))) + } else if let Some(tcx_id) = self.lookup_id.resolve_out_struct(strct) { + Some(OutType::Struct(ReturnableStructPath::OutStruct( + OutStructPath::new(lifetimes, tcx_id), + ))) + } else { + unreachable!("struct `{}` wasn't found in the set of structs or out-structs, this is a bug.", strct.name); + } + } + ast::CustomType::Opaque(_) => { + self.errors.push(LoweringError::Other(format!( + "Opaque passed by value in input: {path}" + ))); None } - } - } - _ => { - errors.push(LoweringError::Other(format!("found &T in output where T isn't a custom type and therefore not opaque. T = {ref_ty}"))); - None - } - }, - ast::TypeName::Box(box_ty) => match box_ty.as_ref() { - ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { - ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { - let lifetimes = ltl.lower_generics(&path.lifetimes, box_ty.is_self()); - let tcx_id = lookup_id.resolve_opaque(opaque).expect( - "can't find opaque in lookup map, which contains all opaques from env", + ast::CustomType::Enum(enm) => { + let tcx_id = self.lookup_id.resolve_enum(enm).expect( + "can't find enum in lookup map, which contains all enums from env", ); - OutType::Opaque(OpaquePath::new( - lifetimes, - Optional(true), - MaybeOwn::Own, - tcx_id, - )) - }), - _ => { - errors.push(LoweringError::Other(format!("found Box in output where T is a custom type but not opaque. non-opaques can't be behind pointers. T = {path}"))); - None + Some(OutType::Enum(EnumPath::new(tcx_id))) } } } - _ => { - errors.push(LoweringError::Other(format!( - "found Box in output where T isn't a custom type. T = {box_ty}" - ))); - None - } - }, - ast::TypeName::Option(opt_ty) => match opt_ty.as_ref() { ast::TypeName::Reference(lifetime, mutability, ref_ty) => match ref_ty.as_ref() { ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { + match path.resolve(in_path, self.env) { ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { let borrow = Borrow::new(ltl.lower_lifetime(lifetime), *mutability); let lifetimes = ltl.lower_generics(&path.lifetimes, ref_ty.is_self()); - let tcx_id = lookup_id.resolve_opaque(opaque).expect( + let tcx_id = self.lookup_id.resolve_opaque(opaque).expect( + "can't find opaque in lookup map, which contains all opaques from env", + ); + + OutType::Opaque(OpaquePath::new( + lifetimes, + Optional(false), + MaybeOwn::Borrow(borrow), + tcx_id, + )) + }), + _ => { + self.errors.push(LoweringError::Other(format!("found &T in output where T is a custom type, but not opaque. T = {ref_ty}"))); + None + } + } + } + _ => { + self.errors.push(LoweringError::Other(format!("found &T in output where T isn't a custom type and therefore not opaque. T = {ref_ty}"))); + None + } + }, + ast::TypeName::Box(box_ty) => match box_ty.as_ref() { + ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { + match path.resolve(in_path, self.env) { + ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { + let lifetimes = ltl.lower_generics(&path.lifetimes, box_ty.is_self()); + let tcx_id = self.lookup_id.resolve_opaque(opaque).expect( + "can't find opaque in lookup map, which contains all opaques from env", + ); + + OutType::Opaque(OpaquePath::new( + lifetimes, + Optional(false), + MaybeOwn::Own, + tcx_id, + )) + }), + _ => { + self.errors.push(LoweringError::Other(format!("found Box in output where T is a custom type but not opaque. non-opaques can't be behind pointers. T = {path}"))); + None + } + } + } + _ => { + self.errors.push(LoweringError::Other(format!( + "found Box in output where T isn't a custom type. T = {box_ty}" + ))); + None + } + }, + ast::TypeName::Option(opt_ty) => match opt_ty.as_ref() { + ast::TypeName::Reference(lifetime, mutability, ref_ty) => match ref_ty.as_ref() { + ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { + match path.resolve(in_path, self.env) { + ast::CustomType::Opaque(opaque) => ltl.map(|ltl| { + let borrow = Borrow::new(ltl.lower_lifetime(lifetime), *mutability); + let lifetimes = ltl.lower_generics(&path.lifetimes, ref_ty.is_self()); + let tcx_id = self.lookup_id.resolve_opaque(opaque).expect( "can't find opaque in lookup map, which contains all opaques from env", ); @@ -612,245 +603,248 @@ fn lower_out_type( )) }), _ => { - errors.push(LoweringError::Other(format!("found Option<&T> where T is a custom type, but it's not opaque. T = {ref_ty}"))); + self.errors.push(LoweringError::Other(format!("found Option<&T> where T is a custom type, but it's not opaque. T = {ref_ty}"))); None } } - } - _ => { - errors.push(LoweringError::Other(format!("found Option<&T>, but T isn't a custom type and therefore not opaque. T = {ref_ty}"))); - None - } - }, - ast::TypeName::Box(box_ty) => match box_ty.as_ref() { - ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { - match path.resolve(in_path, env) { - ast::CustomType::Opaque(opaque) => { - let lifetimes = ltl?.lower_generics(&path.lifetimes, box_ty.is_self()); - let tcx_id = lookup_id.resolve_opaque(opaque).expect( + } + _ => { + self.errors.push(LoweringError::Other(format!("found Option<&T>, but T isn't a custom type and therefore not opaque. T = {ref_ty}"))); + None + } + }, + ast::TypeName::Box(box_ty) => match box_ty.as_ref() { + ast::TypeName::Named(path) | ast::TypeName::SelfType(path) => { + match path.resolve(in_path, self.env) { + ast::CustomType::Opaque(opaque) => { + let lifetimes = + ltl?.lower_generics(&path.lifetimes, box_ty.is_self()); + let tcx_id = self.lookup_id.resolve_opaque(opaque).expect( "can't find opaque in lookup map, which contains all opaques from env", ); - Some(OutType::Opaque(OpaquePath::new( - lifetimes, - Optional(true), - MaybeOwn::Own, - tcx_id, - ))) - } - _ => { - errors.push(LoweringError::Other(format!("found Option> where T is a custom type, but it's not opaque. T = {box_ty}"))); - None + Some(OutType::Opaque(OpaquePath::new( + lifetimes, + Optional(true), + MaybeOwn::Own, + tcx_id, + ))) + } + _ => { + self.errors.push(LoweringError::Other(format!("found Option> where T is a custom type, but it's not opaque. T = {box_ty}"))); + None + } } } - } + _ => { + self.errors.push(LoweringError::Other(format!("found Option>, but T isn't a custom type and therefore not opaque. T = {box_ty}"))); + None + } + }, _ => { - errors.push(LoweringError::Other(format!("found Option>, but T isn't a custom type and therefore not opaque. T = {box_ty}"))); + self.errors.push(LoweringError::Other(format!("found Option, where T isn't a reference but Option in inputs requires that T is a reference to an opaque. T = {opt_ty}"))); None } }, - _ => { - errors.push(LoweringError::Other(format!("found Option, where T isn't a reference but Option in inputs requires that T is a reference to an opaque. T = {opt_ty}"))); + ast::TypeName::Result(_, _, _) => { + self.errors.push(LoweringError::Other( + "Results can only appear as the top-level return type of methods".into(), + )); None } - }, - ast::TypeName::Result(_, _, _) => { - errors.push(LoweringError::Other( - "Results can only appear as the top-level return type of methods".into(), - )); - None - } - ast::TypeName::Writeable => { - errors.push(LoweringError::Other( - "Writeables can only appear as the last parameter of a method".into(), - )); - None - } - ast::TypeName::StrReference(lifetime) => { - Some(OutType::Slice(Slice::Str(ltl?.lower_lifetime(lifetime)))) - } - ast::TypeName::PrimitiveSlice(lifetime, mutability, prim) => { - let borrow = Borrow::new(ltl?.lower_lifetime(lifetime), *mutability); - let prim = PrimitiveType::from_ast(*prim); + ast::TypeName::Writeable => { + self.errors.push(LoweringError::Other( + "Writeables can only appear as the last parameter of a method".into(), + )); + None + } + ast::TypeName::StrReference(lifetime) => { + Some(OutType::Slice(Slice::Str(ltl?.lower_lifetime(lifetime)))) + } + ast::TypeName::PrimitiveSlice(lifetime, mutability, prim) => { + let borrow = Borrow::new(ltl?.lower_lifetime(lifetime), *mutability); + let prim = PrimitiveType::from_ast(*prim); - Some(OutType::Slice(Slice::Primitive(borrow, prim))) - } - ast::TypeName::Unit => { - errors.push(LoweringError::Other("Unit types can only appear as the return value of a method, or as the Ok/Err variants of a returned result".into())); - None + Some(OutType::Slice(Slice::Primitive(borrow, prim))) + } + ast::TypeName::Unit => { + self.errors.push(LoweringError::Other("Unit types can only appear as the return value of a method, or as the Ok/Err variants of a returned result".into())); + None + } } } -} -/// Lowers an [`ast::SelfParam`] into an [`hir::ParamSelf`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -fn lower_self_param<'ast>( - self_param: &ast::SelfParam, - self_param_ltl: Option>, - lookup_id: &LookupId, - method_full_path: &ast::Ident, // for better error msg - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option<(ParamSelf, ParamLifetimeLowerer<'ast>)> { - match self_param.path_type.resolve(in_path, env) { - ast::CustomType::Struct(strct) => { - if let Some(tcx_id) = lookup_id.resolve_struct(strct) { - if self_param.reference.is_some() { - errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes a reference to a struct as a self parameter, which isn't allowed"))); - None + /// Lowers an [`ast::SelfParam`] into an [`hir::ParamSelf`]. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + fn lower_self_param( + &mut self, + self_param: &ast::SelfParam, + self_param_ltl: Option>, + method_full_path: &ast::Ident, // for better error msg + in_path: &ast::Path, + ) -> Option<(ParamSelf, ParamLifetimeLowerer<'ast>)> { + match self_param.path_type.resolve(in_path, self.env) { + ast::CustomType::Struct(strct) => { + if let Some(tcx_id) = self.lookup_id.resolve_struct(strct) { + if self_param.reference.is_some() { + self.errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes a reference to a struct as a self parameter, which isn't allowed"))); + None + } else { + let mut param_ltl = self_param_ltl?.no_self_ref(); + + // Even if we explicitly write out the type of `self` like + // `self: Foo<'a>`, the `'a` is still not considered for + // elision according to rustc, so is_self=true. + let type_lifetimes = + param_ltl.lower_generics(&self_param.path_type.lifetimes[..], true); + + Some(( + ParamSelf::new(SelfType::Struct(StructPath::new( + type_lifetimes, + tcx_id, + ))), + param_ltl, + )) + } + } else if self.lookup_id.resolve_out_struct(strct).is_some() { + if let Some((lifetime, _)) = &self_param.reference { + self.errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes an out-struct as the self parameter, which isn't allowed. Also, it's behind a reference, `{lifetime}`, but only opaques can be behind references"))); + None + } else { + self.errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes an out-struct as the self parameter, which isn't allowed"))); + None + } } else { - let mut param_ltl = self_param_ltl?.no_self_ref(); - - // Even if we explicitly write out the type of `self` like - // `self: Foo<'a>`, the `'a` is still not considered for - // elision according to rustc, so is_self=true. - let type_lifetimes = - param_ltl.lower_generics(&self_param.path_type.lifetimes[..], true); - - Some(( - ParamSelf::new(SelfType::Struct(StructPath::new(type_lifetimes, tcx_id))), - param_ltl, - )) - } - } else if lookup_id.resolve_out_struct(strct).is_some() { - if let Some((lifetime, _)) = &self_param.reference { - errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes an out-struct as the self parameter, which isn't allowed. Also, it's behind a reference, `{lifetime}`, but only opaques can be behind references"))); - None - } else { - errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes an out-struct as the self parameter, which isn't allowed"))); - None - } - } else { - unreachable!( + unreachable!( "struct `{}` wasn't found in the set of structs or out-structs, this is a bug.", strct.name ); + } } - } - ast::CustomType::Opaque(opaque) => { - let tcx_id = lookup_id.resolve_opaque(opaque).expect("opaque is in env"); + ast::CustomType::Opaque(opaque) => { + let tcx_id = self + .lookup_id + .resolve_opaque(opaque) + .expect("opaque is in env"); - if let Some((lifetime, mutability)) = &self_param.reference { - let (borrow_lifetime, mut param_ltl) = self_param_ltl?.lower_self_ref(lifetime); - let borrow = Borrow::new(borrow_lifetime, *mutability); - let lifetimes = param_ltl.lower_generics(&self_param.path_type.lifetimes, true); + if let Some((lifetime, mutability)) = &self_param.reference { + let (borrow_lifetime, mut param_ltl) = self_param_ltl?.lower_self_ref(lifetime); + let borrow = Borrow::new(borrow_lifetime, *mutability); + let lifetimes = param_ltl.lower_generics(&self_param.path_type.lifetimes, true); + + Some(( + ParamSelf::new(SelfType::Opaque(OpaquePath::new( + lifetimes, + NonOptional, + borrow, + tcx_id, + ))), + param_ltl, + )) + } else { + self.errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes an opaque by value as the self parameter, but opaques as inputs must be behind refs"))); + None + } + } + ast::CustomType::Enum(enm) => { + let tcx_id = self.lookup_id.resolve_enum(enm).expect("enum is in env"); Some(( - ParamSelf::new(SelfType::Opaque(OpaquePath::new( - lifetimes, - NonOptional, - borrow, - tcx_id, - ))), - param_ltl, + ParamSelf::new(SelfType::Enum(EnumPath::new(tcx_id))), + self_param_ltl?.no_self_ref(), )) - } else { - errors.push(LoweringError::Other(format!("Method `{method_full_path}` takes an opaque by value as the self parameter, but opaques as inputs must be behind refs"))); - None } } - ast::CustomType::Enum(enm) => { - let tcx_id = lookup_id.resolve_enum(enm).expect("enum is in env"); - - Some(( - ParamSelf::new(SelfType::Enum(EnumPath::new(tcx_id))), - self_param_ltl?.no_self_ref(), - )) - } - } -} - -/// Lowers an [`ast::Param`] into an [`hir::Param`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -/// -/// Note that this expects that if there was a writeable param at the end in -/// the method, it's not passed into here. -fn lower_param( - param: &ast::Param, - ltl: Option<&mut L>, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option { - let name = lower_ident(¶m.name, "param name", errors); - let ty = lower_type(¶m.ty, ltl, lookup_id, in_path, env, errors); - - Some(Param::new(name?, ty?)) -} - -/// Lowers many [`ast::Param`]s into a vector of [`hir::Param`]s. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -/// -/// Note that this expects that if there was a writeable param at the end in -/// the method, `ast_params` was sliced to not include it. This happens in -/// `lower_method`, the caller of this function. -fn lower_many_params<'ast>( - ast_params: &[ast::Param], - mut param_ltl: Option>, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option<(Vec, ReturnLifetimeLowerer<'ast>)> { - let mut params = Some(Vec::with_capacity(ast_params.len())); - - for param in ast_params { - let param = lower_param(param, param_ltl.as_mut(), lookup_id, in_path, env, errors); - - match (param, &mut params) { - (Some(param), Some(params)) => { - params.push(param); - } - _ => params = None, - } } - Some((params?, param_ltl?.into_return_ltl())) -} + /// Lowers an [`ast::Param`] into an [`hir::Param`]. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + /// + /// Note that this expects that if there was a writeable param at the end in + /// the method, it's not passed into here. + fn lower_param( + &mut self, + param: &ast::Param, + ltl: Option<&mut L>, + in_path: &ast::Path, + ) -> Option { + let name = self.lower_ident(¶m.name, "param name"); + let ty = self.lower_type(¶m.ty, ltl, in_path); -/// Lowers the return type of an [`ast::Method`] into a [`hir::ReturnFallability`]. -/// -/// If there are any errors, they're pushed to `errors` and `None` is returned. -fn lower_return_type( - return_type: Option<&ast::TypeName>, - takes_writeable: bool, - mut return_ltl: Option>, - lookup_id: &LookupId, - in_path: &ast::Path, - env: &Env, - errors: &mut Vec, -) -> Option<(ReturnType, LifetimeEnv)> { - let writeable_option = if takes_writeable { - Some(SuccessType::Writeable) - } else { - None - }; - match return_type.unwrap_or(&ast::TypeName::Unit) { - ast::TypeName::Result(ok_ty, err_ty, _) => { - let ok_ty = match ok_ty.as_ref() { - ast::TypeName::Unit => Some(writeable_option), - ty => lower_out_type(ty, return_ltl.as_mut(), lookup_id, in_path, env, errors) - .map(|ty| Some(SuccessType::OutType(ty))), - }; - let err_ty = match err_ty.as_ref() { - ast::TypeName::Unit => Some(None), - ty => lower_out_type(ty, return_ltl.as_mut(), lookup_id, in_path, env, errors) - .map(Some), - }; + Some(Param::new(name?, ty?)) + } - match (ok_ty, err_ty) { - (Some(ok_ty), Some(err_ty)) => Some(ReturnType::Fallible(ok_ty, err_ty)), - _ => None, + /// Lowers many [`ast::Param`]s into a vector of [`hir::Param`]s. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + /// + /// Note that this expects that if there was a writeable param at the end in + /// the method, `ast_params` was sliced to not include it. This happens in + /// `self.lower_method`, the caller of this function. + fn lower_many_params( + &mut self, + ast_params: &[ast::Param], + mut param_ltl: Option>, + in_path: &ast::Path, + ) -> Option<(Vec, ReturnLifetimeLowerer<'ast>)> { + let mut params = Some(Vec::with_capacity(ast_params.len())); + + for param in ast_params { + let param = self.lower_param(param, param_ltl.as_mut(), in_path); + + match (param, &mut params) { + (Some(param), Some(params)) => { + params.push(param); + } + _ => params = None, } } - ast::TypeName::Unit => Some(ReturnType::Infallible(writeable_option)), - ty => lower_out_type(ty, return_ltl.as_mut(), lookup_id, in_path, env, errors) - .map(|ty| ReturnType::Infallible(Some(SuccessType::OutType(ty)))), + + Some((params?, param_ltl?.into_return_ltl())) + } + + /// Lowers the return type of an [`ast::Method`] into a [`hir::ReturnFallability`]. + /// + /// If there are any errors, they're pushed to `errors` and `None` is returned. + fn lower_return_type( + &mut self, + return_type: Option<&ast::TypeName>, + takes_writeable: bool, + mut return_ltl: Option>, + in_path: &ast::Path, + ) -> Option<(ReturnType, LifetimeEnv)> { + let writeable_option = if takes_writeable { + Some(SuccessType::Writeable) + } else { + None + }; + match return_type.unwrap_or(&ast::TypeName::Unit) { + ast::TypeName::Result(ok_ty, err_ty, _) => { + let ok_ty = match ok_ty.as_ref() { + ast::TypeName::Unit => Some(writeable_option), + ty => self + .lower_out_type(ty, return_ltl.as_mut(), in_path) + .map(|ty| Some(SuccessType::OutType(ty))), + }; + let err_ty = match err_ty.as_ref() { + ast::TypeName::Unit => Some(None), + ty => self + .lower_out_type(ty, return_ltl.as_mut(), in_path) + .map(Some), + }; + + match (ok_ty, err_ty) { + (Some(ok_ty), Some(err_ty)) => Some(ReturnType::Fallible(ok_ty, err_ty)), + _ => None, + } + } + ast::TypeName::Unit => Some(ReturnType::Infallible(writeable_option)), + ty => self + .lower_out_type(ty, return_ltl.as_mut(), in_path) + .map(|ty| ReturnType::Infallible(Some(SuccessType::OutType(ty)))), + } + .and_then(|return_fallability| Some((return_fallability, return_ltl?.finish()))) } - .and_then(|return_fallability| Some((return_fallability, return_ltl?.finish()))) } diff --git a/third_party/rust/diplomat_core/src/hir/methods.rs b/third_party/rust/diplomat_core/src/hir/methods.rs index b6050553fe51..648f76879cad 100644 --- a/third_party/rust/diplomat_core/src/hir/methods.rs +++ b/third_party/rust/diplomat_core/src/hir/methods.rs @@ -5,12 +5,13 @@ use std::fmt::{self, Write}; use smallvec::SmallVec; use super::{ - paths, Docs, Ident, IdentBuf, LifetimeEnv, MaybeStatic, MethodLifetime, MethodLifetimes, + paths, Attrs, Docs, Ident, IdentBuf, LifetimeEnv, MaybeStatic, MethodLifetime, MethodLifetimes, OutType, SelfType, Slice, Type, TypeContext, TypeLifetime, TypeLifetimes, }; /// A method exposed to Diplomat. #[derive(Debug)] +#[non_exhaustive] pub struct Method { pub docs: Docs, pub name: IdentBuf, @@ -19,10 +20,12 @@ pub struct Method { pub param_self: Option, pub params: Vec, pub output: ReturnType, + pub attrs: Attrs, } /// Type that the method returns. #[derive(Debug)] +#[non_exhaustive] pub enum SuccessType { Writeable, OutType(OutType), @@ -30,6 +33,7 @@ pub enum SuccessType { /// Whether or not the method returns a value or a result. #[derive(Debug)] +#[allow(clippy::exhaustive_enums)] // this only exists for fallible/infallible, breaking changes for more complex returns are ok pub enum ReturnType { Infallible(Option), Fallible(Option, Option), @@ -37,12 +41,14 @@ pub enum ReturnType { /// The `self` parameter of a method. #[derive(Debug)] +#[non_exhaustive] pub struct ParamSelf { pub ty: SelfType, } /// A parameter in a method. #[derive(Debug)] +#[non_exhaustive] pub struct Param { pub name: IdentBuf, pub ty: Type, diff --git a/third_party/rust/diplomat_core/src/hir/mod.rs b/third_party/rust/diplomat_core/src/hir/mod.rs index 3ee4963aff50..63d365cf6698 100644 --- a/third_party/rust/diplomat_core/src/hir/mod.rs +++ b/third_party/rust/diplomat_core/src/hir/mod.rs @@ -2,6 +2,7 @@ //! //! Enabled with the `"hir"` Cargo feature +mod attrs; mod defs; mod elision; mod lifetimes; @@ -12,6 +13,7 @@ mod primitives; mod ty_position; mod type_context; mod types; +pub use attrs::*; pub use defs::*; pub(super) use elision::*; pub use lifetimes::*; diff --git a/third_party/rust/diplomat_core/src/hir/paths.rs b/third_party/rust/diplomat_core/src/hir/paths.rs index 446490c7d2f4..e2d9930ecc86 100644 --- a/third_party/rust/diplomat_core/src/hir/paths.rs +++ b/third_party/rust/diplomat_core/src/hir/paths.rs @@ -5,6 +5,7 @@ use super::{ /// Path to a struct that may appear as an output. #[derive(Debug, Clone)] +#[non_exhaustive] pub enum ReturnableStructPath { Struct(StructPath), OutStruct(OutStructPath), @@ -15,6 +16,7 @@ pub type OutStructPath = StructPath; /// Path to a struct that can be used in inputs and outputs. #[derive(Debug, Clone)] +#[non_exhaustive] pub struct StructPath { pub lifetimes: TypeLifetimes, pub tcx_id: P::StructId, @@ -35,6 +37,7 @@ pub struct StructPath { /// 3. `OpaquePath`: Opaques in the `&self` position, which /// cannot be optional and must be borrowed for the same reason as above. #[derive(Debug, Clone)] +#[non_exhaustive] pub struct OpaquePath { pub lifetimes: TypeLifetimes, pub optional: Opt, @@ -46,6 +49,7 @@ pub struct OpaquePath { pub struct Optional(pub(super) bool); #[derive(Debug, Copy, Clone)] +#[allow(clippy::exhaustive_structs)] // marker type pub struct NonOptional; impl OpaquePath { @@ -79,6 +83,7 @@ impl OpaquePath { /// Path to an enum. #[derive(Debug, Clone)] +#[non_exhaustive] pub struct EnumPath { pub tcx_id: EnumId, } @@ -87,6 +92,7 @@ pub struct EnumPath { /// /// Since owned opaques cannot be used as inputs, this only appears in output types. #[derive(Copy, Clone, Debug)] +#[allow(clippy::exhaustive_enums)] // only two answers to this question pub enum MaybeOwn { Own, Borrow(Borrow), diff --git a/third_party/rust/diplomat_core/src/hir/primitives.rs b/third_party/rust/diplomat_core/src/hir/primitives.rs index 4f68b41f115e..b51a3e1759ea 100644 --- a/third_party/rust/diplomat_core/src/hir/primitives.rs +++ b/third_party/rust/diplomat_core/src/hir/primitives.rs @@ -3,6 +3,7 @@ use crate::ast; /// 8, 16, 32, and 64-bit signed and unsigned integers. #[derive(Copy, Clone, Debug)] +#[allow(clippy::exhaustive_enums)] // there are only these pub enum IntType { I8, I16, @@ -16,6 +17,7 @@ pub enum IntType { /// Platform-dependent signed and unsigned size types. #[derive(Copy, Clone, Debug)] +#[allow(clippy::exhaustive_enums)] // there are only these pub enum IntSizeType { Isize, Usize, @@ -23,6 +25,7 @@ pub enum IntSizeType { /// 128-bit signed and unsigned integers. #[derive(Copy, Clone, Debug)] +#[allow(clippy::exhaustive_enums)] // there are only these pub enum Int128Type { I128, U128, @@ -30,6 +33,7 @@ pub enum Int128Type { /// 32 and 64-bit floating point numbers. #[derive(Copy, Clone, Debug)] +#[allow(clippy::exhaustive_enums)] // there are only these pub enum FloatType { F32, F64, @@ -37,6 +41,7 @@ pub enum FloatType { /// All primitive types. #[derive(Copy, Clone, Debug)] +#[allow(clippy::exhaustive_enums)] // there are only these pub enum PrimitiveType { Bool, Char, diff --git a/third_party/rust/diplomat_core/src/hir/snapshots/diplomat_core__hir__elision__tests__simple_mod.snap b/third_party/rust/diplomat_core/src/hir/snapshots/diplomat_core__hir__elision__tests__simple_mod.snap index 47bb56bf33da..50b96b9b9358 100644 --- a/third_party/rust/diplomat_core/src/hir/snapshots/diplomat_core__hir__elision__tests__simple_mod.snap +++ b/third_party/rust/diplomat_core/src/hir/snapshots/diplomat_core__hir__elision__tests__simple_mod.snap @@ -29,7 +29,7 @@ TypeContext { ], }, optional: Optional( - true, + false, ), owner: Own, tcx_id: OpaqueId( @@ -95,8 +95,16 @@ TypeContext { ), ), ), + attrs: Attrs { + disable: false, + rename: None, + }, }, ], + attrs: Attrs { + disable: false, + rename: None, + }, }, ], structs: [ @@ -190,8 +198,16 @@ TypeContext { ), ), ), + attrs: Attrs { + disable: false, + rename: None, + }, }, ], + attrs: Attrs { + disable: false, + rename: None, + }, }, ], opaques: [ @@ -202,6 +218,10 @@ TypeContext { ), name: "Opaque", methods: [], + attrs: Attrs { + disable: false, + rename: None, + }, }, ], enums: [], diff --git a/third_party/rust/diplomat_core/src/hir/ty_position.rs b/third_party/rust/diplomat_core/src/hir/ty_position.rs index ed6d75258684..322f54cb0df9 100644 --- a/third_party/rust/diplomat_core/src/hir/ty_position.rs +++ b/third_party/rust/diplomat_core/src/hir/ty_position.rs @@ -109,6 +109,7 @@ pub trait TyPosition: Debug + Copy { /// /// The complement of this type is [`OutputOnly`]. #[derive(Debug, Copy, Clone)] +#[non_exhaustive] pub struct Everywhere; /// One of two types implementing [`TyPosition`], representing types that can @@ -116,6 +117,7 @@ pub struct Everywhere; /// /// The complement of this type is [`Everywhere`]. #[derive(Debug, Copy, Clone)] +#[non_exhaustive] pub struct OutputOnly; impl TyPosition for Everywhere { diff --git a/third_party/rust/diplomat_core/src/hir/type_context.rs b/third_party/rust/diplomat_core/src/hir/type_context.rs index 58ffd62738a2..73f7c5d22030 100644 --- a/third_party/rust/diplomat_core/src/hir/type_context.rs +++ b/third_party/rust/diplomat_core/src/hir/type_context.rs @@ -1,6 +1,9 @@ //! Store all the types contained in the HIR. -use super::{EnumDef, LoweringError, OpaqueDef, OutStructDef, StructDef, TypeDef, TypeLowerer}; +use super::{ + AttributeValidator, EnumDef, LoweringContext, LoweringError, OpaqueDef, OutStructDef, + StructDef, TypeDef, +}; #[allow(unused_imports)] // use in docs links use crate::hir; use crate::{ast, Env}; @@ -34,6 +37,7 @@ pub struct OpaqueId(usize); pub struct EnumId(usize); #[derive(Copy, Clone, Debug)] +#[non_exhaustive] pub enum TypeId { Struct(StructId), OutStruct(OutStructId), @@ -109,7 +113,10 @@ impl TypeContext { } /// Lower the AST to the HIR while simultaneously performing validation. - pub fn from_ast(env: &Env) -> Result> { + pub fn from_ast( + env: &Env, + attr_validator: impl AttributeValidator + 'static, + ) -> Result> { let mut ast_out_structs = SmallVec::<[_; 16]>::new(); let mut ast_structs = SmallVec::<[_; 16]>::new(); let mut ast_opaques = SmallVec::<[_; 16]>::new(); @@ -139,12 +146,19 @@ impl TypeContext { &ast_opaques[..], &ast_enums[..], ); + let attr_validator = Box::new(attr_validator); - let out_structs = - OutStructDef::lower_all(&ast_out_structs[..], &lookup_id, env, &mut errors); - let structs = StructDef::lower_all(&ast_structs[..], &lookup_id, env, &mut errors); - let opaques = OpaqueDef::lower_all(&ast_opaques[..], &lookup_id, env, &mut errors); - let enums = EnumDef::lower_all(&ast_enums[..], &lookup_id, env, &mut errors); + let mut ctx = LoweringContext { + lookup_id: &lookup_id, + env, + errors: &mut errors, + attr_validator, + }; + + let out_structs = ctx.lower_all_out_structs(&ast_out_structs[..]); + let structs = ctx.lower_all_structs(&ast_structs[..]); + let opaques = ctx.lower_all_opaques(&ast_opaques[..]); + let enums = ctx.lower_all_enums(&ast_enums[..]); match (out_structs, structs, opaques, enums) { (Some(out_structs), Some(structs), Some(opaques), Some(enums)) => { diff --git a/third_party/rust/diplomat_core/src/hir/types.rs b/third_party/rust/diplomat_core/src/hir/types.rs index dd296b744488..1d26d5b57a46 100644 --- a/third_party/rust/diplomat_core/src/hir/types.rs +++ b/third_party/rust/diplomat_core/src/hir/types.rs @@ -12,6 +12,7 @@ pub type OutType = Type; /// Type that may be used as input or output. #[derive(Debug)] +#[non_exhaustive] pub enum Type { Primitive(PrimitiveType), Opaque(OpaquePath), @@ -22,6 +23,7 @@ pub enum Type { /// Type that can appear in the `self` position. #[derive(Debug, Clone)] +#[non_exhaustive] pub enum SelfType { Opaque(OpaquePath), Struct(StructPath), @@ -29,6 +31,7 @@ pub enum SelfType { } #[derive(Copy, Clone, Debug)] +#[non_exhaustive] pub enum Slice { /// A string slice, e.g. `&str`. Str(MaybeStatic), @@ -46,6 +49,7 @@ pub enum Slice { // involve getting the implicit lifetime thing to be understood by Diplomat, but // should be doable. #[derive(Copy, Clone, Debug)] +#[non_exhaustive] pub struct Borrow { pub lifetime: MaybeStatic, pub mutability: Mutability, @@ -68,6 +72,18 @@ impl Type { } } +impl SelfType { + /// Returns whether the self parameter is borrowed immutably. + /// + /// Curently this can only happen with opaque types. + pub fn is_immutably_borrowed(&self) -> bool { + match self { + SelfType::Opaque(opaque_path) => opaque_path.owner.mutability == Mutability::Immutable, + _ => false, + } + } +} + impl Slice { /// Returns the [`TypeLifetime`] contained in either the `Str` or `Primitive` /// variant. diff --git a/third_party/rust/diplomat_core/src/lib.rs b/third_party/rust/diplomat_core/src/lib.rs index a5b2b17ad85b..84853724a027 100644 --- a/third_party/rust/diplomat_core/src/lib.rs +++ b/third_party/rust/diplomat_core/src/lib.rs @@ -4,6 +4,7 @@ //! extracting APIs. #![allow(clippy::needless_lifetimes)] // we use named lifetimes for clarity +#![warn(clippy::exhaustive_structs, clippy::exhaustive_enums)] pub mod ast; #[cfg(feature = "hir")] diff --git a/third_party/rust/icu_capi/.cargo-checksum.json b/third_party/rust/icu_capi/.cargo-checksum.json deleted file mode 100644 index 3b79cc1f6179..000000000000 --- a/third_party/rust/icu_capi/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{"Cargo.toml":"a9f8c93e6f5fef683bed4df60ef8bb9b98997ac6af0a454ad6c2a207290a3587","LICENSE":"4ad7541d66a407234e2c84902124cef325c29f3e966353efdb800bedb8b8da21","README.md":"ff88c9913a6c75cc82bdfad4e6de23fbcac4be6cdbf5f9d4b326f20f85c927eb","c/README.md":"96cec260fc38a16a614e7ddf01258c0a60b1efe6f074cfbcd2c71c9d21cb9c4d","c/examples/fixeddecimal_tiny/README.md":"83d48bb81d46bc43dc7aa54b0d93b75c95df2555ea716e2f78de260492a06066","c/include/CodePointRangeIterator.h":"855f692f24f7a35c21d3f7f02bd7025c9e26836abf19f9eedb4c7acbebde7b0e","c/include/CodePointRangeIteratorResult.h":"24c9939e1dbb5475aaa463548eb9370dc8dda1d441b1fc7183aca4cb38e9c974","c/include/ICU4XAnyCalendarKind.h":"98fbcf1e114c8075bab271443108a0ff2eee01f4bba4bbcfe8222bdb5f616489","c/include/ICU4XBidi.h":"8a4579f8215964b3172f48844ea09b12e849dda996b071d1819641f00b4906e3","c/include/ICU4XBidiDirection.h":"89a59db1407f4dd10898bd7e51a145a7cfe0633b83eeec45f0032d973d6264b2","c/include/ICU4XBidiInfo.h":"0cc33c56c2d5404b83a09cd4a4707f9ed25945b49f6cfeb9c3aadfd2ee65cfd4","c/include/ICU4XBidiParagraph.h":"bd149a4f5554e9200bcfc66f048c9cc4027575417bd9d5669d3c630b9a8284e4","c/include/ICU4XCalendar.h":"5a9106afbda3c239f63514979d885ae452cdcae6cc6026d3f8490d69aacd521b","c/include/ICU4XCanonicalCombiningClassMap.h":"92c5129ef2a7e9994f66cb94b43abf94f335d2e2a37ad5fac2cd999b85ac5456","c/include/ICU4XCanonicalComposition.h":"635cfc855017d7dfab446a39e5d8d835fc46b79a629508790c3037476bd8d9ba","c/include/ICU4XCanonicalDecomposition.h":"1076939f1fe5b67d9798524b0d757b5b8bd291b112ff6f3f6365ad219a8e2f2b","c/include/ICU4XCodePointMapData16.h":"57bd7f80f4cf901d2b7048b0e91d6fb95c0c0d30845f53026794f5b0adbc198e","c/include/ICU4XCodePointMapData8.h":"6e9b20e9028cb628f93ed9a9b8e8890f32e4c6bb91c2d0dfe2b32f63a83b974a","c/include/ICU4XCodePointSetData.h":"7337436920bb0777892687a1f72249f6b1cd669a1a80d20a8096e5bdc590eb7e","c/include/ICU4XCollator.h":"8d4aa7b68d6266fd1b063381087d1a46571e4cb69316d931de13984a4be925d3","c/include/ICU4XCollatorAlternateHandling.h":"ebd0f6409caaf133b8168447a3697c957c820c2fdb3df20511f2f2204b00b4c9","c/include/ICU4XCollatorBackwardSecondLevel.h":"0e5e2eb6dc28eeb00474dc8fae31986760fbcbeb89a161137798b16a7fbd1321","c/include/ICU4XCollatorCaseFirst.h":"554673ede038c701bb1901dd445ca7053166ff4acb287d0e176f2eaee11ea1f6","c/include/ICU4XCollatorCaseLevel.h":"136d4e3bfd658b4eaff32265b44a1655f12d279389ac2b6751dcb2796cb9fd4e","c/include/ICU4XCollatorMaxVariable.h":"a92d7ace800d74f69ea143768aef1c077e82100d7793c5c4f0e269127ac8d06e","c/include/ICU4XCollatorNumeric.h":"47bf4863d1b84232c8eec2acc7fa8c15416a4ec5d0e271ae6937ca21662cbbf7","c/include/ICU4XCollatorOptionsV1.h":"e5a839b8690b7a2a5fddbfb897928c3c533c9bee8a172d64f99b9bfbfac54991","c/include/ICU4XCollatorStrength.h":"9c01f423c788b5b68391487d8e773eff3b409d0f4c91c08b750ec46a90a9fef9","c/include/ICU4XComposingNormalizer.h":"05f377de32c1a12a6460fba63033e23fbd418d737943f7452ff7b177ac433ad7","c/include/ICU4XCustomTimeZone.h":"6ac971546dc119416caab463a57688126649f599c6a95a54bf8ff7d6c87dd3bc","c/include/ICU4XDataProvider.h":"ce5c502cb1b0beeaac051c460fe212ca6f7ca10093f71cdce167d3b99e2f5d81","c/include/ICU4XDataStruct.h":"d9214515d58f8b3aadfbb1fb4f5ba030b2f00b9b250cf953e50e9ef4e4158437","c/include/ICU4XDate.h":"3a2974b05110af1eed01249a7a6c0c8b5f891adb16f05ff8253d6fd70be4c17f","c/include/ICU4XDateFormatter.h":"9b68b9c96457bb3a58fc41a992a815a216d9dc690ebc7e1123f283580cb3f569","c/include/ICU4XDateLength.h":"99a2dc6ff1a34a84800cda21dc69a81ccec348cda6082970eef8feeb9ea8c051","c/include/ICU4XDateTime.h":"3f04cc39abc5477b145a546488513fe2235f7dbab482f0aa09dc9c1904b7fbca","c/include/ICU4XDateTimeFormatter.h":"27b315cdd9213ddddef012c001d5d2956f9441ff3c078ab5bd438b02a6ffc4e7","c/include/ICU4XDecomposed.h":"005a75fcf7fbcca73b674740e6319509c62b70b1337423fd024e28735f6a5c78","c/include/ICU4XDecomposingNormalizer.h":"3ba38d2ab181d2d319a7efe7b03e78651d679621cd4cfd0e44e276617999fe24","c/include/ICU4XDisplayNamesFallback.h":"7d7f8b545fcad7c5dcb1ace2a30aac8014dbf4b4b2f256956e724cf94e6c2677","c/include/ICU4XDisplayNamesOptionsV1.h":"182689a09a7d7ee60704ab5ac7b62f774948c3fdd9b25e67c6e8ce3b46dec971","c/include/ICU4XDisplayNamesStyle.h":"1bc8b6c69691c237e802fb4379904fb5fcdd5abfb2bdc3e68b3ca0a205d1080a","c/include/ICU4XError.h":"03ebddcc05bbc59289120acad0229802d8f5d6afd6b1889c1415e625a193b9a9","c/include/ICU4XFixedDecimal.h":"e8faf4b7ced8c8d277c0dae8bfd3706d53d1231f329913731b969696fdafb5e9","c/include/ICU4XFixedDecimalFormatter.h":"1271f7f8bf20feec7e5861d6a985339c5bf6da4e81f1099c799546c54e09a94f","c/include/ICU4XFixedDecimalGroupingStrategy.h":"6a3bfa97e9d53d02730909a0a23d468663e0466fb13312b02da3625eb4ac6980","c/include/ICU4XFixedDecimalSign.h":"5bdc531f7961d47cc8130427a80c3e40b6bd11678fecf71f779ec217a70ad3be","c/include/ICU4XFixedDecimalSignDisplay.h":"412d93364396b0d1e987d6f997871084163103360bb0a474d2ea8889b9a51db3","c/include/ICU4XGeneralCategoryNameToMaskMapper.h":"53ce5570633c42454da873f08e7de33ccee0e7e120adcc682b2d9ffeac65046d","c/include/ICU4XGraphemeClusterBreakIteratorLatin1.h":"e516f5f3e7916a2a2f101b4790e0fad5c2d0d3f534b512016e260e7bc1a96828","c/include/ICU4XGraphemeClusterBreakIteratorUtf16.h":"8318a9183ebe63cb91f63535b658a035e08724464efc5523643f54f9eb3c33cf","c/include/ICU4XGraphemeClusterBreakIteratorUtf8.h":"62bde7543b4505cb7ca78fb3586770945a368a17ddb6f759679537864590d4a3","c/include/ICU4XGraphemeClusterSegmenter.h":"623fe0deb02155a66363a301eabdd71d0e8565c991e43c0a0b269345dfc4edd5","c/include/ICU4XGregorianDateFormatter.h":"b16d94873ab46783e3ca040ae1f3335c008caa7eb83267ddd2decfb11de8173b","c/include/ICU4XGregorianDateTimeFormatter.h":"895afb0c42900402535b73d7a92c348000e24ade6b333e6a8d0c99f46a3c306f","c/include/ICU4XGregorianZonedDateTimeFormatter.h":"a8d6fac5c2514ca88334bd273ad96160c74582aa416f9c7e13a7969425cd0d95","c/include/ICU4XIsoDate.h":"199c271f59c6d0f6cd199466ba96b8a954b1a8a83a696fa180ab2f3ad085b405","c/include/ICU4XIsoDateTime.h":"cf93f6ec4ba94142c471e453ac78f63620d71a6eb971a674c015572765208e7b","c/include/ICU4XIsoTimeZoneFormat.h":"7f99a45d84ab1292fe3ef50b0030b27442cec24172afb04674f6dd861cfa410b","c/include/ICU4XIsoTimeZoneMinuteDisplay.h":"e8acbc9cc0d191e38e271b5d4da97688047937aadc98dc241a4e66839d7c1315","c/include/ICU4XIsoTimeZoneOptions.h":"a23d3a3aea566b9e0bb28945a7da11862e59462c37aae925a8b06f6b3c53e181","c/include/ICU4XIsoTimeZoneSecondDisplay.h":"f1e23eac627f2bd85a59db7b700a374714119b855e5adcdfa27ca3ef19c02d0d","c/include/ICU4XIsoWeekday.h":"a145439e1c3918a4e7ff0b03b39c2c8b1a2c7e035b4a9eb44b15f62c2b5b084d","c/include/ICU4XLanguageDisplay.h":"53090fe4bd1ec74367afbc9fb7580203690ce53ca99f58905da365693c446951","c/include/ICU4XLineBreakIteratorLatin1.h":"bb1851ad2560aaa88c819b06542693186ba991dc8a5fc26936781e00ed215fa6","c/include/ICU4XLineBreakIteratorUtf16.h":"61d5f40b5ddfed50a4414dafeb75aab49384309375a5bb8c1db21987eb95ffa6","c/include/ICU4XLineBreakIteratorUtf8.h":"453e6711f0345128bb982838ed40bd67a141265a21b0cd2218310d8bc93dd014","c/include/ICU4XLineBreakOptionsV1.h":"230517bf5ccee15032ec091dc18074ca4714242a7ffd81983ab3d872d0e46245","c/include/ICU4XLineBreakStrictness.h":"0906420e594bc72ff88957b4b9f85966cd5d72a99bea8b9f29c593d0d421ebb6","c/include/ICU4XLineBreakWordOption.h":"812e0beb839fc77869f0e82144d5f28323f74e54217aa2a684e026d54cb3bcf6","c/include/ICU4XLineSegmenter.h":"1b8b32fbca641d11d7c29180fd37882ae84e6019574d88d5726f27d8d732ca46","c/include/ICU4XList.h":"61aa297726f8320e2db5dc82fbcaf9655606e69c1b576c4609ed7cc00a4761fe","c/include/ICU4XListFormatter.h":"e7a4c0960e21dd7c927f2446e68f899f6fa1ffbd3fb62f16275e3549b3b7df95","c/include/ICU4XListLength.h":"d5614e3beeb177aa994be08e2d2aedb60eb70029d85bf3a6c6e146fcd81585da","c/include/ICU4XLocale.h":"4c8a4eee422925ea9a5b358ea2d2e0ceafb3bc7506a3e08bfc0abe6c583d28b1","c/include/ICU4XLocaleCanonicalizer.h":"729fc0b406f32508ca271f342e8e0a04d5a9ad236b9cf29afe8ef3dc0e55956d","c/include/ICU4XLocaleDisplayNamesFormatter.h":"6b2627ea0c51382fa9c17986d419fced926af9765ccc4a50cbee186a18bb4e8c","c/include/ICU4XLocaleExpander.h":"acc58a303fc99ff1aee637985887b2694bf3744963f19fad790af7cd3d1d4b5b","c/include/ICU4XLocaleFallbackConfig.h":"fb5037e7dcff96d6fddbcfe82ed86792865623e3ee83a27a7f57b282b317a49b","c/include/ICU4XLocaleFallbackIterator.h":"6509d75408b7a6d430f4caa3468148d0a06c4ff4490728205692db5d9c2e556e","c/include/ICU4XLocaleFallbackPriority.h":"aa69b2108b5fefcd0325b7263f1db8473b17ab8d5fad74e641eb8ee2bfd4b54c","c/include/ICU4XLocaleFallbacker.h":"965da30fd0e5280c086a104fccd117a63450f30efa49b9198037cd95d6b22bcd","c/include/ICU4XLocaleFallbackerWithConfig.h":"8144d2a7fbd88ce8e0dfca4522d4a00e0850332f53b3b47751687a2ed772749f","c/include/ICU4XLogger.h":"9a5442ab6151781529d6168d452ff12b2a82f1ce60905d7cf1b165a22c1b8b87","c/include/ICU4XMetazoneCalculator.h":"f67642f2699df48e660034834c60620efddf28b5313daf6a4caeb49231e72600","c/include/ICU4XOrdering.h":"2623e442030eeaad06e60a85813fd38690f934a615cf7d1d34dc7ce3f687c737","c/include/ICU4XPluralCategories.h":"4b976338eb417be4d785654d9edcd7f6557e5ce8426e03b37d8a59349eba2aa5","c/include/ICU4XPluralCategory.h":"7f5e82bd8a601c3fd69c9a8ef462e01fedd26a3713a227b9daddc4360e49b0e8","c/include/ICU4XPluralOperands.h":"c67fb8047061802a466f0655d9613e88c24c5773865f905e9784b66ef61b5e28","c/include/ICU4XPluralRules.h":"bb6d62895a2824ae2c566a1bb9c3d866b2f4e4fa2186be4043d209f5944743b6","c/include/ICU4XPropertyValueNameToEnumMapper.h":"fe2ecc1e6816bd71738a82744957fd27fd6d8b91229a5c641c544172cc822996","c/include/ICU4XRegionDisplayNames.h":"fece0a7fe6227f47132200bfcd37ebb90fb5cfde2af4e2385f01aba2713c4cca","c/include/ICU4XReorderedIndexMap.h":"ba81910d14a97545a2d2514a6fa7c003585a52a51fb08edc54d8d2b2df08c741","c/include/ICU4XScriptExtensionsSet.h":"8d170c1ac68202b6714f8a181d9a2026a34d1ba2947d3c75c0d0fb3d4b531fb2","c/include/ICU4XScriptWithExtensions.h":"58f24862866b02a818ccb8869802364d89799cf65359ad92ba9a8796ba5c82fc","c/include/ICU4XScriptWithExtensionsBorrowed.h":"56995aeb93fbda6b12a7222effb465a31a9d2e0d64a9d45207fc7b43156f9b87","c/include/ICU4XSegmenterWordType.h":"c56bb9194ad922268b5ce5acb9793f18d61afc0d80cc20ed10ef255117091eba","c/include/ICU4XSentenceBreakIteratorLatin1.h":"76e4c306ea7e28d5df48e9a0e66a0fa21b62e43d1716cd515aaf190dbd01fc70","c/include/ICU4XSentenceBreakIteratorUtf16.h":"90286cc87e2ce166dda09ec8ecaf69403432a2fb0d31c86f425fffbfe15f5814","c/include/ICU4XSentenceBreakIteratorUtf8.h":"4d28f1f34829adbdf398cc08628966086de864d3147a0476693860d682398bd1","c/include/ICU4XSentenceSegmenter.h":"087908c9867c63e7ad934a7db4c0ae260dcc87f3f6ab950ff5a608c733a368a8","c/include/ICU4XTime.h":"0195a178069eb12e4b86853ca41fba24b115a24358f5320631f2bee0410f349e","c/include/ICU4XTimeFormatter.h":"a0f7ab82243fcd1d930e1af7673a982c8403fdfea4cef8fa219b693908b58c44","c/include/ICU4XTimeLength.h":"e1e9d2cde0a36b43d8caef5291e3fc3d41d72ed798eeeb599ab734768df68105","c/include/ICU4XTimeZoneFormatter.h":"f3ffe8f4b44d144c150318b93f020437b7fb83ec7ef9bcac33b03e2e71e2daf1","c/include/ICU4XTransformResult.h":"dbf8cde4f204381c530e60c387ea01eb6a73b3d67a963dea32a9875f027c5f2a","c/include/ICU4XUnicodeSetData.h":"3aedbed12b9ce6a746d1f9b85cbb663db9587bb71238653a616521d2b1fda2ba","c/include/ICU4XWeekCalculator.h":"7560f941ad512bf045f67f3674c8a3756eed62616dbda956570f2eb8ed70baa7","c/include/ICU4XWeekOf.h":"ef291c354d39c66adf434f31fcf1d9b0d7a03c37fc8a8097f398c39372f05aea","c/include/ICU4XWeekRelativeUnit.h":"a1e54b138571b2aa6e20ba938e69c39555719154b9fa74ebb7f03c09a4b3828e","c/include/ICU4XWordBreakIteratorLatin1.h":"3c3e35b91880e86849ece754d4d4fea2b17e90b8ebad4168ba6e570129caf52d","c/include/ICU4XWordBreakIteratorUtf16.h":"76c18f9020d59df7618ec62dcd0ed949773c4bb174054edd7221e3ae4af55d0d","c/include/ICU4XWordBreakIteratorUtf8.h":"bbc05ad9673c69f806be7f161ab0624242b5d0ba01e8e647eb722090b7e0e889","c/include/ICU4XWordSegmenter.h":"48969a7681b120bd12deb3810c0bec4e278cf73241c6c622a1ba62360e4c78c7","c/include/ICU4XZonedDateTimeFormatter.h":"8729fb75529af74d089f4ba464d2db17cb01dd8e4905aef018340d2d6e5b5cf4","c/include/diplomat_result_ICU4XAnyCalendarKind_void.h":"b7554e62e43d2829413955894fc2cf46f6fdd2f08cc22602267fd8720e28acf4","c/include/diplomat_result_ICU4XPluralCategory_void.h":"be4f24d6a8448c7358cb7929c1fe95d0c81bdab4d6c2f9597fb31318c6ac178a","c/include/diplomat_result_ICU4XWeekOf_ICU4XError.h":"6da99185bd3b0007580e8ca95475ac6a03ab108c1e4859abb9c6fa4f4268f189","c/include/diplomat_result_bool_ICU4XError.h":"d89d4b9ff8dbda4b70ea59b1735eb6fed987446d854c4ec5825ca3a96139c769","c/include/diplomat_result_box_ICU4XBidi_ICU4XError.h":"3d5e49b5efdb3fe613a90b25f242faffe361c2406c6bdfe9aa7f7374303e389f","c/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h":"b1093f46d43172b0367a5c0e2888c51d75cf09e9b74a6d4ac9f8494659cc23f0","c/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h":"044822a551a4621aaecf0973ec8c247ee08e6b1558985baea7b593554661461b","c/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h":"2fe231fed603754eb654ccd0cf1514755bf4575762b7ea55a9fa1cdaa8a0ef97","c/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h":"6fff2f082e8d041fe9b8d222bad577ab340793de1f532d1ca94deaf67a1a7f79","c/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h":"f4128b4152ff66339f054902c1e053898d412dccce46e4f2b8bd391da13ea8a5","c/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h":"8ba3f332ab68f208844590b58983c11e198bf31b3e40a96db3cad00ef2fccfc4","c/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h":"f3022441f2cc26e69cfcdb1e479207def3d3995e12a93671adc4d5b2c4c00bd7","c/include/diplomat_result_box_ICU4XCollator_ICU4XError.h":"f98f23497388805eef199cd493921353c8198032a7f1602ba21a8e5b9aeb50ca","c/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h":"207bf6e3194f0c26209f1d399c94dfc7002d09498fa3b683a63221e54376b2af","c/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h":"e3bd5c643d87a96cc2e22c54763743fc034831166cfe4e0996e19987679ec97d","c/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h":"e55c3014a4f7e3c65b4749a881dc613e8931a96ba8e9772afd64b29fbcd222ef","c/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h":"122a632de08b8ed4a13c678b97adb0ca2d93682a4ae23d6ee530e2d1c0cd6a40","c/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h":"c99bc3e292e71a5afa819fbfbb657c61776235a2372557a4f3c2f2611ef0bfdc","c/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h":"72831cc9f547c1da597eb8e26844627102754a767f17d48da05b67b3aed6da4d","c/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h":"64c9f51cc38897871f44ff3bbfccdc09cb2219aa73129624df907c64bfc0b246","c/include/diplomat_result_box_ICU4XDate_ICU4XError.h":"e63883c8bdca729b9b54540afe8c520363230eb85d51922a289427f8d2989e6e","c/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h":"cdc24b34a7b3220f74fe7ba159404945be2ace03f5204ae4e5359da4e22eba42","c/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h":"c24bbe0cf8763492dc660bd7e439c2e40f0b3fa5311e73237174c43462023580","c/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h":"0706eeb65200fd9475b3da7f46d57f43bc115851670a17658f277d8cca39519d","c/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h":"314a668723cd9b6d9939b1b1a5008e764ee8f31c2f755b4383888581339f7705","c/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h":"e31c88dcaf07b2dec8b9a1ac90de644cb3c88d26bcd5342fa9e5e3d4b66fe909","c/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h":"9e20178cfe4a63a5e5af84c468c6cec4b3d88cc8ec8f8aa8a7aae5b0cc6a3cc3","c/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h":"4a30e2b94172ae78bb10626f6edee04cdfbb18fefcb584831a5f2afc21061c2c","c/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h":"f5cf70a90def9156d8e2a711a1d766c1b74aa30574adf321bfa98e52a3a508f8","c/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h":"b536e34f20ce877f7b7cc096742d4ced3a111da455be857f762332f4bb88b8a6","c/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h":"d82cb4aa37b6aa3bca008aef27e4cc5a443a6393d4557fc8e4d3cf1f7d27374f","c/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h":"1c268f748fb0fabc4bee3bf2dff6be1397455d701aec641cca49147223ae0d1f","c/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h":"43cbd479e2b6dec150cc040f27e8322509e6dd33f87dbd0be970b478520fc3dd","c/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h":"37da5709ea21bcdebba934627a24f696a716509d1fa743336385cda259ae165b","c/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h":"0dc0a8de105ed8b047d875a88e21d53a23fda879893e85b523e77fe3b91b576c","c/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h":"818396c7da0fa28981abc5486906eefe8fca44f45d1455e32525a1c4870c9850","c/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h":"03c9c7a6182bbbd5abf697e2900fb5f1bf35479359e2b9a6318e883e9c3a9f2f","c/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h":"76bc810c1f5cdce04bbced497a83ed18597864784cfcd1918470bcf16d7ee72f","c/include/diplomat_result_box_ICU4XLocale_ICU4XError.h":"325af7add47038ba4997fccec85f8c17ab746d75452873b57b9e49fe3fb926aa","c/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h":"11366824711543693cfc29e85ef6506dcf1b126d6479f7cf4516e1b08309cfcf","c/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h":"37b5b35f3ee46ca40ef6081e78cfcc827c40ece420c56fa9f1ef3caace0ddfd1","c/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h":"00ffa08f94e61e0df7ed1471f5a5f539eb167492b19e2d9bd6bd3fb7bf7c6090","c/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h":"27375665f96cb573a703464e5213ebc1c9dee48dcac2ca362409445d28314b3e","c/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h":"a79303283606d3d9f0bfe8b8957ddc7e251f1ea8d71a0c2e023622543d0cc98f","c/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h":"9d2032bcad19a83584795296de438ea680c7b9452315034b9f3dc83406926d58","c/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h":"64f17863f06568a2a2493ec5c43eff09a6800898cdc1b0ee7927fc17e29055ce","c/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h":"c3428ab6414190e537638497972f666fcde75a09882d6233e94f2348213c59a8","c/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h":"8d93dbf810a3a6d8bde00608df728387a7fc92e3d59b66de8fc44f7383dc172e","c/include/diplomat_result_box_ICU4XTime_ICU4XError.h":"fd59b48cbeeea9f6c00ba4efd8003cef962603398371e4489ed3bf0696727757","c/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h":"7a75ff83facb7287597af360b9ff4c1fe7a71b750d40c9146a94c780481ae84a","c/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h":"92d217965ad6296835a9d69458d9f5fa6e9ca55114d64dcaf8dc4a7512df2c09","c/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h":"6662198d1464c95468270aec56563f0bcc17e75babd4316ff60b8587ce9766be","c/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h":"cb5a1ba7eeb206886266c2aa172486073084f8d9d271a52136205185f6376ac7","c/include/diplomat_result_int32_t_ICU4XError.h":"c9f9241d50cdffaebb1135ee78efe6bfa212743f71d59b0715ed0a79b05332ea","c/include/diplomat_result_uint16_t_void.h":"ad0d09f20115172cea2f459beb97a7df28a89708bb5a3a5372523d6eec42e37e","c/include/diplomat_result_void_ICU4XError.h":"bd03f10ee6b79c9498c2586ee94eef1f89d499cddb25d77b774ef066250bc632","c/include/diplomat_result_void_void.h":"f5f36a86bbf084e3eb2bf2a616efff7f612a208c2e747d5452b32d609eb450e0","c/include/diplomat_runtime.h":"1cea1a3675774fcb4253a58affeb7fad8e771af0b1077051b87bcc4b13ae309d","cpp/README.md":"f8becb1c485a7cdd870adc583f56e0511f642d884a330792eb15eb5939b60ef6","cpp/include/CodePointRangeIterator.h":"855f692f24f7a35c21d3f7f02bd7025c9e26836abf19f9eedb4c7acbebde7b0e","cpp/include/CodePointRangeIterator.hpp":"aeefc02597eca61d27e2848b78358b30c5ffcf462b1794976f255c0905282ca2","cpp/include/CodePointRangeIteratorResult.h":"24c9939e1dbb5475aaa463548eb9370dc8dda1d441b1fc7183aca4cb38e9c974","cpp/include/CodePointRangeIteratorResult.hpp":"948860d7de655ee92e5a15620437b2cb404b78a269308342d66badf83dd789ed","cpp/include/ICU4XAnyCalendarKind.h":"98fbcf1e114c8075bab271443108a0ff2eee01f4bba4bbcfe8222bdb5f616489","cpp/include/ICU4XAnyCalendarKind.hpp":"0345cab3b8c52e11773628104c4ed4ec581ca28e696f6de4a24ee27eb6030ace","cpp/include/ICU4XBidi.h":"8a4579f8215964b3172f48844ea09b12e849dda996b071d1819641f00b4906e3","cpp/include/ICU4XBidi.hpp":"990b63ef759c67ef7707e59ab14a9112cf0f8b41da5225388edebbe24dfe0255","cpp/include/ICU4XBidiDirection.h":"89a59db1407f4dd10898bd7e51a145a7cfe0633b83eeec45f0032d973d6264b2","cpp/include/ICU4XBidiDirection.hpp":"a2798336baad4eeefeb6d2178a5ed7bd83a0dba7e56d7bddab2b4ea373ceee9f","cpp/include/ICU4XBidiInfo.h":"0cc33c56c2d5404b83a09cd4a4707f9ed25945b49f6cfeb9c3aadfd2ee65cfd4","cpp/include/ICU4XBidiInfo.hpp":"d78a1aaaa4c8464672fb23eac1e6877117fed69ebfd45de57296f44178ed282c","cpp/include/ICU4XBidiParagraph.h":"bd149a4f5554e9200bcfc66f048c9cc4027575417bd9d5669d3c630b9a8284e4","cpp/include/ICU4XBidiParagraph.hpp":"d1b752526306b423c2f3a72ffb04a0c91a9a752c3f7c859ddb87ca3adcf247f8","cpp/include/ICU4XCalendar.h":"5a9106afbda3c239f63514979d885ae452cdcae6cc6026d3f8490d69aacd521b","cpp/include/ICU4XCalendar.hpp":"f58723713febe0ced0b8fb03e5242d03f5f92198a9bb49fed3390e4ddd94e9e0","cpp/include/ICU4XCanonicalCombiningClassMap.h":"92c5129ef2a7e9994f66cb94b43abf94f335d2e2a37ad5fac2cd999b85ac5456","cpp/include/ICU4XCanonicalCombiningClassMap.hpp":"498135391687de192cef4dc2f1315b7b0341d7e411e6f66acd9513ca559a7adf","cpp/include/ICU4XCanonicalComposition.h":"635cfc855017d7dfab446a39e5d8d835fc46b79a629508790c3037476bd8d9ba","cpp/include/ICU4XCanonicalComposition.hpp":"68a488f80a379f31c268a3c126f9a58412c1a8a8e0817d62cdb925d0e8610454","cpp/include/ICU4XCanonicalDecomposition.h":"1076939f1fe5b67d9798524b0d757b5b8bd291b112ff6f3f6365ad219a8e2f2b","cpp/include/ICU4XCanonicalDecomposition.hpp":"e6136c027a4c4c81e2a878a85f5f764dd75dc4a3778f9268207eced128c2ebd5","cpp/include/ICU4XCodePointMapData16.h":"57bd7f80f4cf901d2b7048b0e91d6fb95c0c0d30845f53026794f5b0adbc198e","cpp/include/ICU4XCodePointMapData16.hpp":"854e3278a354955feb4017906923c0b0d7ba19af05a77b63261b6de0398eb6de","cpp/include/ICU4XCodePointMapData8.h":"6e9b20e9028cb628f93ed9a9b8e8890f32e4c6bb91c2d0dfe2b32f63a83b974a","cpp/include/ICU4XCodePointMapData8.hpp":"42c0e3520591a0ecd16b34d3bd9cc585086112b3f31e2251ebd6590f0d508f52","cpp/include/ICU4XCodePointSetData.h":"7337436920bb0777892687a1f72249f6b1cd669a1a80d20a8096e5bdc590eb7e","cpp/include/ICU4XCodePointSetData.hpp":"3008e1d1522e7038ca00ab5e352bd48c466d8152294260df02d6eaf194f98aa7","cpp/include/ICU4XCollator.h":"8d4aa7b68d6266fd1b063381087d1a46571e4cb69316d931de13984a4be925d3","cpp/include/ICU4XCollator.hpp":"9373eab5286a3fe523bce8033f5a66dffaf5831fa118011d8253a8aa3d2fc8ed","cpp/include/ICU4XCollatorAlternateHandling.h":"ebd0f6409caaf133b8168447a3697c957c820c2fdb3df20511f2f2204b00b4c9","cpp/include/ICU4XCollatorAlternateHandling.hpp":"f324793e4acf74b5f18ce33bd8a736b1f2edd2cc0296ce9745df70fe4d640870","cpp/include/ICU4XCollatorBackwardSecondLevel.h":"0e5e2eb6dc28eeb00474dc8fae31986760fbcbeb89a161137798b16a7fbd1321","cpp/include/ICU4XCollatorBackwardSecondLevel.hpp":"7e4601fa0c633cbcefa66619d28f0a7b11300e095fe8c3d77f83a80a906fc70b","cpp/include/ICU4XCollatorCaseFirst.h":"554673ede038c701bb1901dd445ca7053166ff4acb287d0e176f2eaee11ea1f6","cpp/include/ICU4XCollatorCaseFirst.hpp":"ba808e98d766b2c5540759930362bd5a9439e1816183f20589c9d067d836191e","cpp/include/ICU4XCollatorCaseLevel.h":"136d4e3bfd658b4eaff32265b44a1655f12d279389ac2b6751dcb2796cb9fd4e","cpp/include/ICU4XCollatorCaseLevel.hpp":"3aa95154f2474b8727466041821861639583068808ff0d6a8f9fd29f21b42414","cpp/include/ICU4XCollatorMaxVariable.h":"a92d7ace800d74f69ea143768aef1c077e82100d7793c5c4f0e269127ac8d06e","cpp/include/ICU4XCollatorMaxVariable.hpp":"23ac90567b9781ad7c3cc241484ffe3f59107d213a390f1a3808e1449b583035","cpp/include/ICU4XCollatorNumeric.h":"47bf4863d1b84232c8eec2acc7fa8c15416a4ec5d0e271ae6937ca21662cbbf7","cpp/include/ICU4XCollatorNumeric.hpp":"2d81a2a423ccfc431fea2bf8d9c9f313f29609c3bb154a77d6a1433e3e6e05c3","cpp/include/ICU4XCollatorOptionsV1.h":"e5a839b8690b7a2a5fddbfb897928c3c533c9bee8a172d64f99b9bfbfac54991","cpp/include/ICU4XCollatorOptionsV1.hpp":"5e10e9d2d460e83028d53506ac5bab2febc1744df911e92537ceda0cba7600fe","cpp/include/ICU4XCollatorStrength.h":"9c01f423c788b5b68391487d8e773eff3b409d0f4c91c08b750ec46a90a9fef9","cpp/include/ICU4XCollatorStrength.hpp":"aaf8eca64c73a4096be030c35807bf4d4c8788ba97ac3b4edcc6e85bc1cc3bc4","cpp/include/ICU4XComposingNormalizer.h":"05f377de32c1a12a6460fba63033e23fbd418d737943f7452ff7b177ac433ad7","cpp/include/ICU4XComposingNormalizer.hpp":"db57d5257c91b1c2fd3cc2d95af8ece87abae793db55f238c45e1c71eeed1647","cpp/include/ICU4XCustomTimeZone.h":"6ac971546dc119416caab463a57688126649f599c6a95a54bf8ff7d6c87dd3bc","cpp/include/ICU4XCustomTimeZone.hpp":"e8557cd0ebdd153cbfbcaa2fab9fef29766ad0684d537250f8f2e163ae1224e4","cpp/include/ICU4XDataProvider.h":"ce5c502cb1b0beeaac051c460fe212ca6f7ca10093f71cdce167d3b99e2f5d81","cpp/include/ICU4XDataProvider.hpp":"f15437414f2d41da572093acdace04f2cb9a4f8315ad0beb75c536b880439fa4","cpp/include/ICU4XDataStruct.h":"d9214515d58f8b3aadfbb1fb4f5ba030b2f00b9b250cf953e50e9ef4e4158437","cpp/include/ICU4XDataStruct.hpp":"590c53801274d961125d278954894e2ab78a95d87fac960d5516f6218f5c0c18","cpp/include/ICU4XDate.h":"3a2974b05110af1eed01249a7a6c0c8b5f891adb16f05ff8253d6fd70be4c17f","cpp/include/ICU4XDate.hpp":"b065fb015d2614e8eacc5335a7f2d6c93fa37440d7c8eafb18d95539a2f10e8c","cpp/include/ICU4XDateFormatter.h":"9b68b9c96457bb3a58fc41a992a815a216d9dc690ebc7e1123f283580cb3f569","cpp/include/ICU4XDateFormatter.hpp":"1b380267c6d71a96414b4bbd02f022ce3a8dd457a92b39f67611c24f98cec919","cpp/include/ICU4XDateLength.h":"99a2dc6ff1a34a84800cda21dc69a81ccec348cda6082970eef8feeb9ea8c051","cpp/include/ICU4XDateLength.hpp":"618b6d1c185d5ddb6b73d6201478ee5286ed33726f858b2528749f061e9a9769","cpp/include/ICU4XDateTime.h":"3f04cc39abc5477b145a546488513fe2235f7dbab482f0aa09dc9c1904b7fbca","cpp/include/ICU4XDateTime.hpp":"d39a2c8830bd1c91bdae10cf4b9ef60e5cce270396e6a949b228ab8b79a148b5","cpp/include/ICU4XDateTimeFormatter.h":"27b315cdd9213ddddef012c001d5d2956f9441ff3c078ab5bd438b02a6ffc4e7","cpp/include/ICU4XDateTimeFormatter.hpp":"23260d8476029a82d98d07bf0b0c19066f2d335a5147a30988e713209e516860","cpp/include/ICU4XDecomposed.h":"005a75fcf7fbcca73b674740e6319509c62b70b1337423fd024e28735f6a5c78","cpp/include/ICU4XDecomposed.hpp":"4ec09d0a6fc60412a3f2ea5d11c1f5e46914625db332d0221ef8a7d9488460d2","cpp/include/ICU4XDecomposingNormalizer.h":"3ba38d2ab181d2d319a7efe7b03e78651d679621cd4cfd0e44e276617999fe24","cpp/include/ICU4XDecomposingNormalizer.hpp":"c6bcfda10c5e9f22c3cb4900bd1d5d19a266178bfcf14ec1a04ad18a883fef54","cpp/include/ICU4XDisplayNamesFallback.h":"7d7f8b545fcad7c5dcb1ace2a30aac8014dbf4b4b2f256956e724cf94e6c2677","cpp/include/ICU4XDisplayNamesFallback.hpp":"8eb30a0572cd9c6ec2cdbf882ca63db31e78939bb74f06d240adc2a1463caa29","cpp/include/ICU4XDisplayNamesOptionsV1.h":"182689a09a7d7ee60704ab5ac7b62f774948c3fdd9b25e67c6e8ce3b46dec971","cpp/include/ICU4XDisplayNamesOptionsV1.hpp":"a2ab21d2b5d47fe1f29a5404bdf4ebacfecd66df113c1dd65558986ccae1a54a","cpp/include/ICU4XDisplayNamesStyle.h":"1bc8b6c69691c237e802fb4379904fb5fcdd5abfb2bdc3e68b3ca0a205d1080a","cpp/include/ICU4XDisplayNamesStyle.hpp":"465d0c920fbca53761685191215f8bc42059dd80771fc186c70a2f5cb3a737c4","cpp/include/ICU4XError.h":"03ebddcc05bbc59289120acad0229802d8f5d6afd6b1889c1415e625a193b9a9","cpp/include/ICU4XError.hpp":"55adbf441f229d098141e10fa63c23d0fdb9fdb767b2d343ea527ccf6e499194","cpp/include/ICU4XFixedDecimal.h":"e8faf4b7ced8c8d277c0dae8bfd3706d53d1231f329913731b969696fdafb5e9","cpp/include/ICU4XFixedDecimal.hpp":"cae1765dd2ae3e7d1f680410ad39e13c3fb13716a349b958b25db06eb5104313","cpp/include/ICU4XFixedDecimalFormatter.h":"1271f7f8bf20feec7e5861d6a985339c5bf6da4e81f1099c799546c54e09a94f","cpp/include/ICU4XFixedDecimalFormatter.hpp":"af3e74f7e320ead985327b314ca47518dfcba303b5c20ecdb839d0b7885f8bf7","cpp/include/ICU4XFixedDecimalGroupingStrategy.h":"6a3bfa97e9d53d02730909a0a23d468663e0466fb13312b02da3625eb4ac6980","cpp/include/ICU4XFixedDecimalGroupingStrategy.hpp":"b8fbb86fc7c18f45043907b527d1e996e8cee5d342bf250193f7127c942c5168","cpp/include/ICU4XFixedDecimalSign.h":"5bdc531f7961d47cc8130427a80c3e40b6bd11678fecf71f779ec217a70ad3be","cpp/include/ICU4XFixedDecimalSign.hpp":"fcc18aaa54f457ca9e724e56ada12f7e4ed85391016aaa8bae5e73f5217b06b4","cpp/include/ICU4XFixedDecimalSignDisplay.h":"412d93364396b0d1e987d6f997871084163103360bb0a474d2ea8889b9a51db3","cpp/include/ICU4XFixedDecimalSignDisplay.hpp":"873f72122de0c261096272963a2f985773a2431a4dd887a80a777c4e1f9c148f","cpp/include/ICU4XGeneralCategoryNameToMaskMapper.h":"53ce5570633c42454da873f08e7de33ccee0e7e120adcc682b2d9ffeac65046d","cpp/include/ICU4XGeneralCategoryNameToMaskMapper.hpp":"48da40a7e007d0f272fb83bfedaa3f9a6cff0446e94690aed1af43b78b719137","cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.h":"e516f5f3e7916a2a2f101b4790e0fad5c2d0d3f534b512016e260e7bc1a96828","cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.hpp":"7bb4b698563e4b6bf591609ae2ea03c49ce13cfe79f9550ff70717bdf24a6be9","cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.h":"8318a9183ebe63cb91f63535b658a035e08724464efc5523643f54f9eb3c33cf","cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.hpp":"04ea34383760a33a46c3bada8832bca788f056b0ec3fa80e3b14500fb80444b6","cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.h":"62bde7543b4505cb7ca78fb3586770945a368a17ddb6f759679537864590d4a3","cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.hpp":"227f18ddbca6eea16773b1501565a708aa389cc7cedead7d29a54796d5bcf696","cpp/include/ICU4XGraphemeClusterSegmenter.h":"623fe0deb02155a66363a301eabdd71d0e8565c991e43c0a0b269345dfc4edd5","cpp/include/ICU4XGraphemeClusterSegmenter.hpp":"b577ab314bb56123351c61f09229e7cbd515a380cc1841ce8fcd9648054472f5","cpp/include/ICU4XGregorianDateFormatter.h":"b16d94873ab46783e3ca040ae1f3335c008caa7eb83267ddd2decfb11de8173b","cpp/include/ICU4XGregorianDateFormatter.hpp":"3766501ab72d5d8a15f6fc3b7e71771a70fa45b68332513745c240256ae02fef","cpp/include/ICU4XGregorianDateTimeFormatter.h":"895afb0c42900402535b73d7a92c348000e24ade6b333e6a8d0c99f46a3c306f","cpp/include/ICU4XGregorianDateTimeFormatter.hpp":"e11865d553f84b6434609498cd3efb2a834a629066d9485ee6c3be266956603d","cpp/include/ICU4XGregorianZonedDateTimeFormatter.h":"a8d6fac5c2514ca88334bd273ad96160c74582aa416f9c7e13a7969425cd0d95","cpp/include/ICU4XGregorianZonedDateTimeFormatter.hpp":"fff493a0810169834c40a666d7d33acc5f8c8a31f7e401947fbf1b3196881cf9","cpp/include/ICU4XIsoDate.h":"199c271f59c6d0f6cd199466ba96b8a954b1a8a83a696fa180ab2f3ad085b405","cpp/include/ICU4XIsoDate.hpp":"1d51c0e5e8bbc477557e4fe6a971f6d97e79a141e7d2b76bcf5d0a468941db1e","cpp/include/ICU4XIsoDateTime.h":"cf93f6ec4ba94142c471e453ac78f63620d71a6eb971a674c015572765208e7b","cpp/include/ICU4XIsoDateTime.hpp":"8595c210a3b8afdfd0b383a7bbf0aff8a99e8320a67819751d496ed0808920ff","cpp/include/ICU4XIsoTimeZoneFormat.h":"7f99a45d84ab1292fe3ef50b0030b27442cec24172afb04674f6dd861cfa410b","cpp/include/ICU4XIsoTimeZoneFormat.hpp":"c7d3cff3cb93f1c6865ad18973f01722616f27b338ffc8ca55d7ead35c5fc587","cpp/include/ICU4XIsoTimeZoneMinuteDisplay.h":"e8acbc9cc0d191e38e271b5d4da97688047937aadc98dc241a4e66839d7c1315","cpp/include/ICU4XIsoTimeZoneMinuteDisplay.hpp":"bf8ae21b6853039315520b67b81ec70896512851d77a5f4a30436fb3b0cb1ff8","cpp/include/ICU4XIsoTimeZoneOptions.h":"a23d3a3aea566b9e0bb28945a7da11862e59462c37aae925a8b06f6b3c53e181","cpp/include/ICU4XIsoTimeZoneOptions.hpp":"6ec0dcfef0f2f6bc66a2eab5d696b4b0133f2b316fce4d231d4a987f3b6c7e1d","cpp/include/ICU4XIsoTimeZoneSecondDisplay.h":"f1e23eac627f2bd85a59db7b700a374714119b855e5adcdfa27ca3ef19c02d0d","cpp/include/ICU4XIsoTimeZoneSecondDisplay.hpp":"42af9f01ba7caa56e8e381d57c3f7789d44e596f6df1a346508eaede5bd204a9","cpp/include/ICU4XIsoWeekday.h":"a145439e1c3918a4e7ff0b03b39c2c8b1a2c7e035b4a9eb44b15f62c2b5b084d","cpp/include/ICU4XIsoWeekday.hpp":"3bd1f9001004c3609349046b07347ed178b534d6f87f45f2e69c25d7e8b843d6","cpp/include/ICU4XLanguageDisplay.h":"53090fe4bd1ec74367afbc9fb7580203690ce53ca99f58905da365693c446951","cpp/include/ICU4XLanguageDisplay.hpp":"b7878b46171828cde4fc75eb7a6fce911ecc5b7aecfa36fb813a73bb8b24fc00","cpp/include/ICU4XLineBreakIteratorLatin1.h":"bb1851ad2560aaa88c819b06542693186ba991dc8a5fc26936781e00ed215fa6","cpp/include/ICU4XLineBreakIteratorLatin1.hpp":"fa563128300d5aea168d1c8187367e9c17dc878b4d7dbe9b27591d50fe83f07f","cpp/include/ICU4XLineBreakIteratorUtf16.h":"61d5f40b5ddfed50a4414dafeb75aab49384309375a5bb8c1db21987eb95ffa6","cpp/include/ICU4XLineBreakIteratorUtf16.hpp":"73c347094bea6a1680945b6683544a13f2504da288f2b783857814d3a9066cd6","cpp/include/ICU4XLineBreakIteratorUtf8.h":"453e6711f0345128bb982838ed40bd67a141265a21b0cd2218310d8bc93dd014","cpp/include/ICU4XLineBreakIteratorUtf8.hpp":"077bf5b2696467e5b718430364d416b331a50d8275321d67cfd7fe5c4e759ca2","cpp/include/ICU4XLineBreakOptionsV1.h":"230517bf5ccee15032ec091dc18074ca4714242a7ffd81983ab3d872d0e46245","cpp/include/ICU4XLineBreakOptionsV1.hpp":"4d9c26453bb1cf9f5c4b01c825061f6d49012f22aa0fe2a659fd85ee6aff4a36","cpp/include/ICU4XLineBreakStrictness.h":"0906420e594bc72ff88957b4b9f85966cd5d72a99bea8b9f29c593d0d421ebb6","cpp/include/ICU4XLineBreakStrictness.hpp":"161d6ce8be738710272a8c09be8a347ffc0fa822c77f3299b12e99d4a500527d","cpp/include/ICU4XLineBreakWordOption.h":"812e0beb839fc77869f0e82144d5f28323f74e54217aa2a684e026d54cb3bcf6","cpp/include/ICU4XLineBreakWordOption.hpp":"b042c9a409b241014c29c6528b1b27c993a22d5ab6475efd32cf2b467e707259","cpp/include/ICU4XLineSegmenter.h":"1b8b32fbca641d11d7c29180fd37882ae84e6019574d88d5726f27d8d732ca46","cpp/include/ICU4XLineSegmenter.hpp":"7098dd82c3777c574514c126c9552916227e2a5c69628640aeba0abf516a42ec","cpp/include/ICU4XList.h":"61aa297726f8320e2db5dc82fbcaf9655606e69c1b576c4609ed7cc00a4761fe","cpp/include/ICU4XList.hpp":"45b79c77f5597b8edffbb813eaac6ea4ca240abed997973d7d4b952018eb4671","cpp/include/ICU4XListFormatter.h":"e7a4c0960e21dd7c927f2446e68f899f6fa1ffbd3fb62f16275e3549b3b7df95","cpp/include/ICU4XListFormatter.hpp":"bceea10dc8c1fc35fd75fe92272a68fe2f8f1dd997dcf859a83d65d692a4a817","cpp/include/ICU4XListLength.h":"d5614e3beeb177aa994be08e2d2aedb60eb70029d85bf3a6c6e146fcd81585da","cpp/include/ICU4XListLength.hpp":"8e062284ab2efff53a34aacedad5845fcccb569ce5aa37f8617f45bcbf8d3bbf","cpp/include/ICU4XLocale.h":"4c8a4eee422925ea9a5b358ea2d2e0ceafb3bc7506a3e08bfc0abe6c583d28b1","cpp/include/ICU4XLocale.hpp":"e4b7e2d0a5c3638d4793eed39aae52e9ca63e5b727d2baa31fd269c5425504de","cpp/include/ICU4XLocaleCanonicalizer.h":"729fc0b406f32508ca271f342e8e0a04d5a9ad236b9cf29afe8ef3dc0e55956d","cpp/include/ICU4XLocaleCanonicalizer.hpp":"b994be60de6a074574bebe7a38f741109a5a6d2ba21aca7a60c3966eb7a892c9","cpp/include/ICU4XLocaleDisplayNamesFormatter.h":"6b2627ea0c51382fa9c17986d419fced926af9765ccc4a50cbee186a18bb4e8c","cpp/include/ICU4XLocaleDisplayNamesFormatter.hpp":"c8965c77b3137d111df4cca07afb7ab4441ff63461ad533eae1e5de3ecd9c27e","cpp/include/ICU4XLocaleExpander.h":"acc58a303fc99ff1aee637985887b2694bf3744963f19fad790af7cd3d1d4b5b","cpp/include/ICU4XLocaleExpander.hpp":"3369e762d696696a3628db46bc3c2f12632792b22b8a4485888fafbe76953296","cpp/include/ICU4XLocaleFallbackConfig.h":"fb5037e7dcff96d6fddbcfe82ed86792865623e3ee83a27a7f57b282b317a49b","cpp/include/ICU4XLocaleFallbackConfig.hpp":"80496635ffa9415f931cd3871ab1a4094c5b01e258965a37822f65952e59faf7","cpp/include/ICU4XLocaleFallbackIterator.h":"6509d75408b7a6d430f4caa3468148d0a06c4ff4490728205692db5d9c2e556e","cpp/include/ICU4XLocaleFallbackIterator.hpp":"52daf604389451ebce0499552e180f1d6b30f762858e550c3a508b7c1bfbc091","cpp/include/ICU4XLocaleFallbackPriority.h":"aa69b2108b5fefcd0325b7263f1db8473b17ab8d5fad74e641eb8ee2bfd4b54c","cpp/include/ICU4XLocaleFallbackPriority.hpp":"3de5a7fb6a8a3ef3265e269c27c1b38c75b1a0b3515b7b459c0193f20def5af4","cpp/include/ICU4XLocaleFallbacker.h":"965da30fd0e5280c086a104fccd117a63450f30efa49b9198037cd95d6b22bcd","cpp/include/ICU4XLocaleFallbacker.hpp":"e31fb699b3c0352ce8235a566b69c89834f53cb257c17a89fccca36e2e651ce3","cpp/include/ICU4XLocaleFallbackerWithConfig.h":"8144d2a7fbd88ce8e0dfca4522d4a00e0850332f53b3b47751687a2ed772749f","cpp/include/ICU4XLocaleFallbackerWithConfig.hpp":"486a23b16de67b587b86b49f772e57e009acc268e6af16c987a0a5dda415916c","cpp/include/ICU4XLogger.h":"9a5442ab6151781529d6168d452ff12b2a82f1ce60905d7cf1b165a22c1b8b87","cpp/include/ICU4XLogger.hpp":"5afeeb0c30304e3b3d9b31b3b774832129f3414e466aadee043dca560dc628ab","cpp/include/ICU4XMetazoneCalculator.h":"f67642f2699df48e660034834c60620efddf28b5313daf6a4caeb49231e72600","cpp/include/ICU4XMetazoneCalculator.hpp":"1c2325c5d9c0b9d39063c7ef91e023299065be9c506b7cf0b3b5905a7ffc4738","cpp/include/ICU4XOrdering.h":"2623e442030eeaad06e60a85813fd38690f934a615cf7d1d34dc7ce3f687c737","cpp/include/ICU4XOrdering.hpp":"86811686ddaf5da7d0329a40c22fb7bd3b24b5a7f69806c105f20ed19b8c00c3","cpp/include/ICU4XPluralCategories.h":"4b976338eb417be4d785654d9edcd7f6557e5ce8426e03b37d8a59349eba2aa5","cpp/include/ICU4XPluralCategories.hpp":"007f36b82e22f1e7de269ed193f7b75b270621e45a2b35846154e6e4ac957d13","cpp/include/ICU4XPluralCategory.h":"7f5e82bd8a601c3fd69c9a8ef462e01fedd26a3713a227b9daddc4360e49b0e8","cpp/include/ICU4XPluralCategory.hpp":"5d0e1861814fa4ca2c09727ec84e6e84803242758b7daf6b90835ff45619f352","cpp/include/ICU4XPluralOperands.h":"c67fb8047061802a466f0655d9613e88c24c5773865f905e9784b66ef61b5e28","cpp/include/ICU4XPluralOperands.hpp":"1de31d5b684d95a3b0602cefcb1d097887f055dd8f5761b14ab99b2b15c5df58","cpp/include/ICU4XPluralRules.h":"bb6d62895a2824ae2c566a1bb9c3d866b2f4e4fa2186be4043d209f5944743b6","cpp/include/ICU4XPluralRules.hpp":"6f8ee9f09a0af7dd6b396703f4f73a678bee04bda01efce45cb095ca248fe699","cpp/include/ICU4XPropertyValueNameToEnumMapper.h":"fe2ecc1e6816bd71738a82744957fd27fd6d8b91229a5c641c544172cc822996","cpp/include/ICU4XPropertyValueNameToEnumMapper.hpp":"80d40acfc044b2a7fcf100b9ab1898a09bb29c4b4e4d64b49daa0d7e0a3ddd57","cpp/include/ICU4XRegionDisplayNames.h":"fece0a7fe6227f47132200bfcd37ebb90fb5cfde2af4e2385f01aba2713c4cca","cpp/include/ICU4XRegionDisplayNames.hpp":"7cc4b8ec4a1157cd36b2fe0a03ed5fd2dcb95856a47441e11915071ced14969e","cpp/include/ICU4XReorderedIndexMap.h":"ba81910d14a97545a2d2514a6fa7c003585a52a51fb08edc54d8d2b2df08c741","cpp/include/ICU4XReorderedIndexMap.hpp":"0161d74cde2c0119ae6f602253ca713e2e990a895ed85f7e31bd9ba15bf5359e","cpp/include/ICU4XScriptExtensionsSet.h":"8d170c1ac68202b6714f8a181d9a2026a34d1ba2947d3c75c0d0fb3d4b531fb2","cpp/include/ICU4XScriptExtensionsSet.hpp":"ff058b84470a116d16325ae15805173e0ef20854116101725cd61d5768145da6","cpp/include/ICU4XScriptWithExtensions.h":"58f24862866b02a818ccb8869802364d89799cf65359ad92ba9a8796ba5c82fc","cpp/include/ICU4XScriptWithExtensions.hpp":"6baa886aa88123e52a6fbdb3c857a15e66727af526d88c2f8f192d3c352b3b6a","cpp/include/ICU4XScriptWithExtensionsBorrowed.h":"56995aeb93fbda6b12a7222effb465a31a9d2e0d64a9d45207fc7b43156f9b87","cpp/include/ICU4XScriptWithExtensionsBorrowed.hpp":"1fe52a0f0960c2bdcf726cc08f70372c6f8bbc0cc6900bff8583a697a3841349","cpp/include/ICU4XSegmenterWordType.h":"c56bb9194ad922268b5ce5acb9793f18d61afc0d80cc20ed10ef255117091eba","cpp/include/ICU4XSegmenterWordType.hpp":"e59484de3a51a97634dfb80388bb4cb926e4cc6098ba9765341fbf4f2af6258f","cpp/include/ICU4XSentenceBreakIteratorLatin1.h":"76e4c306ea7e28d5df48e9a0e66a0fa21b62e43d1716cd515aaf190dbd01fc70","cpp/include/ICU4XSentenceBreakIteratorLatin1.hpp":"a7b281ec1a67e6285db900a108ea7757a24a50ecd17849ea476b35b369ff8db4","cpp/include/ICU4XSentenceBreakIteratorUtf16.h":"90286cc87e2ce166dda09ec8ecaf69403432a2fb0d31c86f425fffbfe15f5814","cpp/include/ICU4XSentenceBreakIteratorUtf16.hpp":"a3bd82ba16263006290e1d7eb51871213fc7d235bd52fd2dd1b7675dfb652434","cpp/include/ICU4XSentenceBreakIteratorUtf8.h":"4d28f1f34829adbdf398cc08628966086de864d3147a0476693860d682398bd1","cpp/include/ICU4XSentenceBreakIteratorUtf8.hpp":"4ffe846e616e67f87841b7e9e84a074995cc01c71f83bb0c3a9594a7f60cf111","cpp/include/ICU4XSentenceSegmenter.h":"087908c9867c63e7ad934a7db4c0ae260dcc87f3f6ab950ff5a608c733a368a8","cpp/include/ICU4XSentenceSegmenter.hpp":"3707a46f5699e8300be991f5b1cf4e276b533b4ebf563b5ef1703a14e47bb193","cpp/include/ICU4XTime.h":"0195a178069eb12e4b86853ca41fba24b115a24358f5320631f2bee0410f349e","cpp/include/ICU4XTime.hpp":"759f203ceefadde8969820bad3f70392b9a035d3eea3d74cbf1f661e53035e19","cpp/include/ICU4XTimeFormatter.h":"a0f7ab82243fcd1d930e1af7673a982c8403fdfea4cef8fa219b693908b58c44","cpp/include/ICU4XTimeFormatter.hpp":"f4d94c9e8017a67e54c2980c64fa99a2d29791421d052da35c33bb4caae71d68","cpp/include/ICU4XTimeLength.h":"e1e9d2cde0a36b43d8caef5291e3fc3d41d72ed798eeeb599ab734768df68105","cpp/include/ICU4XTimeLength.hpp":"b8522f485ba1fab96f4d8796731fde44714628efe7182a7d25f503fffce05a54","cpp/include/ICU4XTimeZoneFormatter.h":"f3ffe8f4b44d144c150318b93f020437b7fb83ec7ef9bcac33b03e2e71e2daf1","cpp/include/ICU4XTimeZoneFormatter.hpp":"aa8443019ae7baabcbd3f7f18b222ec1223d1d90aa483cebc8ce23d34597e8e9","cpp/include/ICU4XTransformResult.h":"dbf8cde4f204381c530e60c387ea01eb6a73b3d67a963dea32a9875f027c5f2a","cpp/include/ICU4XTransformResult.hpp":"f566567e771bad16396c0f573a5b7837c12c3d496578cc359bc6cd11a808a394","cpp/include/ICU4XUnicodeSetData.h":"3aedbed12b9ce6a746d1f9b85cbb663db9587bb71238653a616521d2b1fda2ba","cpp/include/ICU4XUnicodeSetData.hpp":"a1456b8a976b9ea30184181160fb18db65e4ae726aff0beffbf2ab8492492a45","cpp/include/ICU4XWeekCalculator.h":"7560f941ad512bf045f67f3674c8a3756eed62616dbda956570f2eb8ed70baa7","cpp/include/ICU4XWeekCalculator.hpp":"98f9534296279dbb079cf7a2640e4610f067d6411f6fe55ff5dc002c94394c6e","cpp/include/ICU4XWeekOf.h":"ef291c354d39c66adf434f31fcf1d9b0d7a03c37fc8a8097f398c39372f05aea","cpp/include/ICU4XWeekOf.hpp":"a9b3a178649aa8ad0433dacaa24c532c022425387d9220a830d62ce0e6635c9b","cpp/include/ICU4XWeekRelativeUnit.h":"a1e54b138571b2aa6e20ba938e69c39555719154b9fa74ebb7f03c09a4b3828e","cpp/include/ICU4XWeekRelativeUnit.hpp":"81f4c0749743a386d56470925c1d1f8cb6b76a0277ec18a9f678fca9fc1738bb","cpp/include/ICU4XWordBreakIteratorLatin1.h":"3c3e35b91880e86849ece754d4d4fea2b17e90b8ebad4168ba6e570129caf52d","cpp/include/ICU4XWordBreakIteratorLatin1.hpp":"1f433e085849e4d77c24c01b58e97c7ba48cddca97fcced95060d2548607f653","cpp/include/ICU4XWordBreakIteratorUtf16.h":"76c18f9020d59df7618ec62dcd0ed949773c4bb174054edd7221e3ae4af55d0d","cpp/include/ICU4XWordBreakIteratorUtf16.hpp":"e8dba884122fdcda08e8320df1b20a2b4504bc91fd8704721d973d903f1bdfcd","cpp/include/ICU4XWordBreakIteratorUtf8.h":"bbc05ad9673c69f806be7f161ab0624242b5d0ba01e8e647eb722090b7e0e889","cpp/include/ICU4XWordBreakIteratorUtf8.hpp":"1defe077c3ca1f9a1c99c36f69b8f5052a7e10fac3eabad9d51c2a29d595539c","cpp/include/ICU4XWordSegmenter.h":"48969a7681b120bd12deb3810c0bec4e278cf73241c6c622a1ba62360e4c78c7","cpp/include/ICU4XWordSegmenter.hpp":"f856f3143f7fca0edcd50f2fd315b74f2ccb80f18acb4e522496b173b7769ad1","cpp/include/ICU4XZonedDateTimeFormatter.h":"8729fb75529af74d089f4ba464d2db17cb01dd8e4905aef018340d2d6e5b5cf4","cpp/include/ICU4XZonedDateTimeFormatter.hpp":"ddf61c54fe3566c9262420e14efd131d3c78fc8fd752631a5ff66fa65abd3d91","cpp/include/diplomat_result_ICU4XAnyCalendarKind_void.h":"b7554e62e43d2829413955894fc2cf46f6fdd2f08cc22602267fd8720e28acf4","cpp/include/diplomat_result_ICU4XPluralCategory_void.h":"be4f24d6a8448c7358cb7929c1fe95d0c81bdab4d6c2f9597fb31318c6ac178a","cpp/include/diplomat_result_ICU4XWeekOf_ICU4XError.h":"6da99185bd3b0007580e8ca95475ac6a03ab108c1e4859abb9c6fa4f4268f189","cpp/include/diplomat_result_bool_ICU4XError.h":"d89d4b9ff8dbda4b70ea59b1735eb6fed987446d854c4ec5825ca3a96139c769","cpp/include/diplomat_result_box_ICU4XBidi_ICU4XError.h":"3d5e49b5efdb3fe613a90b25f242faffe361c2406c6bdfe9aa7f7374303e389f","cpp/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h":"b1093f46d43172b0367a5c0e2888c51d75cf09e9b74a6d4ac9f8494659cc23f0","cpp/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h":"044822a551a4621aaecf0973ec8c247ee08e6b1558985baea7b593554661461b","cpp/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h":"2fe231fed603754eb654ccd0cf1514755bf4575762b7ea55a9fa1cdaa8a0ef97","cpp/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h":"6fff2f082e8d041fe9b8d222bad577ab340793de1f532d1ca94deaf67a1a7f79","cpp/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h":"f4128b4152ff66339f054902c1e053898d412dccce46e4f2b8bd391da13ea8a5","cpp/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h":"8ba3f332ab68f208844590b58983c11e198bf31b3e40a96db3cad00ef2fccfc4","cpp/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h":"f3022441f2cc26e69cfcdb1e479207def3d3995e12a93671adc4d5b2c4c00bd7","cpp/include/diplomat_result_box_ICU4XCollator_ICU4XError.h":"f98f23497388805eef199cd493921353c8198032a7f1602ba21a8e5b9aeb50ca","cpp/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h":"207bf6e3194f0c26209f1d399c94dfc7002d09498fa3b683a63221e54376b2af","cpp/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h":"e3bd5c643d87a96cc2e22c54763743fc034831166cfe4e0996e19987679ec97d","cpp/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h":"e55c3014a4f7e3c65b4749a881dc613e8931a96ba8e9772afd64b29fbcd222ef","cpp/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h":"122a632de08b8ed4a13c678b97adb0ca2d93682a4ae23d6ee530e2d1c0cd6a40","cpp/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h":"c99bc3e292e71a5afa819fbfbb657c61776235a2372557a4f3c2f2611ef0bfdc","cpp/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h":"72831cc9f547c1da597eb8e26844627102754a767f17d48da05b67b3aed6da4d","cpp/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h":"64c9f51cc38897871f44ff3bbfccdc09cb2219aa73129624df907c64bfc0b246","cpp/include/diplomat_result_box_ICU4XDate_ICU4XError.h":"e63883c8bdca729b9b54540afe8c520363230eb85d51922a289427f8d2989e6e","cpp/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h":"cdc24b34a7b3220f74fe7ba159404945be2ace03f5204ae4e5359da4e22eba42","cpp/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h":"c24bbe0cf8763492dc660bd7e439c2e40f0b3fa5311e73237174c43462023580","cpp/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h":"0706eeb65200fd9475b3da7f46d57f43bc115851670a17658f277d8cca39519d","cpp/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h":"314a668723cd9b6d9939b1b1a5008e764ee8f31c2f755b4383888581339f7705","cpp/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h":"e31c88dcaf07b2dec8b9a1ac90de644cb3c88d26bcd5342fa9e5e3d4b66fe909","cpp/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h":"9e20178cfe4a63a5e5af84c468c6cec4b3d88cc8ec8f8aa8a7aae5b0cc6a3cc3","cpp/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h":"4a30e2b94172ae78bb10626f6edee04cdfbb18fefcb584831a5f2afc21061c2c","cpp/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h":"f5cf70a90def9156d8e2a711a1d766c1b74aa30574adf321bfa98e52a3a508f8","cpp/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h":"b536e34f20ce877f7b7cc096742d4ced3a111da455be857f762332f4bb88b8a6","cpp/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h":"d82cb4aa37b6aa3bca008aef27e4cc5a443a6393d4557fc8e4d3cf1f7d27374f","cpp/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h":"1c268f748fb0fabc4bee3bf2dff6be1397455d701aec641cca49147223ae0d1f","cpp/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h":"43cbd479e2b6dec150cc040f27e8322509e6dd33f87dbd0be970b478520fc3dd","cpp/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h":"37da5709ea21bcdebba934627a24f696a716509d1fa743336385cda259ae165b","cpp/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h":"0dc0a8de105ed8b047d875a88e21d53a23fda879893e85b523e77fe3b91b576c","cpp/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h":"818396c7da0fa28981abc5486906eefe8fca44f45d1455e32525a1c4870c9850","cpp/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h":"03c9c7a6182bbbd5abf697e2900fb5f1bf35479359e2b9a6318e883e9c3a9f2f","cpp/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h":"76bc810c1f5cdce04bbced497a83ed18597864784cfcd1918470bcf16d7ee72f","cpp/include/diplomat_result_box_ICU4XLocale_ICU4XError.h":"325af7add47038ba4997fccec85f8c17ab746d75452873b57b9e49fe3fb926aa","cpp/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h":"11366824711543693cfc29e85ef6506dcf1b126d6479f7cf4516e1b08309cfcf","cpp/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h":"37b5b35f3ee46ca40ef6081e78cfcc827c40ece420c56fa9f1ef3caace0ddfd1","cpp/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h":"00ffa08f94e61e0df7ed1471f5a5f539eb167492b19e2d9bd6bd3fb7bf7c6090","cpp/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h":"27375665f96cb573a703464e5213ebc1c9dee48dcac2ca362409445d28314b3e","cpp/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h":"a79303283606d3d9f0bfe8b8957ddc7e251f1ea8d71a0c2e023622543d0cc98f","cpp/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h":"9d2032bcad19a83584795296de438ea680c7b9452315034b9f3dc83406926d58","cpp/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h":"64f17863f06568a2a2493ec5c43eff09a6800898cdc1b0ee7927fc17e29055ce","cpp/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h":"c3428ab6414190e537638497972f666fcde75a09882d6233e94f2348213c59a8","cpp/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h":"8d93dbf810a3a6d8bde00608df728387a7fc92e3d59b66de8fc44f7383dc172e","cpp/include/diplomat_result_box_ICU4XTime_ICU4XError.h":"fd59b48cbeeea9f6c00ba4efd8003cef962603398371e4489ed3bf0696727757","cpp/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h":"7a75ff83facb7287597af360b9ff4c1fe7a71b750d40c9146a94c780481ae84a","cpp/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h":"92d217965ad6296835a9d69458d9f5fa6e9ca55114d64dcaf8dc4a7512df2c09","cpp/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h":"6662198d1464c95468270aec56563f0bcc17e75babd4316ff60b8587ce9766be","cpp/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h":"cb5a1ba7eeb206886266c2aa172486073084f8d9d271a52136205185f6376ac7","cpp/include/diplomat_result_int32_t_ICU4XError.h":"c9f9241d50cdffaebb1135ee78efe6bfa212743f71d59b0715ed0a79b05332ea","cpp/include/diplomat_result_uint16_t_void.h":"ad0d09f20115172cea2f459beb97a7df28a89708bb5a3a5372523d6eec42e37e","cpp/include/diplomat_result_void_ICU4XError.h":"bd03f10ee6b79c9498c2586ee94eef1f89d499cddb25d77b774ef066250bc632","cpp/include/diplomat_result_void_void.h":"f5f36a86bbf084e3eb2bf2a616efff7f612a208c2e747d5452b32d609eb450e0","cpp/include/diplomat_runtime.h":"1cea1a3675774fcb4253a58affeb7fad8e771af0b1077051b87bcc4b13ae309d","cpp/include/diplomat_runtime.hpp":"c4c0a6c954d337ecbc5b9253e4afd3cff0b11f120744e156c5dd038b9dc16a65","js/README.md":"3857edd1d256ab90f6d21421a61e275f6564d61f9e8531563ba3f6d6a717a698","js/examples/tinywasm/README.md":"c56bd81847b028f4d8f3cac2301fed9baa59bf89d58d8ea49454a3709bd9ef3e","js/include/CodePointRangeIterator.d.ts":"d57f6f61fd8a8b2601bd06734e15a8f5dc878577d7e7969874d23baaa3e1b4f0","js/include/CodePointRangeIterator.js":"fa0ccbc9c661e28691328e9646032330f217d5279def15fdb3a1154d2a4a6e15","js/include/CodePointRangeIteratorResult.d.ts":"85bbbb07a69531fef0af2162007fb9c44b09fd9e11f7107f79c76fe50c43f368","js/include/CodePointRangeIteratorResult.js":"27975bc4adb5e51ff11bd3112fb777e68c3e38f90b640c485cac4b087478cb5e","js/include/ICU4XAnyCalendarKind.d.ts":"c56d8881d52812fab1f87d5d2d07d3e58ec1d0f61e7fe781ed4bff0ddc399e17","js/include/ICU4XAnyCalendarKind.js":"ece4ff9c97c2c88204887156ac75fb9e88de7901a64ba4c802575d874c522c86","js/include/ICU4XBidi.d.ts":"c87156bca0ac92beb8a4782076f1fa9d3e6084ad6cd8cb24f0caf5f607e56577","js/include/ICU4XBidi.js":"7f1e1fb0682bd5752930fba82023076f9af899c264c0584740db796ad0cdd70c","js/include/ICU4XBidiDirection.d.ts":"317c63f1d8356db98aadf0a94646314ac85049dc997cf219952a759cefad9b9b","js/include/ICU4XBidiDirection.js":"e286a80f116ee30f238e3892841c4406b4ac70da1aa3a2cf410e306bd513a4c1","js/include/ICU4XBidiInfo.d.ts":"12d8bc98bc2d0ea9d4bdc670a1102aa7f6b6487d1f5b3bc72bf00a98d34a4cf5","js/include/ICU4XBidiInfo.js":"b928e6f667d85da40fa282c4c3dc997eeb72e5a2f0dd4463915f1856a7905582","js/include/ICU4XBidiParagraph.d.ts":"2f59520c170fe5ef5805f3766ff1750aac100d8d76df83d84a1d8408cc694002","js/include/ICU4XBidiParagraph.js":"e7d3f24158e88ce4b8f2865d3ae2df97507fd44e3211779b718d0612afa017e7","js/include/ICU4XCalendar.d.ts":"81d11eb4f57c0923810220f13f6f2abd201b3a6f7fc1c0b0ac31ef8b7924955f","js/include/ICU4XCalendar.js":"a08fd6d289bc9773b513fb1996e5906260ff5a927583170a474b9223478020e5","js/include/ICU4XCanonicalCombiningClassMap.d.ts":"6e3bc37833baf885a0fda89ec6de4719ff42561352ca216d13eab5f97ada3d7e","js/include/ICU4XCanonicalCombiningClassMap.js":"c4bf21112a1e0ad426172fd1b0d8c29596a35b6890d2ba96ddd465cf97ac9532","js/include/ICU4XCanonicalComposition.d.ts":"db0b2569c69e42095346cef853b80886b6192d2d8712abd18d9035152306eeee","js/include/ICU4XCanonicalComposition.js":"0497787831c7882e9adfd51aa088b860efc56408da1211027a6fcbf170ac08f1","js/include/ICU4XCanonicalDecomposition.d.ts":"0eaad17e4af4a14e846ad215d88a6834903302b4313bb243d93cd2202dfab475","js/include/ICU4XCanonicalDecomposition.js":"3d4d41bd086f00d08cd0a47b82354d16473571c1a8b2b657def87e071e089eaf","js/include/ICU4XCodePointMapData16.d.ts":"61acf8bd7e14edc18851b30b58d078882f4c3c31546c95a32fb002115539b9dd","js/include/ICU4XCodePointMapData16.js":"a0d2b97fc9315e52ad2c605d38206e92c78f2d2eb12bf63d3c59a68a35ce9382","js/include/ICU4XCodePointMapData8.d.ts":"f1997b8c4cdb1f68f223bb83fa898cd2b54d37495e843e2373e98e5921c7a06b","js/include/ICU4XCodePointMapData8.js":"4a6e2c4b58269c5931c6f21e2ef99b4ee6c98ecebff52ae9c1f27aa02a34a0fd","js/include/ICU4XCodePointSetData.d.ts":"b1e34ed4afb30317f873d6f18139f4a6ca37abf8f1bade431493c411480bea93","js/include/ICU4XCodePointSetData.js":"ff8d7ce7ef92b5414c6bcb0824b6408f4faa3d5a0e417ffe219249c6f65446f5","js/include/ICU4XCollator.d.ts":"e2fecdedacbe21a460989ff98f640d9f2b9b303e4d5fda31e66108810709677d","js/include/ICU4XCollator.js":"43e56831427319f3fecc0e33df0cf63ac3243e1f43ef8c7d9683a75f0ee7fca0","js/include/ICU4XCollatorAlternateHandling.d.ts":"03aab27aacacad47d5e1c3ef74682cfe16dd292d2710521cf873c0834f9f26bc","js/include/ICU4XCollatorAlternateHandling.js":"049e1ba2097da5039767f7a6ff94f69137f246ec566cfc42664bd716132298da","js/include/ICU4XCollatorBackwardSecondLevel.d.ts":"05e290e9c34bacc9068798655e0c317fd0e4903254546ea20ef7c3c049921bd8","js/include/ICU4XCollatorBackwardSecondLevel.js":"ccdcc0e6a437a9602ff2edc9c726639fd53e061c9b1452575d53bfd8026b1739","js/include/ICU4XCollatorCaseFirst.d.ts":"b6e797dcf5fc91e8b13561a713d95cb67a774c2e574cae1aead1889091c0744a","js/include/ICU4XCollatorCaseFirst.js":"a54790c13db56ba55b6ead3490993f0fbf32aabaa4bf32822f61fa242063da61","js/include/ICU4XCollatorCaseLevel.d.ts":"dc8f297926ec3d13b288ce58d2deb5190eb48970037424b8ac4d33cb0842ecde","js/include/ICU4XCollatorCaseLevel.js":"c655244e5535140c6f6d7b85969d15a43e0b7b61e98c197aa00a511c2ac41b11","js/include/ICU4XCollatorMaxVariable.d.ts":"7bdafde54caa08d22c0cb235aedf46051fa49302dd6b62df2be9e552efb532da","js/include/ICU4XCollatorMaxVariable.js":"0a591a149ec5151b4fd846b499fb3bf20aca1a2cca5791118f9458bf1a37bdcb","js/include/ICU4XCollatorNumeric.d.ts":"94a0605103bcfee58b251dba1a2742c2917c0ce06ceda9be7dcd29c77bb9c397","js/include/ICU4XCollatorNumeric.js":"632155467bec07aeeef78f5721caa8d61ec24a305e2a4b4eafaeca7fcd97c344","js/include/ICU4XCollatorOptionsV1.d.ts":"2ae0e76b41200ae5377fa9dabc8f4f84dd2b84d9a57db4837536e0edaee3e1fd","js/include/ICU4XCollatorOptionsV1.js":"e34f6dd3fd520984602662ee13ebc523518f695909940a89e6053b57db2cc464","js/include/ICU4XCollatorStrength.d.ts":"fe6d2d0d9c72d2a4600b9e4b781498786c638c76f240d22c543e9d2f2c3cea64","js/include/ICU4XCollatorStrength.js":"92ed009fcdbd94f016a73c76d73d7372ccf18c72ce0ac50fc8241cd6c5a805a7","js/include/ICU4XComposingNormalizer.d.ts":"ba148619684cb5ed09de2be92bc4a25e0dadbada25a674781c372375314e03c5","js/include/ICU4XComposingNormalizer.js":"d4fab3af67264b8753509aa658c19de06480706e789ea1e776273dd09eb40d5e","js/include/ICU4XCustomTimeZone.d.ts":"470c177322de8af524f49472998c7be535811d4f7e96b93312ab06bac78d80b6","js/include/ICU4XCustomTimeZone.js":"5afd9b9f0ab052dd019b144c23d5f5d050cc715ca355e68b727ae59ee2b0398e","js/include/ICU4XDataProvider.d.ts":"6916428da09278adacde68bef6a5fad198068782c741adaad1b5f119f28d22ee","js/include/ICU4XDataProvider.js":"1328f3899a9926fabfc8e07497c198b0e26fa75fea764f4352d0025c04bd3b4e","js/include/ICU4XDataStruct.d.ts":"52bb18b8031806687697a0ed59fdb1dc2d0a0f4cf37f3dc26048428d3ed115a3","js/include/ICU4XDataStruct.js":"b8bf46ac2da07ab94a4b82b8bb0ee346dca9f03b432b14294af3493df6ab5c0b","js/include/ICU4XDate.d.ts":"ba89c442a5c4792843c271d2aa6ca381288b1a8efe3e274f3599754b33c3f24b","js/include/ICU4XDate.js":"4a30babebc4c2049d6329cb59421d5862dc04e21d40dc72a48cf2829e48ee5b4","js/include/ICU4XDateFormatter.d.ts":"0f41e2cbbbffc9111679bac561e59657e1d339404dab241f4761396bc705066c","js/include/ICU4XDateFormatter.js":"7b942a7b422231c87cdb18df23e5846a3fa13532ed322a845e83e2b3116a1ebe","js/include/ICU4XDateLength.d.ts":"eef23cd41ffa44b0c036f77586de3e8a29ee5739df353610cfbf5684475b54b6","js/include/ICU4XDateLength.js":"205b80b04f23b372e77d0078995725080abb8014f771ed845d9729e8469ea060","js/include/ICU4XDateTime.d.ts":"a4f373d5de310b55bf3a9966174d5f2d5f3237f8158ee509b934e1b020054ccd","js/include/ICU4XDateTime.js":"145bdc19af2caac028b2a20e643c35762ec20620da534ecd4bbbd31be9ae0103","js/include/ICU4XDateTimeFormatter.d.ts":"e5afbcb8e2b8696b0201ef095859a0072531c5c82682e2dd42a7d64b2514a900","js/include/ICU4XDateTimeFormatter.js":"4716df1aeefd2ca22c8d7f1c0d72976df64b87e037fd79002968c148ccb54050","js/include/ICU4XDecomposed.d.ts":"e0e463649ad4d688f693bfca82a5b813f689d41ece7af24cd4d4931d079f987c","js/include/ICU4XDecomposed.js":"045c80ac3139cbfd7027b502982c6bad54da3ced336889325287d00efb7b8153","js/include/ICU4XDecomposingNormalizer.d.ts":"394646951aad4a24432feebfbc18c97cadf4465a3fc23443f2358ff2cdb64158","js/include/ICU4XDecomposingNormalizer.js":"13caadba19bfc1a8f467d836a0ba501526af53e52b454eb02fe1bde01f662294","js/include/ICU4XDisplayNamesFallback.d.ts":"90a75af7ac32052addee947488fb037058d92a55306302751eec00cfbe39c60a","js/include/ICU4XDisplayNamesFallback.js":"4128a1f5ef5d51516602477d384b7292c622f21b96d3db9e0efa9d383783a0e6","js/include/ICU4XDisplayNamesOptionsV1.d.ts":"fd077385772e9b481a278b28dbd62f483d4a1f4792fa990ed9cc0ef669b3bbb7","js/include/ICU4XDisplayNamesOptionsV1.js":"30968df2eae8d61c3b214e36d4bf9602a18500e0d85e06a5c409ae62be831297","js/include/ICU4XDisplayNamesStyle.d.ts":"57d11b1d80dc944496d031e6d99c811f326d891c239674ccdac1531b7e12fb5e","js/include/ICU4XDisplayNamesStyle.js":"3b4621b09a32d06266826f8c44b892231820a442445fedb4fd331ee066085353","js/include/ICU4XError.d.ts":"4438493f49c015b59befa5bf8d43499e665a414376d8e3291b476c681e34bdab","js/include/ICU4XError.js":"9edd393befd656137bf23f0afd988c7f4e1761400baeb97cdf1a4d7a8dee3d62","js/include/ICU4XFixedDecimal.d.ts":"9a1efe2c4a206ad5d03c70500d23a784ad60eec2f7f85fc8aff0558208be6708","js/include/ICU4XFixedDecimal.js":"c2358ed01693d1285603706dd2e320d4dc7a871af5b244528d7d9d33939de6b6","js/include/ICU4XFixedDecimalFormatter.d.ts":"b81afd4d6c1db506bc4d5f9f4c8d9a23b2097ccfa495719947b53fbf780e86d2","js/include/ICU4XFixedDecimalFormatter.js":"860d0fb6991a1902f609a3d6ee69881fc643fcdaaf859631756aac6237ba2b70","js/include/ICU4XFixedDecimalGroupingStrategy.d.ts":"c7f86b0e8b3888d98b74651a92ca7a2da96fc1ba1a794de2d35d4935c43bc943","js/include/ICU4XFixedDecimalGroupingStrategy.js":"a5c22febf577b3ea1a7b7b4cd649ebac03b06ce0e977f775252b6237c7a8b0c5","js/include/ICU4XFixedDecimalSign.d.ts":"f1efdccafa4c5a444708b2590142a294a3968ba991d65b0af52efd6e61c44287","js/include/ICU4XFixedDecimalSign.js":"33b839074193bef69c84559aefb0c3dfe92b0fd19f367c976fd0adf0afdc0a69","js/include/ICU4XFixedDecimalSignDisplay.d.ts":"80a07e2ec90650f151c6590b613a169736e4cf62dfd7de96ec8643ac29fdcac2","js/include/ICU4XFixedDecimalSignDisplay.js":"82c5b3c34b653717eb5e8d1c4a3af5fc10a89ebddaa62bca475f8f7bb6febd9a","js/include/ICU4XGeneralCategoryNameToMaskMapper.d.ts":"8b0bd158fa8092d75a804fb818ed19c310ae039c3538133e61b45c95e9333ff6","js/include/ICU4XGeneralCategoryNameToMaskMapper.js":"4f1699cd06f0a3967ecbdd92c740648286e414920f41869f7bdf8cd441b48c7d","js/include/ICU4XGraphemeClusterBreakIteratorLatin1.d.ts":"e24f6aa6e90fbb8dadb29b638203dd5ab8406a715c6610922e950f202ab32fd7","js/include/ICU4XGraphemeClusterBreakIteratorLatin1.js":"a9c00068e8edbb16247daef76a0e98817ce5ef38d987ef39ae16a80dabe0cf3a","js/include/ICU4XGraphemeClusterBreakIteratorUtf16.d.ts":"a9a6d4deb0cb21766460ef1c484be2e89c4334bb2dcdb514e837cb8e08fbd8ff","js/include/ICU4XGraphemeClusterBreakIteratorUtf16.js":"c807849a8d644a1c62d44da11deb312dcbc60d41e0a56736b023ee15d26431c1","js/include/ICU4XGraphemeClusterBreakIteratorUtf8.d.ts":"50076ec53626df84f0cdc52f1584c86167d9f893c89ceb7d3705ace72738772d","js/include/ICU4XGraphemeClusterBreakIteratorUtf8.js":"581c4936c238d01397239b0fc6ef60b56450df1f549cda22c7828c4dc17dfcf7","js/include/ICU4XGraphemeClusterSegmenter.d.ts":"08a10bc561f7518052c98f43197a59508f9fd03b782dabbb1b4d1787e662921d","js/include/ICU4XGraphemeClusterSegmenter.js":"bacd5016c6854f640c37e43c00af98c8cdb53bb6e62f5fe5f69e67dc94dec0cc","js/include/ICU4XGregorianDateFormatter.d.ts":"738229dd0fc7af800492bab135f744d4c5450497d3f0c7c46b0d85dc371bf81f","js/include/ICU4XGregorianDateFormatter.js":"2bb205c43996ae94e0bb8e5e2d5f5e77a0b2e87d77921344f850fee98b52f285","js/include/ICU4XGregorianDateTimeFormatter.d.ts":"557c25b05863a2f6e698164e8d25513d80b57d0a06366fe06d9865097481150d","js/include/ICU4XGregorianDateTimeFormatter.js":"b140ad91ab5c79e4eabde0f88e1ab5b2a75677344bbf223b2056f876e5daac20","js/include/ICU4XGregorianZonedDateTimeFormatter.d.ts":"da8a81b205ac83facc262401b089e174444808962093615ceb90082ffbd23d4d","js/include/ICU4XGregorianZonedDateTimeFormatter.js":"654e5be83071231eaac7a6809fab7160712a536225bcfadd50d5e0599cb90215","js/include/ICU4XIsoDate.d.ts":"10c3a273e8fe0ed78d3de3d6a88ea3d44bfa8c5d8f9ddcdc064787448247c9f7","js/include/ICU4XIsoDate.js":"556da857e3b6ff2193b9d2dfa95e4ffc34888fc938ef6aca553d3462cd1dfb15","js/include/ICU4XIsoDateTime.d.ts":"8899cdcb803cec01710909b492c9516af35e884b5761ef738f8fd531a805cf14","js/include/ICU4XIsoDateTime.js":"22bf911c96f3582e3c3b519e13188b614f55cb3b0b18a6d94342daaa3da1784f","js/include/ICU4XIsoTimeZoneFormat.d.ts":"d20d6be2e315c2591366ef46ba20aad41347560d36b5b08779cc20b92897208a","js/include/ICU4XIsoTimeZoneFormat.js":"4f3073326cdb8d381e4e5bfbbb5d9b2adf57f6b45816a5781ef5fd1e380c6764","js/include/ICU4XIsoTimeZoneMinuteDisplay.d.ts":"c5943895fb243a43aee6f03a7cecb9062d7113688ace55ec10bb7e661153994a","js/include/ICU4XIsoTimeZoneMinuteDisplay.js":"cfece4237e82485a41df404463db20e6b0c58a3d170b6f59dea9c93cc7c3c09b","js/include/ICU4XIsoTimeZoneOptions.d.ts":"51350e0d7baebb25e0793fc80d6a58a5332603bb6cf45024e94af100e887d41f","js/include/ICU4XIsoTimeZoneOptions.js":"e90518cbabd0d37f94904a0e83f53e82192e0e49de5bcd386fdd7bc390bd37ec","js/include/ICU4XIsoTimeZoneSecondDisplay.d.ts":"84f8320d39f28fd527c32b6e6565ee793473f801687fcc0e489c7f0c8deb7317","js/include/ICU4XIsoTimeZoneSecondDisplay.js":"b1cd283e031dd9b3869eec96842350e39a1fd1d474de4c1674fef6a1833c2521","js/include/ICU4XIsoWeekday.d.ts":"1a226e9475a87c7f94fedba962b52256b6dcf460bdd5797623e2e0881378d29c","js/include/ICU4XIsoWeekday.js":"36c67fb01cffa129c5b9d2f83f332a8f4edd04158fc57f71d278a4f14cf6088f","js/include/ICU4XLanguageDisplay.d.ts":"505fa367e6869919cef5bbc334cf5c30e3b29892e9d0bfb7e9075b30a9e7dfcd","js/include/ICU4XLanguageDisplay.js":"b7ac8b55119879fd7ff69e040add565f06ee55a738493d38414b80d655e61348","js/include/ICU4XLineBreakIteratorLatin1.d.ts":"77d023ada016b5167ba3a56e50402027e1a5e8406603074d0029029b28161e9f","js/include/ICU4XLineBreakIteratorLatin1.js":"411a5db01c4e0a83ddc6f0122d4b4b8e9d370a6afb78bbe94bbfefd8b4e6f9da","js/include/ICU4XLineBreakIteratorUtf16.d.ts":"c651fb3946304770d89e66ee906d95dd925341c2c670158e4eafcc7d96359fd1","js/include/ICU4XLineBreakIteratorUtf16.js":"0e5daebc83d589fb44da5702ec520ca204f9a7c1ab25d5b4c31fdc3cf25ff477","js/include/ICU4XLineBreakIteratorUtf8.d.ts":"3ff898adf41bbfe5a70026dd4f5150da256dcc33ddd41db47efd2d421db2f2ed","js/include/ICU4XLineBreakIteratorUtf8.js":"a2b368943d931b587439c633d25a6741058c5c2d77daf55dc30e5c4206ac29cb","js/include/ICU4XLineBreakOptionsV1.d.ts":"c88d710b9dccd65b33cf4b4c8dcd8eb60ba1ab1fa54816f4f7ff39c5e3435d27","js/include/ICU4XLineBreakOptionsV1.js":"e51c63c7fdbddad161fa0e5d39ab0ac35b68df97a780bc157340f5b09d1ea6c5","js/include/ICU4XLineBreakStrictness.d.ts":"30b061be158e691458869210b6cf51fff3fe83428297f55f94c42c943d0c3140","js/include/ICU4XLineBreakStrictness.js":"fd036dc7c622567122e957d9d6e4422ce0a68cee499e878eea7410d4fc0278e6","js/include/ICU4XLineBreakWordOption.d.ts":"2b5a8e1529d19c0c9c695db512aeb0e9cb625065dbe72529f5d27aa20ffa087e","js/include/ICU4XLineBreakWordOption.js":"9fd6b0a78cd0b3240ee948e8d909aa27bed7321677898bd5637a55b771876d88","js/include/ICU4XLineSegmenter.d.ts":"828008a63c661a74142b7ed318b77878c41371102eb384f13bedf095e2e353b8","js/include/ICU4XLineSegmenter.js":"adb478c1e4f6fed8f99c8af9f020131b4e9a4bd529f3250c64beafa1dbabeab9","js/include/ICU4XList.d.ts":"e1ed8081468f45f683d54b5711bace87e936b7186c3dc21ed4d5ff5b7c1e970f","js/include/ICU4XList.js":"c4fa159d0179a3b313b1d62681d612bd6acd7158adeb2bae8795d7682c123da2","js/include/ICU4XListFormatter.d.ts":"3a0e51659810f28fc8790674fc692cad98bfce095cd40ff4a210041ae4375f55","js/include/ICU4XListFormatter.js":"393314b48835bc5bbdf4803f78eba87f34b02ff653fe84bf6d74e470037a30e1","js/include/ICU4XListLength.d.ts":"c1ed5664d9bdd0e369cfd2a0804fe4defa1cb2a6e6199b5640385e5c17084538","js/include/ICU4XListLength.js":"70f38d18c4e5651cbfa6e55ad06117a604a60f644d5fb419aea279446ff5552b","js/include/ICU4XLocale.d.ts":"52e8360d77bed333cd798ea28cc19bdc30d54030a66213cc7809936313644b8d","js/include/ICU4XLocale.js":"56900f40b0c138e77b2629c129c4b323210a6b7d095fc941e25e594f87a22d77","js/include/ICU4XLocaleCanonicalizer.d.ts":"9a30e0c786d049b21b95e38ebcd297398b0f426ccdf3e72a9c561090acdd50d3","js/include/ICU4XLocaleCanonicalizer.js":"4aa757b4f90132a6f25b1b1f37ebff5d17c221e29eca729c6a65b1d25ae28094","js/include/ICU4XLocaleDisplayNamesFormatter.d.ts":"bfb1a5e0cfa97a9087d8d47f34e0e9ecaa3f2697658747ebf6fb3555e5437e3e","js/include/ICU4XLocaleDisplayNamesFormatter.js":"de6c4675ec4acdc7f8d38c03348878528fcfe2699c420dfcc178bec67db98160","js/include/ICU4XLocaleExpander.d.ts":"83b8c3d3dd32a755ee174821a10dca52b826021b4be2c99f04ff498ffb4b1d6b","js/include/ICU4XLocaleExpander.js":"21a64dc1cb6d594c125cce4173016cf7776d2ac58296efe8d2fdb574152459ff","js/include/ICU4XLocaleFallbackConfig.d.ts":"f091de16055144f77d42be76560b004435ae8b38a7c8ca421c11e60905c70c42","js/include/ICU4XLocaleFallbackConfig.js":"100a5c71663c069c139ad4120cb56a86e53ec1ec518fcd66def129f69afdb421","js/include/ICU4XLocaleFallbackIterator.d.ts":"dbfdf1d7c7facef8fbb28a05cecd3dcbd743dbe34a0ae4232c3577075b98c17d","js/include/ICU4XLocaleFallbackIterator.js":"eb5c29c67cad751ac47ab79aaba0f2bbf0fe15f1aa53f76a14051b35b09b9fc7","js/include/ICU4XLocaleFallbackPriority.d.ts":"05b568b006f9ecc762e7f78292bb3e2a4932818b2905c98449823af6df9bec22","js/include/ICU4XLocaleFallbackPriority.js":"bcca1eff8492141ebfec82fb94f4cd0f936e352fa573a649ddd6cd5d03032b27","js/include/ICU4XLocaleFallbacker.d.ts":"8d9917044615b767a01b569733a39fd0c96ae7b45c5c939886aa2a2398ea4604","js/include/ICU4XLocaleFallbacker.js":"46010266181d4a771218acea7901d86584231c3f4ce7589c74c7982bb9487dda","js/include/ICU4XLocaleFallbackerWithConfig.d.ts":"d417bb9fe35c7ddb3d0015fc9a7c6a4687ccfe321485a149b96d0c8ce43b9437","js/include/ICU4XLocaleFallbackerWithConfig.js":"afb34eda2648372870850f6dc3299130a98f56d29d48a4d543663456450c526e","js/include/ICU4XLogger.d.ts":"9910521bbf3e85e9a1e4fac7723e282916d4db782508713d2a04fac0f5b3235d","js/include/ICU4XLogger.js":"5ab42fa3277aa58009229b7ba691bbf465ec016f53bbd9fcec0da711368682fd","js/include/ICU4XMetazoneCalculator.d.ts":"37341f959fcd097ff641b313d624a5f24c5dd6fc948da76a3e663ee0aa1db825","js/include/ICU4XMetazoneCalculator.js":"f777f20baa8e09a1fb369d50eda09dee2d5eecf2430e9189550f2b7905fc5183","js/include/ICU4XOrdering.d.ts":"9e474203a8efd5539cf60ae8378109156fea4eee6226eb8915997f2104d22aee","js/include/ICU4XOrdering.js":"2e21cf078e0161d29a509aa542126324ae37eaf7d8c44398ec8e1f7012233df9","js/include/ICU4XPluralCategories.d.ts":"9f45d0edf2b304a76b94cd3fb9b496eb3ff11fa215e47ca8350015f423992514","js/include/ICU4XPluralCategories.js":"31fffaeff9c831a2e5d2cc252c6a5e1be060268230591b585e079664e8d327e0","js/include/ICU4XPluralCategory.d.ts":"a22e2c7b9d6377a1151855748649aa167e67a763fe605394a118e0c52236057d","js/include/ICU4XPluralCategory.js":"22f169e440a7a5000890327dbbdb0d4c434ac184ee0716a58d27583cb220b334","js/include/ICU4XPluralOperands.d.ts":"021fcda7962967b82344b89ae32e5fbf28b0da83b651d2ac94f92fa3dfeeafa4","js/include/ICU4XPluralOperands.js":"3cd306fec2320a3c6236b61b1817ec30fab4e576f67ef550f6aad77565454203","js/include/ICU4XPluralRules.d.ts":"948952cddcbb80b996a07ed295635e193c744febfbb7ec3f14451b513480f655","js/include/ICU4XPluralRules.js":"17562775d3023b0b2256f9fd628e179066904dff40959ecf7d82b835e9f6dbd7","js/include/ICU4XPropertyValueNameToEnumMapper.d.ts":"d01735437ecd14dc600240b9b9c44f85cb7f4afeaff0049b5d85c52610fc7d61","js/include/ICU4XPropertyValueNameToEnumMapper.js":"0188ddc8d26cfd4b8c4f62576d1d93aaecc4c40174f13ccdc68379980b84793e","js/include/ICU4XRegionDisplayNames.d.ts":"0680ab49d9e6c100e746e256c9a84a272c8083a273d2a5c91b5c548a61d47aa0","js/include/ICU4XRegionDisplayNames.js":"37f27838d2d76c21b999d65f25409f73862f6f508dacf0f274111ad9558d881f","js/include/ICU4XReorderedIndexMap.d.ts":"4a90052cb5496475e6b67ec25742865311ddfd51523058c50034a528170946c5","js/include/ICU4XReorderedIndexMap.js":"06b1d3c12710611d1becaf78590aba71e1a20fbdcbd506bbda0948a869914869","js/include/ICU4XScriptExtensionsSet.d.ts":"d3cde86b6fef3a78669eb035678afced44fd7f5769c62b6d70c017f87df23758","js/include/ICU4XScriptExtensionsSet.js":"f4327c39b98a699306515c5e7ca0e13802066fc66514fccdfe05fc9b62584bd6","js/include/ICU4XScriptWithExtensions.d.ts":"8b1753d86d1f753dfcefeb67c17855b16442b514b4854a8cf90220411ddd795a","js/include/ICU4XScriptWithExtensions.js":"d5bd963ec59adc25856513a38f6e98b6f2795a05e76a515287d389dd11679a89","js/include/ICU4XScriptWithExtensionsBorrowed.d.ts":"c9bb16d8784e838766f7067c562754b25eb8e9acade28594623256ea417f5e29","js/include/ICU4XScriptWithExtensionsBorrowed.js":"bbabd18b1a4ad1abd410e2e80d0a7baa525b8dbf533876a0fad6f8ba57ec4fdb","js/include/ICU4XSegmenterWordType.d.ts":"89617b9a7652474cefd4aa55eb2d50c380f389351f3119e4b158bab22bc0cba8","js/include/ICU4XSegmenterWordType.js":"17216e3d9c88b8274b552bf7783162b60f5b0011c700119377c356a26607f8d9","js/include/ICU4XSentenceBreakIteratorLatin1.d.ts":"8bc66e377ab330f4c82de876733058b87dabc56439cdc313f45c12fa2d46a925","js/include/ICU4XSentenceBreakIteratorLatin1.js":"1706b50089f28ed7fbcedd4833c08718c6842f72f8d5a340e22944dea98d2193","js/include/ICU4XSentenceBreakIteratorUtf16.d.ts":"551f7719b6d478225ca7a673b85e7dbca330e3b0216a6bcfbf4025313f09f704","js/include/ICU4XSentenceBreakIteratorUtf16.js":"668f357e016c248b030d023899269e4ef988be800effeb96b1f885119c9fd249","js/include/ICU4XSentenceBreakIteratorUtf8.d.ts":"f84d88d2f5ff28433ec7684c3bb58b3d0754ca9b9b5eb11c946d06953498be11","js/include/ICU4XSentenceBreakIteratorUtf8.js":"b8f2d32cf3d26d4b7ef3239ba24b2ab7ac6952e9927d2e4a4a6abd55e0af4ccd","js/include/ICU4XSentenceSegmenter.d.ts":"20b3e3f0770109c50dbd9a61574544e39c2941b6dfb00ea4c37491a2b08a4f20","js/include/ICU4XSentenceSegmenter.js":"a383a4d6596cceda9c67cf0b4443fbe8177ef3dc4afbc9c9d98fde2fcb0c212e","js/include/ICU4XTime.d.ts":"179cc8aadcf1ce8c57ecad196bf1fbba1958827230bb44f9c204050c5e74cde2","js/include/ICU4XTime.js":"f8d71a8d31a1558aaa06229b66def15d4ab26a414898a8bab017176d46efb7df","js/include/ICU4XTimeFormatter.d.ts":"5f8dba343a5822d27b173c2327b81bcea003c012f4536b92b7113259e9c01c84","js/include/ICU4XTimeFormatter.js":"988762e4117fbce07535a0918709e9758f66667173dbe168ed50514f1d1941e0","js/include/ICU4XTimeLength.d.ts":"b0c182c13844ae3f5f2eea7ff83d94185889782332097b80ebf3ebdae38023f1","js/include/ICU4XTimeLength.js":"0cbbbba9443099f57d8bd2ebf35a187298796d641c416958658007e9f2a30080","js/include/ICU4XTimeZoneFormatter.d.ts":"6df528d588b2f6732a95de7bbf451c74ae6951873d8af38c69db31df9f013662","js/include/ICU4XTimeZoneFormatter.js":"597c21cdd50a5804d43e6626d907996afa09a3fd2a41b5da5bb929d79bb28be7","js/include/ICU4XTransformResult.d.ts":"3cc2c7b95b19d3893ee20bbd8c826f82af0bf3cf49a2f664345d91dfdd144d59","js/include/ICU4XTransformResult.js":"008db4e4c749e29116ae7d47e8f86ba383f8edacaeb507cee624281cf35dc724","js/include/ICU4XUnicodeSetData.d.ts":"8bbc14c8461010a8327197c5222db924ae6766a75cfeb0596e9812ed7cdc502f","js/include/ICU4XUnicodeSetData.js":"bde864cc0089af51169cbde08bbafc5805f726cf85edf5f7b08e627a47c5fe15","js/include/ICU4XWeekCalculator.d.ts":"b78e0f45bb0dffdd445f9868e2f82a0e883bd9d98487e5fd3f83f539fe086ca6","js/include/ICU4XWeekCalculator.js":"1ebe2adbf71aae5d758a239e992d8c8980a0e96390441de6b3f9eeb97d08f926","js/include/ICU4XWeekOf.d.ts":"a668ca6a8cad17fdda6f91e86b78fb839d3a77280bf6b82102f96c52acb2105f","js/include/ICU4XWeekOf.js":"baa59cc4dc4cd81eb8fe10cc30a88c36bc3d733e28a0379ae50abd987a326038","js/include/ICU4XWeekRelativeUnit.d.ts":"62f25b2de9eb8ae942b48213f7e7eb85eae23ea0d4c32e542985d83f26b3bbeb","js/include/ICU4XWeekRelativeUnit.js":"2aabbb5d149bbfcf0a1b9b53c3a53b3fad76af1c310dbea661db76a6252cd632","js/include/ICU4XWordBreakIteratorLatin1.d.ts":"61a078fe55d9f4841b4e0cbf015bd6c0d49f4cb88fe6a20fcd1fd521eac268fb","js/include/ICU4XWordBreakIteratorLatin1.js":"78ce9ac8660b08e28e520ec9c8af4b77732ea150caa167bd9c809a3ab6af1807","js/include/ICU4XWordBreakIteratorUtf16.d.ts":"2f4d9cc55c1a651b4d71685d2c6875c8325716dfe5c34ed92be976787ecabf1d","js/include/ICU4XWordBreakIteratorUtf16.js":"db426aee8c0490220efeea8f11fab669a1d09dd4f1d81dea8332d5b70da40a47","js/include/ICU4XWordBreakIteratorUtf8.d.ts":"d595d92f6e458a31d487dfa10d057d5386a7c871d7bfee28dd678c7fee386bfe","js/include/ICU4XWordBreakIteratorUtf8.js":"3f2e86fe6ae74f2d3f9db4ce22c884cfce154556e38648ac5500876a5422bd7e","js/include/ICU4XWordSegmenter.d.ts":"dae3b62c026586df4ec332893a0aa397e85ab08a3b53ce7932b5c8366585593e","js/include/ICU4XWordSegmenter.js":"5e58900690ab8c858e23a9bcd66de4afb1cbe98c9669356b4678d9f7098ce843","js/include/ICU4XZonedDateTimeFormatter.d.ts":"ecf019baa608b3202375bc7ede5e975f4a3d8bc01da808d2fd1ae613bc302648","js/include/ICU4XZonedDateTimeFormatter.js":"530ffb402a51ca286ae83d95e7f2f0dd1a4840957f77c40dcf79937cbbe644b8","js/include/diplomat-runtime.d.ts":"78d7de59ac7564fd1dd4c13361b7e674d6c11dd8b0a3fb980cfdc250723cddd9","js/include/diplomat-runtime.js":"381cb7c57836cdbc102f12434e03cb07377c5a7a7e2d2744463f056df23a6574","js/include/diplomat-wasm.mjs":"49cb8c515b5279e2905a6222d6353e504a06cf1399c1a8e985bc0d27ad0eba46","js/include/index.d.ts":"ab9f6831c8e192c0d290c48975cdba95e11f37547105b755dd6ce6bdc4b4dfb0","js/include/index.js":"a56b713246f376474fa14700fbf37abc151b123c3a5c82f5e111855446193257","src/bidi.rs":"d6d677d5f8a4e6f04179d7e5977af35c22e3b00d5b9f81495b7972a2d4d7ee40","src/calendar.rs":"60c4fcce0a7af922a1e3f426fa99439823c6de258a2f19ee57118b2ea26b8355","src/collator.rs":"43dba2b8ebbaddc06255ff0dd0cff5253c571926be917580c9a2972ea9a011d0","src/common.rs":"4a90f75f9199f03d7b672a05fe1c8dde7c4502f5e879a34070cae1ed884da1a4","src/data_struct.rs":"9b0f2c1e1c5b1c819779d6864c0dfec8d93a60e9c00268c65d70ea21ed4420a4","src/date.rs":"a24ff5eaa600be4a6788d62aac17e4440e80b371ff17e0bdd9d07af5cd037989","src/datetime.rs":"a554450cc1bb232cddbb0c1d7d468fff92202c3fda2064f5f1f36ae5db5d3134","src/datetime_formatter.rs":"ecd6956df262d17e52e19b99fec87ba92f2c50202be5ce88c60bbdbcfc0e89a0","src/decimal.rs":"b576231965373ddb08939b8cd41ac8692663275189414a6436a96141b16080aa","src/displaynames.rs":"201d838259f28b40304406324a198264b4d074908bc90dc21dd772a66a7abfb5","src/errors.rs":"2c5656726a0b220678fa39fec0b624e34f774ffda4ce9f7f24b05bbdfe46a6f5","src/fallbacker.rs":"b8dff1ac8d004f7ee2e667a38f877ad217e65d9ddaff240e50f5892a2826b072","src/fixed_decimal.rs":"68244e584dc14986557f461772d602c9161a4fa7a6b79df9070f0259da32a78d","src/lib.rs":"6dd0669aad14239bb09bf3efd63ea89f6c47a8750be84d5177a9ebfcdf3da305","src/list.rs":"869119afa48ea814f552b393ade0b169b27f81708de8777a5a7316ce52588d5e","src/locale.rs":"bdc70fead361e0441284790bec67c4785b4397b8c4b39c33e1a93f95e249f9a4","src/locid_transform.rs":"befe78fe020a2718b6cccf13ac666afff9e49d7103aa6752d5ac9b7e89670adb","src/logging.rs":"e979d7168991327b868d907cf0d3d8ef8658c1eaed0dc8eff9bb8945e8754057","src/metazone_calculator.rs":"0268b6ac079f39ff0d955e74c796933d37aa9f73cd9f7cc878456b303a4293e3","src/normalizer.rs":"0341b399a1b5c8849aa2ba109a5e84b4cd432def06bd8580106c21ed5f35741d","src/normalizer_properties.rs":"da1c254ec30d2b318fbb462ebe6434f8c5dce5fb47c180af191f776fd7cee0aa","src/pluralrules.rs":"15223e62b94a8db04b05a05c14a3d026a02fae77e1e58c82aca5b29431a40577","src/properties_iter.rs":"95689d704c04240a5bf9a8698b0712cebbce48aba09d1530f46477294a055343","src/properties_maps.rs":"89cce0c34f7faf0674b201a39b6e60741dc3338983f72756ee559bc00c2df800","src/properties_names.rs":"1af529c6232d8a06f92c1dafd2806d7e53b91fe6e7411e5d02ebad08a27a8edf","src/properties_sets.rs":"d0ca329a771a4a386761a33d21fd021d37be6ac0cb5e22a9a12b82bd63e2791d","src/properties_unisets.rs":"9914e1fd10116a89896759d7f098cf2dc99fcd494c8b3c8e97c20714e56a8db1","src/provider.rs":"863bf34b0a30d2ed017593ce4f3ee87c258fa7900097351630a910b4ec0bc5a8","src/script.rs":"4ccbab3d2aafb908e84bd0777623ace94f7d860da3237583208523eb6b0d5b41","src/segmenter_grapheme.rs":"d80c15da492426947ace987af9cd6acdcb20996d39642b770cf800b9f1eef207","src/segmenter_line.rs":"64a5255076b414af984211cc62b93ca9b432f289e2951d52d39d78b5545d240f","src/segmenter_sentence.rs":"1b47a5818d54d1bd9aa61eaccb06b45e1362b636d5eaa097bea9e1044e1408a0","src/segmenter_word.rs":"eaebc6be36e2524d457a577bda5c13c60a651c9e3822b016aaf9986c222b35ef","src/time.rs":"ca62f4a84863e8812f1567acf2c05599b367464f26bf5a324d4004ba61c7da70","src/timezone.rs":"e032c27df73e398b71c358d7d00d6dcd87ca1b8ba100201793dca1a6675e0d03","src/timezone_formatter.rs":"936377a57eca9c3191d58103f17b816fdfa6e3011c420cb13373116cbf11bd65","src/wasm_glue.rs":"ac2d6d807b0b67bbe058b328c270364ac153c9a2de6471650c2a38ef10271f97","src/week.rs":"e0ff4f35e9dfc51eb6676eb34e450e476b5c44291ffe0422dc239c5741833907","src/zoned_formatter.rs":"bc7b808417086880e0cdb21585327bbd3e16500e2f27965a43a01a9d8eb3fb80","tests/missing_apis.txt":"59c9e555fc3aa93046c85313bd533982c1f93282c834a6594b90d57d49d7f871"},"package":"3c29e1e7407081a5e425b295ef28526ca4c3cd7ce4475e1769c2863bb18b9305"} \ No newline at end of file diff --git a/third_party/rust/icu_capi/Cargo.toml b/third_party/rust/icu_capi/Cargo.toml deleted file mode 100644 index a36756da3bc3..000000000000 --- a/third_party/rust/icu_capi/Cargo.toml +++ /dev/null @@ -1,248 +0,0 @@ -# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -# -# When uploading crates to the registry Cargo will automatically -# "normalize" Cargo.toml files for maximal compatibility -# with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies. -# -# If you are reading this file be aware that the original Cargo.toml -# will likely look very different (and much more reasonable). -# See Cargo.toml.orig for the original contents. - -[package] -edition = "2021" -name = "icu_capi" -version = "1.2.2" -authors = ["The ICU4X Project Developers"] -include = [ - "src/**/*", - "examples/**/*", - "benches/**/*", - "tests/**/*", - "**/include/**/*", - "Cargo.toml", - "LICENSE", - "README.md", -] -description = "C interface to ICU4X" -readme = "README.md" -categories = ["internationalization"] -license = "Unicode-DFS-2016" -repository = "https://github.com/unicode-org/icu4x" -resolver = "2" - -[package.metadata.cargo-all-features] -denylist = [ - "bench", - "logging", - "cpp_default", - "wasm_default", -] -max_combination_size = 2 - -[package.metadata.docs.rs] -all-features = true - -[dependencies.diplomat] -version = "0.5.2" - -[dependencies.diplomat-runtime] -version = "0.5.2" - -[dependencies.fixed_decimal] -version = "0.5.2" -features = ["ryu"] -optional = true - -[dependencies.icu_calendar] -version = "1.2.0" -optional = true - -[dependencies.icu_collator] -version = "1.2.0" -optional = true - -[dependencies.icu_collections] -version = "1.2.0" -optional = true - -[dependencies.icu_datetime] -version = "1.2.0" -optional = true - -[dependencies.icu_decimal] -version = "1.2.0" -optional = true - -[dependencies.icu_displaynames] -version = "0.10.0" -optional = true - -[dependencies.icu_list] -version = "1.2.0" -optional = true - -[dependencies.icu_locid] -version = "1.2.0" - -[dependencies.icu_locid_transform] -version = "1.2.0" -optional = true - -[dependencies.icu_normalizer] -version = "1.2.0" -optional = true - -[dependencies.icu_plurals] -version = "1.2.0" -optional = true - -[dependencies.icu_properties] -version = "1.2.0" -features = ["bidi"] -optional = true - -[dependencies.icu_provider] -version = "1.2.0" - -[dependencies.icu_provider_adapters] -version = "1.2.0" - -[dependencies.icu_provider_blob] -version = "1.2.0" -optional = true - -[dependencies.icu_segmenter] -version = "1.2.0" -optional = true - -[dependencies.icu_testdata] -version = "1.2.0" -features = ["icu_segmenter"] -optional = true - -[dependencies.icu_timezone] -version = "1.2.0" -optional = true - -[dependencies.serde] -version = "1.0" -optional = true -default-features = false - -[dependencies.tinystr] -version = "0.7.1" -default-features = false - -[dependencies.unicode-bidi] -version = "0.3.13" -optional = true -default-features = false - -[dependencies.writeable] -version = "0.5.1" - -[features] -any_provider = [] -buffer_provider = [ - "dep:icu_provider_blob", - "dep:serde", - "icu_calendar?/serde", - "icu_collator?/serde", - "icu_datetime?/serde", - "icu_decimal?/serde", - "icu_displaynames?/serde", - "icu_list?/serde", - "icu_locid_transform?/serde", - "icu_locid/serde", - "icu_normalizer?/serde", - "icu_plurals?/serde", - "icu_properties?/serde", - "icu_provider/serde", - "icu_provider_adapters/serde", - "icu_segmenter?/serde", - "icu_testdata?/buffer", - "icu_timezone?/serde", -] -cpp_default = [ - "provider_test", - "logging", - "simple_logger", -] -default = [ - "any_provider", - "default_components", -] -default_components = [ - "icu_calendar", - "icu_collator", - "icu_datetime", - "icu_decimal", - "icu_list", - "icu_locid_transform", - "icu_normalizer", - "icu_plurals", - "icu_properties", - "icu_segmenter", - "icu_timezone", -] -icu_calendar = ["dep:icu_calendar"] -icu_collator = ["dep:icu_collator"] -icu_datetime = [ - "dep:icu_datetime", - "dep:icu_calendar", - "dep:icu_timezone", - "dep:icu_decimal", - "dep:icu_plurals", -] -icu_decimal = [ - "dep:icu_decimal", - "dep:fixed_decimal", -] -icu_displaynames = ["dep:icu_displaynames"] -icu_list = ["dep:icu_list"] -icu_locid_transform = ["dep:icu_locid_transform"] -icu_normalizer = ["dep:icu_normalizer"] -icu_plurals = [ - "dep:icu_plurals", - "dep:fixed_decimal", -] -icu_properties = [ - "dep:icu_properties", - "dep:icu_collections", - "dep:unicode-bidi", -] -icu_segmenter = ["dep:icu_segmenter"] -icu_timezone = [ - "dep:icu_timezone", - "dep:icu_calendar", -] -logging = [ - "icu_provider/log_error_context", - "dep:log", -] -provider_fs = [ - "dep:icu_provider_fs", - "buffer_provider", -] -provider_test = ["dep:icu_testdata"] -simple_logger = ["dep:simple_logger"] -wasm_default = [ - "buffer_provider", - "logging", -] - -[target."cfg(not(any(target_arch = \"wasm32\", target_os = \"none\")))".dependencies.icu_provider_fs] -version = "1.2.0" -optional = true - -[target."cfg(not(target_arch = \"wasm32\"))".dependencies.log] -version = "0.4" -optional = true - -[target."cfg(not(target_arch = \"wasm32\"))".dependencies.simple_logger] -version = "4.1.0" -optional = true - -[target."cfg(target_arch = \"wasm32\")".dependencies.log] -version = "0.4" diff --git a/third_party/rust/icu_capi/LICENSE b/third_party/rust/icu_capi/LICENSE deleted file mode 100644 index 9858d01abf58..000000000000 --- a/third_party/rust/icu_capi/LICENSE +++ /dev/null @@ -1,51 +0,0 @@ -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - -See Terms of Use -for definitions of Unicode Inc.’s Data Files and Software. - -NOTICE TO USER: Carefully read the following legal agreement. -BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S -DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), -YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. -IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE -THE DATA FILES OR SOFTWARE. - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 1991-2022 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in https://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - -— - -Portions of ICU4X may have been adapted from ICU4C and/or ICU4J. -ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others. diff --git a/third_party/rust/icu_capi/README.md b/third_party/rust/icu_capi/README.md deleted file mode 100644 index d6adb5f919b3..000000000000 --- a/third_party/rust/icu_capi/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# icu_capi [![crates.io](https://img.shields.io/crates/v/icu_capi)](https://crates.io/crates/icu_capi) - -This crate contains the source of truth for the [Diplomat](https://github.com/rust-diplomat/diplomat)-generated -FFI bindings. This generates the C, C++, JavaScript, and TypeScript bindings. This crate also contains the `extern "C"` -FFI for ICU4X. - -While the types in this crate are public, APIs from this crate are *not intended to be used from Rust* -and as such this crate may unpredictably change its Rust API across compatible semver versions. The `extern "C"` APIs exposed -by this crate, while not directly documented, are stable within the same major semver version, as are the bindings exposed under -the `cpp/` and `js/` folders. - -This crate may still be explored for documentation on docs.rs, and there are generated language-specific docs available as well. -C++ has sphinx docs in `cpp/docs/`, and the header files also contain documentation comments. The JS version has sphinx docs under -`js/docs`, and the TypeScript sources in `js/include` are compatible with `tsdoc`. - -This crate is `no_std` and will not typically build as a staticlib on its own. If you wish to link to it you should prefer -using `icu_capi_staticlib`, or for more esoteric platforms you may write a shim crate depending on this crate that hooks in -an allocator and panic hook. - -More information on using ICU4X from C++ can be found in [our tutorial]. - -[our tutorial]: https://github.com/unicode-org/icu4x/blob/main/docs/tutorials/cpp.md - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/third_party/rust/icu_capi/c/README.md b/third_party/rust/icu_capi/c/README.md deleted file mode 100644 index c0bfbeca1958..000000000000 --- a/third_party/rust/icu_capi/c/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# C FFI for ICU4X - -This folder contains the C FFI for ICU4X. To re-generate the bindings run: - -```sh -cargo make diplomat-install -cargo make diplomat-gen-c -``` - -Or re-generate all of the bindings: - -```sh -cargo make diplomat-gen -``` - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/third_party/rust/icu_capi/c/examples/fixeddecimal_tiny/README.md b/third_party/rust/icu_capi/c/examples/fixeddecimal_tiny/README.md deleted file mode 100644 index 0aba7c34190f..000000000000 --- a/third_party/rust/icu_capi/c/examples/fixeddecimal_tiny/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Tiny FixedDecimal FFI Demo - -This example contains tooling to build a size-optimized binary using FixedDecimal and FixedDecimalFormatter in C over FFI. - -Prerequisites: `clang` and `lld` 14. `apt-get install clang lld` *might* work, but if you run into errors, refer to the following thread for tips: - -https://github.com/rust-lang/rust/issues/60059 - diff --git a/third_party/rust/icu_capi/c/include/CodePointRangeIterator.h b/third_party/rust/icu_capi/c/include/CodePointRangeIterator.h deleted file mode 100644 index 36d6d23175a0..000000000000 --- a/third_party/rust/icu_capi/c/include/CodePointRangeIterator.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CodePointRangeIterator_H -#define CodePointRangeIterator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct CodePointRangeIterator CodePointRangeIterator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIteratorResult.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -CodePointRangeIteratorResult CodePointRangeIterator_next(CodePointRangeIterator* self); -void CodePointRangeIterator_destroy(CodePointRangeIterator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/CodePointRangeIteratorResult.h b/third_party/rust/icu_capi/c/include/CodePointRangeIteratorResult.h deleted file mode 100644 index 846873be11f3..000000000000 --- a/third_party/rust/icu_capi/c/include/CodePointRangeIteratorResult.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CodePointRangeIteratorResult_H -#define CodePointRangeIteratorResult_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct CodePointRangeIteratorResult { - uint32_t start; - uint32_t end; - bool done; -} CodePointRangeIteratorResult; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void CodePointRangeIteratorResult_destroy(CodePointRangeIteratorResult* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XAnyCalendarKind.h b/third_party/rust/icu_capi/c/include/ICU4XAnyCalendarKind.h deleted file mode 100644 index 035ec9ef17ba..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XAnyCalendarKind.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ICU4XAnyCalendarKind_H -#define ICU4XAnyCalendarKind_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XAnyCalendarKind { - ICU4XAnyCalendarKind_Iso = 0, - ICU4XAnyCalendarKind_Gregorian = 1, - ICU4XAnyCalendarKind_Buddhist = 2, - ICU4XAnyCalendarKind_Japanese = 3, - ICU4XAnyCalendarKind_JapaneseExtended = 4, - ICU4XAnyCalendarKind_Ethiopian = 5, - ICU4XAnyCalendarKind_EthiopianAmeteAlem = 6, - ICU4XAnyCalendarKind_Indian = 7, - ICU4XAnyCalendarKind_Coptic = 8, -} ICU4XAnyCalendarKind; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocale.h" -#include "diplomat_result_ICU4XAnyCalendarKind_void.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_ICU4XAnyCalendarKind_void ICU4XAnyCalendarKind_get_for_locale(const ICU4XLocale* locale); - -diplomat_result_ICU4XAnyCalendarKind_void ICU4XAnyCalendarKind_get_for_bcp47(const char* s_data, size_t s_len); - -diplomat_result_void_ICU4XError ICU4XAnyCalendarKind_bcp47(ICU4XAnyCalendarKind self, DiplomatWriteable* write); -void ICU4XAnyCalendarKind_destroy(ICU4XAnyCalendarKind* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XBidi.h b/third_party/rust/icu_capi/c/include/ICU4XBidi.h deleted file mode 100644 index 1ed7cfc8c245..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XBidi.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ICU4XBidi_H -#define ICU4XBidi_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XBidi ICU4XBidi; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XBidi_ICU4XError.h" -#include "ICU4XBidiInfo.h" -#include "ICU4XReorderedIndexMap.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XBidi_ICU4XError ICU4XBidi_create(const ICU4XDataProvider* provider); - -ICU4XBidiInfo* ICU4XBidi_for_text(const ICU4XBidi* self, const char* text_data, size_t text_len, uint8_t default_level); - -ICU4XReorderedIndexMap* ICU4XBidi_reorder_visual(const ICU4XBidi* self, const uint8_t* levels_data, size_t levels_len); - -bool ICU4XBidi_level_is_rtl(uint8_t level); - -bool ICU4XBidi_level_is_ltr(uint8_t level); - -uint8_t ICU4XBidi_level_rtl(); - -uint8_t ICU4XBidi_level_ltr(); -void ICU4XBidi_destroy(ICU4XBidi* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XBidiDirection.h b/third_party/rust/icu_capi/c/include/ICU4XBidiDirection.h deleted file mode 100644 index 33de81d6e9da..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XBidiDirection.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XBidiDirection_H -#define ICU4XBidiDirection_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XBidiDirection { - ICU4XBidiDirection_Ltr = 0, - ICU4XBidiDirection_Rtl = 1, - ICU4XBidiDirection_Mixed = 2, -} ICU4XBidiDirection; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XBidiDirection_destroy(ICU4XBidiDirection* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XBidiInfo.h b/third_party/rust/icu_capi/c/include/ICU4XBidiInfo.h deleted file mode 100644 index 02e8c21659a6..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XBidiInfo.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XBidiInfo_H -#define ICU4XBidiInfo_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XBidiInfo ICU4XBidiInfo; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XBidiParagraph.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -size_t ICU4XBidiInfo_paragraph_count(const ICU4XBidiInfo* self); - -ICU4XBidiParagraph* ICU4XBidiInfo_paragraph_at(const ICU4XBidiInfo* self, size_t n); - -size_t ICU4XBidiInfo_size(const ICU4XBidiInfo* self); - -uint8_t ICU4XBidiInfo_level_at(const ICU4XBidiInfo* self, size_t pos); -void ICU4XBidiInfo_destroy(ICU4XBidiInfo* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XBidiParagraph.h b/third_party/rust/icu_capi/c/include/ICU4XBidiParagraph.h deleted file mode 100644 index 269f940cc7d7..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XBidiParagraph.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ICU4XBidiParagraph_H -#define ICU4XBidiParagraph_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XBidiParagraph ICU4XBidiParagraph; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XBidiDirection.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_void_ICU4XError ICU4XBidiParagraph_set_paragraph_in_text(ICU4XBidiParagraph* self, size_t n); - -ICU4XBidiDirection ICU4XBidiParagraph_direction(const ICU4XBidiParagraph* self); - -size_t ICU4XBidiParagraph_size(const ICU4XBidiParagraph* self); - -size_t ICU4XBidiParagraph_range_start(const ICU4XBidiParagraph* self); - -size_t ICU4XBidiParagraph_range_end(const ICU4XBidiParagraph* self); - -diplomat_result_void_ICU4XError ICU4XBidiParagraph_reorder_line(const ICU4XBidiParagraph* self, size_t range_start, size_t range_end, DiplomatWriteable* out); - -uint8_t ICU4XBidiParagraph_level_at(const ICU4XBidiParagraph* self, size_t pos); -void ICU4XBidiParagraph_destroy(ICU4XBidiParagraph* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCalendar.h b/third_party/rust/icu_capi/c/include/ICU4XCalendar.h deleted file mode 100644 index 9ea6484b5f89..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCalendar.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XCalendar_H -#define ICU4XCalendar_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCalendar ICU4XCalendar; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XCalendar_ICU4XError.h" -#include "ICU4XAnyCalendarKind.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCalendar_ICU4XError ICU4XCalendar_create_for_locale(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XCalendar_ICU4XError ICU4XCalendar_create_for_kind(const ICU4XDataProvider* provider, ICU4XAnyCalendarKind kind); - -ICU4XAnyCalendarKind ICU4XCalendar_kind(const ICU4XCalendar* self); -void ICU4XCalendar_destroy(ICU4XCalendar* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCanonicalCombiningClassMap.h b/third_party/rust/icu_capi/c/include/ICU4XCanonicalCombiningClassMap.h deleted file mode 100644 index f0fc447ba0d4..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCanonicalCombiningClassMap.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XCanonicalCombiningClassMap_H -#define ICU4XCanonicalCombiningClassMap_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCanonicalCombiningClassMap ICU4XCanonicalCombiningClassMap; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError ICU4XCanonicalCombiningClassMap_create(const ICU4XDataProvider* provider); - -uint8_t ICU4XCanonicalCombiningClassMap_get(const ICU4XCanonicalCombiningClassMap* self, char32_t ch); - -uint8_t ICU4XCanonicalCombiningClassMap_get32(const ICU4XCanonicalCombiningClassMap* self, uint32_t ch); -void ICU4XCanonicalCombiningClassMap_destroy(ICU4XCanonicalCombiningClassMap* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCanonicalComposition.h b/third_party/rust/icu_capi/c/include/ICU4XCanonicalComposition.h deleted file mode 100644 index e9ae621739fb..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCanonicalComposition.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XCanonicalComposition_H -#define ICU4XCanonicalComposition_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCanonicalComposition ICU4XCanonicalComposition; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCanonicalComposition_ICU4XError ICU4XCanonicalComposition_create(const ICU4XDataProvider* provider); - -char32_t ICU4XCanonicalComposition_compose(const ICU4XCanonicalComposition* self, char32_t starter, char32_t second); -void ICU4XCanonicalComposition_destroy(ICU4XCanonicalComposition* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCanonicalDecomposition.h b/third_party/rust/icu_capi/c/include/ICU4XCanonicalDecomposition.h deleted file mode 100644 index d18d108b905e..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCanonicalDecomposition.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XCanonicalDecomposition_H -#define ICU4XCanonicalDecomposition_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCanonicalDecomposition ICU4XCanonicalDecomposition; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h" -#include "ICU4XDecomposed.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError ICU4XCanonicalDecomposition_create(const ICU4XDataProvider* provider); - -ICU4XDecomposed ICU4XCanonicalDecomposition_decompose(const ICU4XCanonicalDecomposition* self, char32_t c); -void ICU4XCanonicalDecomposition_destroy(ICU4XCanonicalDecomposition* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCodePointMapData16.h b/third_party/rust/icu_capi/c/include/ICU4XCodePointMapData16.h deleted file mode 100644 index 19effe2d921f..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCodePointMapData16.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ICU4XCodePointMapData16_H -#define ICU4XCodePointMapData16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCodePointMapData16 ICU4XCodePointMapData16; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIterator.h" -#include "ICU4XCodePointSetData.h" -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint16_t ICU4XCodePointMapData16_get(const ICU4XCodePointMapData16* self, char32_t cp); - -uint16_t ICU4XCodePointMapData16_get32(const ICU4XCodePointMapData16* self, uint32_t cp); - -CodePointRangeIterator* ICU4XCodePointMapData16_iter_ranges_for_value(const ICU4XCodePointMapData16* self, uint16_t value); - -CodePointRangeIterator* ICU4XCodePointMapData16_iter_ranges_for_value_complemented(const ICU4XCodePointMapData16* self, uint16_t value); - -ICU4XCodePointSetData* ICU4XCodePointMapData16_get_set_for_value(const ICU4XCodePointMapData16* self, uint16_t value); - -diplomat_result_box_ICU4XCodePointMapData16_ICU4XError ICU4XCodePointMapData16_load_script(const ICU4XDataProvider* provider); -void ICU4XCodePointMapData16_destroy(ICU4XCodePointMapData16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCodePointMapData8.h b/third_party/rust/icu_capi/c/include/ICU4XCodePointMapData8.h deleted file mode 100644 index 69a6a46b900a..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCodePointMapData8.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef ICU4XCodePointMapData8_H -#define ICU4XCodePointMapData8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCodePointMapData8 ICU4XCodePointMapData8; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIterator.h" -#include "ICU4XCodePointSetData.h" -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint8_t ICU4XCodePointMapData8_get(const ICU4XCodePointMapData8* self, char32_t cp); - -uint8_t ICU4XCodePointMapData8_get32(const ICU4XCodePointMapData8* self, uint32_t cp); - -uint32_t ICU4XCodePointMapData8_general_category_to_mask(uint8_t gc); - -CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_value(const ICU4XCodePointMapData8* self, uint8_t value); - -CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_value_complemented(const ICU4XCodePointMapData8* self, uint8_t value); - -CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_mask(const ICU4XCodePointMapData8* self, uint32_t mask); - -ICU4XCodePointSetData* ICU4XCodePointMapData8_get_set_for_value(const ICU4XCodePointMapData8* self, uint8_t value); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_general_category(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_bidi_class(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_east_asian_width(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_line_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_try_grapheme_cluster_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_word_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_sentence_break(const ICU4XDataProvider* provider); -void ICU4XCodePointMapData8_destroy(ICU4XCodePointMapData8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCodePointSetData.h b/third_party/rust/icu_capi/c/include/ICU4XCodePointSetData.h deleted file mode 100644 index 10356e90b7b5..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCodePointSetData.h +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef ICU4XCodePointSetData_H -#define ICU4XCodePointSetData_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCodePointSetData ICU4XCodePointSetData; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIterator.h" -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XCodePointSetData_contains(const ICU4XCodePointSetData* self, char32_t cp); - -bool ICU4XCodePointSetData_contains32(const ICU4XCodePointSetData* self, uint32_t cp); - -CodePointRangeIterator* ICU4XCodePointSetData_iter_ranges(const ICU4XCodePointSetData* self); - -CodePointRangeIterator* ICU4XCodePointSetData_iter_ranges_complemented(const ICU4XCodePointSetData* self); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_for_general_category_group(const ICU4XDataProvider* provider, uint32_t group); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ascii_hex_digit(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_alnum(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_alphabetic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_bidi_control(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_bidi_mirrored(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_blank(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_cased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_case_ignorable(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_full_composition_exclusion(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_casefolded(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_casemapped(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_lowercased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_titlecased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_uppercased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_dash(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_deprecated(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_default_ignorable_code_point(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_diacritic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_modifier_base(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_component(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_modifier(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_presentation(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_extender(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_extended_pictographic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_graph(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_base(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_extend(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_link(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_hex_digit(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_hyphen(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_id_continue(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ideographic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_id_start(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ids_binary_operator(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ids_trinary_operator(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_join_control(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_logical_order_exception(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_lowercase(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_math(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_noncharacter_code_point(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfc_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfd_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfkc_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfkd_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_pattern_syntax(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_pattern_white_space(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_prepended_concatenation_mark(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_print(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_quotation_mark(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_radical(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_regional_indicator(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_soft_dotted(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_segment_starter(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_case_sensitive(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_sentence_terminal(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_terminal_punctuation(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_unified_ideograph(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_uppercase(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_variation_selector(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_white_space(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xdigit(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xid_continue(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xid_start(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_for_ecma262(const ICU4XDataProvider* provider, const char* property_name_data, size_t property_name_len); -void ICU4XCodePointSetData_destroy(ICU4XCodePointSetData* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollator.h b/third_party/rust/icu_capi/c/include/ICU4XCollator.h deleted file mode 100644 index 973c2cedd96a..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollator.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XCollator_H -#define ICU4XCollator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCollator ICU4XCollator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XCollatorOptionsV1.h" -#include "diplomat_result_box_ICU4XCollator_ICU4XError.h" -#include "ICU4XOrdering.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCollator_ICU4XError ICU4XCollator_create_v1(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XCollatorOptionsV1 options); - -ICU4XOrdering ICU4XCollator_compare(const ICU4XCollator* self, const char* left_data, size_t left_len, const char* right_data, size_t right_len); - -ICU4XOrdering ICU4XCollator_compare_valid_utf8(const ICU4XCollator* self, const char* left_data, size_t left_len, const char* right_data, size_t right_len); - -ICU4XOrdering ICU4XCollator_compare_utf16(const ICU4XCollator* self, const uint16_t* left_data, size_t left_len, const uint16_t* right_data, size_t right_len); -void ICU4XCollator_destroy(ICU4XCollator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorAlternateHandling.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorAlternateHandling.h deleted file mode 100644 index dfc3d595eb2a..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorAlternateHandling.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorAlternateHandling_H -#define ICU4XCollatorAlternateHandling_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorAlternateHandling { - ICU4XCollatorAlternateHandling_Auto = 0, - ICU4XCollatorAlternateHandling_NonIgnorable = 1, - ICU4XCollatorAlternateHandling_Shifted = 2, -} ICU4XCollatorAlternateHandling; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorAlternateHandling_destroy(ICU4XCollatorAlternateHandling* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorBackwardSecondLevel.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorBackwardSecondLevel.h deleted file mode 100644 index 659f9b2f1093..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorBackwardSecondLevel.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorBackwardSecondLevel_H -#define ICU4XCollatorBackwardSecondLevel_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorBackwardSecondLevel { - ICU4XCollatorBackwardSecondLevel_Auto = 0, - ICU4XCollatorBackwardSecondLevel_Off = 1, - ICU4XCollatorBackwardSecondLevel_On = 2, -} ICU4XCollatorBackwardSecondLevel; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorBackwardSecondLevel_destroy(ICU4XCollatorBackwardSecondLevel* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorCaseFirst.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorCaseFirst.h deleted file mode 100644 index c01eb216d09d..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorCaseFirst.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XCollatorCaseFirst_H -#define ICU4XCollatorCaseFirst_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorCaseFirst { - ICU4XCollatorCaseFirst_Auto = 0, - ICU4XCollatorCaseFirst_Off = 1, - ICU4XCollatorCaseFirst_LowerFirst = 2, - ICU4XCollatorCaseFirst_UpperFirst = 3, -} ICU4XCollatorCaseFirst; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorCaseFirst_destroy(ICU4XCollatorCaseFirst* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorCaseLevel.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorCaseLevel.h deleted file mode 100644 index cbf686596775..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorCaseLevel.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorCaseLevel_H -#define ICU4XCollatorCaseLevel_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorCaseLevel { - ICU4XCollatorCaseLevel_Auto = 0, - ICU4XCollatorCaseLevel_Off = 1, - ICU4XCollatorCaseLevel_On = 2, -} ICU4XCollatorCaseLevel; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorCaseLevel_destroy(ICU4XCollatorCaseLevel* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorMaxVariable.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorMaxVariable.h deleted file mode 100644 index 0e5a3a516fec..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorMaxVariable.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XCollatorMaxVariable_H -#define ICU4XCollatorMaxVariable_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorMaxVariable { - ICU4XCollatorMaxVariable_Auto = 0, - ICU4XCollatorMaxVariable_Space = 1, - ICU4XCollatorMaxVariable_Punctuation = 2, - ICU4XCollatorMaxVariable_Symbol = 3, - ICU4XCollatorMaxVariable_Currency = 4, -} ICU4XCollatorMaxVariable; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorMaxVariable_destroy(ICU4XCollatorMaxVariable* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorNumeric.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorNumeric.h deleted file mode 100644 index 4dd2ec0408f2..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorNumeric.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorNumeric_H -#define ICU4XCollatorNumeric_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorNumeric { - ICU4XCollatorNumeric_Auto = 0, - ICU4XCollatorNumeric_Off = 1, - ICU4XCollatorNumeric_On = 2, -} ICU4XCollatorNumeric; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorNumeric_destroy(ICU4XCollatorNumeric* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorOptionsV1.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorOptionsV1.h deleted file mode 100644 index dc73557efe67..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorOptionsV1.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ICU4XCollatorOptionsV1_H -#define ICU4XCollatorOptionsV1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XCollatorStrength.h" -#include "ICU4XCollatorAlternateHandling.h" -#include "ICU4XCollatorCaseFirst.h" -#include "ICU4XCollatorMaxVariable.h" -#include "ICU4XCollatorCaseLevel.h" -#include "ICU4XCollatorNumeric.h" -#include "ICU4XCollatorBackwardSecondLevel.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCollatorOptionsV1 { - ICU4XCollatorStrength strength; - ICU4XCollatorAlternateHandling alternate_handling; - ICU4XCollatorCaseFirst case_first; - ICU4XCollatorMaxVariable max_variable; - ICU4XCollatorCaseLevel case_level; - ICU4XCollatorNumeric numeric; - ICU4XCollatorBackwardSecondLevel backward_second_level; -} ICU4XCollatorOptionsV1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XCollatorStrength.h" -#include "ICU4XCollatorAlternateHandling.h" -#include "ICU4XCollatorCaseFirst.h" -#include "ICU4XCollatorMaxVariable.h" -#include "ICU4XCollatorCaseLevel.h" -#include "ICU4XCollatorNumeric.h" -#include "ICU4XCollatorBackwardSecondLevel.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorOptionsV1_destroy(ICU4XCollatorOptionsV1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCollatorStrength.h b/third_party/rust/icu_capi/c/include/ICU4XCollatorStrength.h deleted file mode 100644 index f230214febad..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCollatorStrength.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XCollatorStrength_H -#define ICU4XCollatorStrength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorStrength { - ICU4XCollatorStrength_Auto = 0, - ICU4XCollatorStrength_Primary = 1, - ICU4XCollatorStrength_Secondary = 2, - ICU4XCollatorStrength_Tertiary = 3, - ICU4XCollatorStrength_Quaternary = 4, - ICU4XCollatorStrength_Identical = 5, -} ICU4XCollatorStrength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorStrength_destroy(ICU4XCollatorStrength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XComposingNormalizer.h b/third_party/rust/icu_capi/c/include/ICU4XComposingNormalizer.h deleted file mode 100644 index 1798af0d8e3e..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XComposingNormalizer.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XComposingNormalizer_H -#define ICU4XComposingNormalizer_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XComposingNormalizer ICU4XComposingNormalizer; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XComposingNormalizer_ICU4XError ICU4XComposingNormalizer_create_nfc(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XComposingNormalizer_ICU4XError ICU4XComposingNormalizer_create_nfkc(const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XComposingNormalizer_normalize(const ICU4XComposingNormalizer* self, const char* s_data, size_t s_len, DiplomatWriteable* write); - -bool ICU4XComposingNormalizer_is_normalized(const ICU4XComposingNormalizer* self, const char* s_data, size_t s_len); -void ICU4XComposingNormalizer_destroy(ICU4XComposingNormalizer* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XCustomTimeZone.h b/third_party/rust/icu_capi/c/include/ICU4XCustomTimeZone.h deleted file mode 100644 index fe6181a1049b..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XCustomTimeZone.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef ICU4XCustomTimeZone_H -#define ICU4XCustomTimeZone_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCustomTimeZone ICU4XCustomTimeZone; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#include "diplomat_result_int32_t_ICU4XError.h" -#include "diplomat_result_bool_ICU4XError.h" -#include "ICU4XMetazoneCalculator.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCustomTimeZone_ICU4XError ICU4XCustomTimeZone_create_from_string(const char* s_data, size_t s_len); - -ICU4XCustomTimeZone* ICU4XCustomTimeZone_create_empty(); - -ICU4XCustomTimeZone* ICU4XCustomTimeZone_create_utc(); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_gmt_offset_seconds(ICU4XCustomTimeZone* self, int32_t offset_seconds); - -void ICU4XCustomTimeZone_clear_gmt_offset(ICU4XCustomTimeZone* self); - -diplomat_result_int32_t_ICU4XError ICU4XCustomTimeZone_gmt_offset_seconds(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_gmt_offset_positive(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_gmt_offset_zero(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_gmt_offset_has_minutes(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_gmt_offset_has_seconds(const ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_time_zone_id(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len); - -void ICU4XCustomTimeZone_clear_time_zone_id(ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_time_zone_id(const ICU4XCustomTimeZone* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_metazone_id(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len); - -void ICU4XCustomTimeZone_clear_metazone_id(ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_metazone_id(const ICU4XCustomTimeZone* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_zone_variant(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len); - -void ICU4XCustomTimeZone_clear_zone_variant(ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_zone_variant(const ICU4XCustomTimeZone* self, DiplomatWriteable* write); - -void ICU4XCustomTimeZone_set_standard_time(ICU4XCustomTimeZone* self); - -void ICU4XCustomTimeZone_set_daylight_time(ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_standard_time(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_daylight_time(const ICU4XCustomTimeZone* self); - -void ICU4XCustomTimeZone_maybe_calculate_metazone(ICU4XCustomTimeZone* self, const ICU4XMetazoneCalculator* metazone_calculator, const ICU4XIsoDateTime* local_datetime); -void ICU4XCustomTimeZone_destroy(ICU4XCustomTimeZone* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDataProvider.h b/third_party/rust/icu_capi/c/include/ICU4XDataProvider.h deleted file mode 100644 index fd8b35b78778..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDataProvider.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ICU4XDataProvider_H -#define ICU4XDataProvider_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDataProvider ICU4XDataProvider; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XDataProvider_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XLocaleFallbacker.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDataProvider_ICU4XError ICU4XDataProvider_create_fs(const char* path_data, size_t path_len); - -ICU4XDataProvider* ICU4XDataProvider_create_test(); - -diplomat_result_box_ICU4XDataProvider_ICU4XError ICU4XDataProvider_create_from_byte_slice(const uint8_t* blob_data, size_t blob_len); - -ICU4XDataProvider* ICU4XDataProvider_create_empty(); - -diplomat_result_void_ICU4XError ICU4XDataProvider_fork_by_key(ICU4XDataProvider* self, ICU4XDataProvider* other); - -diplomat_result_void_ICU4XError ICU4XDataProvider_fork_by_locale(ICU4XDataProvider* self, ICU4XDataProvider* other); - -diplomat_result_void_ICU4XError ICU4XDataProvider_enable_locale_fallback(ICU4XDataProvider* self); - -diplomat_result_void_ICU4XError ICU4XDataProvider_enable_locale_fallback_with(ICU4XDataProvider* self, const ICU4XLocaleFallbacker* fallbacker); -void ICU4XDataProvider_destroy(ICU4XDataProvider* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDataStruct.h b/third_party/rust/icu_capi/c/include/ICU4XDataStruct.h deleted file mode 100644 index a07ff02fb8e4..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDataStruct.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XDataStruct_H -#define ICU4XDataStruct_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDataStruct ICU4XDataStruct; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XDataStruct_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDataStruct_ICU4XError ICU4XDataStruct_create_decimal_symbols_v1(const char* plus_sign_prefix_data, size_t plus_sign_prefix_len, const char* plus_sign_suffix_data, size_t plus_sign_suffix_len, const char* minus_sign_prefix_data, size_t minus_sign_prefix_len, const char* minus_sign_suffix_data, size_t minus_sign_suffix_len, const char* decimal_separator_data, size_t decimal_separator_len, const char* grouping_separator_data, size_t grouping_separator_len, uint8_t primary_group_size, uint8_t secondary_group_size, uint8_t min_group_size, const char32_t* digits_data, size_t digits_len); -void ICU4XDataStruct_destroy(ICU4XDataStruct* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDate.h b/third_party/rust/icu_capi/c/include/ICU4XDate.h deleted file mode 100644 index e88128678899..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDate.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef ICU4XDate_H -#define ICU4XDate_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDate ICU4XDate; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XCalendar.h" -#include "diplomat_result_box_ICU4XDate_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDate_ICU4XError ICU4XDate_create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, const ICU4XCalendar* calendar); - -diplomat_result_box_ICU4XDate_ICU4XError ICU4XDate_create_from_codes_in_calendar(const char* era_code_data, size_t era_code_len, int32_t year, const char* month_code_data, size_t month_code_len, uint8_t day, const ICU4XCalendar* calendar); - -ICU4XDate* ICU4XDate_to_calendar(const ICU4XDate* self, const ICU4XCalendar* calendar); - -ICU4XIsoDate* ICU4XDate_to_iso(const ICU4XDate* self); - -uint32_t ICU4XDate_day_of_month(const ICU4XDate* self); - -ICU4XIsoWeekday ICU4XDate_day_of_week(const ICU4XDate* self); - -uint32_t ICU4XDate_week_of_month(const ICU4XDate* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XDate_week_of_year(const ICU4XDate* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XDate_ordinal_month(const ICU4XDate* self); - -diplomat_result_void_ICU4XError ICU4XDate_month_code(const ICU4XDate* self, DiplomatWriteable* write); - -int32_t ICU4XDate_year_in_era(const ICU4XDate* self); - -diplomat_result_void_ICU4XError ICU4XDate_era(const ICU4XDate* self, DiplomatWriteable* write); - -uint8_t ICU4XDate_months_in_year(const ICU4XDate* self); - -uint8_t ICU4XDate_days_in_month(const ICU4XDate* self); - -uint32_t ICU4XDate_days_in_year(const ICU4XDate* self); - -ICU4XCalendar* ICU4XDate_calendar(const ICU4XDate* self); -void ICU4XDate_destroy(ICU4XDate* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDateFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XDateFormatter.h deleted file mode 100644 index 8dc5316e4789..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDateFormatter.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ICU4XDateFormatter_H -#define ICU4XDateFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDateFormatter ICU4XDateFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "diplomat_result_box_ICU4XDateFormatter_ICU4XError.h" -#include "ICU4XDate.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "ICU4XDateTime.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDateFormatter_ICU4XError ICU4XDateFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_date(const ICU4XDateFormatter* self, const ICU4XDate* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_iso_date(const ICU4XDateFormatter* self, const ICU4XIsoDate* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_datetime(const ICU4XDateFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_iso_datetime(const ICU4XDateFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XDateFormatter_destroy(ICU4XDateFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDateLength.h b/third_party/rust/icu_capi/c/include/ICU4XDateLength.h deleted file mode 100644 index b2ca91823365..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDateLength.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XDateLength_H -#define ICU4XDateLength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XDateLength { - ICU4XDateLength_Full = 0, - ICU4XDateLength_Long = 1, - ICU4XDateLength_Medium = 2, - ICU4XDateLength_Short = 3, -} ICU4XDateLength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDateLength_destroy(ICU4XDateLength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDateTime.h b/third_party/rust/icu_capi/c/include/ICU4XDateTime.h deleted file mode 100644 index a9dc1cee7160..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDateTime.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef ICU4XDateTime_H -#define ICU4XDateTime_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDateTime ICU4XDateTime; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XCalendar.h" -#include "diplomat_result_box_ICU4XDateTime_ICU4XError.h" -#include "ICU4XDate.h" -#include "ICU4XTime.h" -#include "ICU4XIsoDateTime.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDateTime_ICU4XError ICU4XDateTime_create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar* calendar); - -diplomat_result_box_ICU4XDateTime_ICU4XError ICU4XDateTime_create_from_codes_in_calendar(const char* era_code_data, size_t era_code_len, int32_t year, const char* month_code_data, size_t month_code_len, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar* calendar); - -ICU4XDateTime* ICU4XDateTime_create_from_date_and_time(const ICU4XDate* date, const ICU4XTime* time); - -ICU4XDate* ICU4XDateTime_date(const ICU4XDateTime* self); - -ICU4XTime* ICU4XDateTime_time(const ICU4XDateTime* self); - -ICU4XIsoDateTime* ICU4XDateTime_to_iso(const ICU4XDateTime* self); - -ICU4XDateTime* ICU4XDateTime_to_calendar(const ICU4XDateTime* self, const ICU4XCalendar* calendar); - -uint8_t ICU4XDateTime_hour(const ICU4XDateTime* self); - -uint8_t ICU4XDateTime_minute(const ICU4XDateTime* self); - -uint8_t ICU4XDateTime_second(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_nanosecond(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_day_of_month(const ICU4XDateTime* self); - -ICU4XIsoWeekday ICU4XDateTime_day_of_week(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_week_of_month(const ICU4XDateTime* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XDateTime_week_of_year(const ICU4XDateTime* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XDateTime_ordinal_month(const ICU4XDateTime* self); - -diplomat_result_void_ICU4XError ICU4XDateTime_month_code(const ICU4XDateTime* self, DiplomatWriteable* write); - -int32_t ICU4XDateTime_year_in_era(const ICU4XDateTime* self); - -diplomat_result_void_ICU4XError ICU4XDateTime_era(const ICU4XDateTime* self, DiplomatWriteable* write); - -uint8_t ICU4XDateTime_months_in_year(const ICU4XDateTime* self); - -uint8_t ICU4XDateTime_days_in_month(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_days_in_year(const ICU4XDateTime* self); - -ICU4XCalendar* ICU4XDateTime_calendar(const ICU4XDateTime* self); -void ICU4XDateTime_destroy(ICU4XDateTime* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDateTimeFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XDateTimeFormatter.h deleted file mode 100644 index 5f0af4ddba1e..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDateTimeFormatter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XDateTimeFormatter_H -#define ICU4XDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDateTimeFormatter ICU4XDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h" -#include "ICU4XDateTime.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError ICU4XDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_void_ICU4XError ICU4XDateTimeFormatter_format_datetime(const ICU4XDateTimeFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateTimeFormatter_format_iso_datetime(const ICU4XDateTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XDateTimeFormatter_destroy(ICU4XDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDecomposed.h b/third_party/rust/icu_capi/c/include/ICU4XDecomposed.h deleted file mode 100644 index 3f287e8192a9..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDecomposed.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XDecomposed_H -#define ICU4XDecomposed_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDecomposed { - char32_t first; - char32_t second; -} ICU4XDecomposed; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDecomposed_destroy(ICU4XDecomposed* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDecomposingNormalizer.h b/third_party/rust/icu_capi/c/include/ICU4XDecomposingNormalizer.h deleted file mode 100644 index f542f7a7302e..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDecomposingNormalizer.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XDecomposingNormalizer_H -#define ICU4XDecomposingNormalizer_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDecomposingNormalizer ICU4XDecomposingNormalizer; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError ICU4XDecomposingNormalizer_create_nfd(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError ICU4XDecomposingNormalizer_create_nfkd(const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XDecomposingNormalizer_normalize(const ICU4XDecomposingNormalizer* self, const char* s_data, size_t s_len, DiplomatWriteable* write); - -bool ICU4XDecomposingNormalizer_is_normalized(const ICU4XDecomposingNormalizer* self, const char* s_data, size_t s_len); -void ICU4XDecomposingNormalizer_destroy(ICU4XDecomposingNormalizer* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesFallback.h b/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesFallback.h deleted file mode 100644 index 085fc8de5dde..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesFallback.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XDisplayNamesFallback_H -#define ICU4XDisplayNamesFallback_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XDisplayNamesFallback { - ICU4XDisplayNamesFallback_Code = 0, - ICU4XDisplayNamesFallback_None = 1, -} ICU4XDisplayNamesFallback; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDisplayNamesFallback_destroy(ICU4XDisplayNamesFallback* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesOptionsV1.h b/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesOptionsV1.h deleted file mode 100644 index e998cde0e779..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesOptionsV1.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XDisplayNamesOptionsV1_H -#define ICU4XDisplayNamesOptionsV1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XDisplayNamesStyle.h" -#include "ICU4XDisplayNamesFallback.h" -#include "ICU4XLanguageDisplay.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDisplayNamesOptionsV1 { - ICU4XDisplayNamesStyle style; - ICU4XDisplayNamesFallback fallback; - ICU4XLanguageDisplay language_display; -} ICU4XDisplayNamesOptionsV1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDisplayNamesStyle.h" -#include "ICU4XDisplayNamesFallback.h" -#include "ICU4XLanguageDisplay.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDisplayNamesOptionsV1_destroy(ICU4XDisplayNamesOptionsV1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesStyle.h b/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesStyle.h deleted file mode 100644 index 048da455daf4..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XDisplayNamesStyle.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XDisplayNamesStyle_H -#define ICU4XDisplayNamesStyle_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XDisplayNamesStyle { - ICU4XDisplayNamesStyle_Auto = 0, - ICU4XDisplayNamesStyle_Narrow = 1, - ICU4XDisplayNamesStyle_Short = 2, - ICU4XDisplayNamesStyle_Long = 3, - ICU4XDisplayNamesStyle_Menu = 4, -} ICU4XDisplayNamesStyle; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDisplayNamesStyle_destroy(ICU4XDisplayNamesStyle* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XError.h b/third_party/rust/icu_capi/c/include/ICU4XError.h deleted file mode 100644 index 65e1c04a25c2..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XError.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef ICU4XError_H -#define ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XError { - ICU4XError_UnknownError = 0, - ICU4XError_WriteableError = 1, - ICU4XError_OutOfBoundsError = 2, - ICU4XError_DataMissingDataKeyError = 256, - ICU4XError_DataMissingVariantError = 257, - ICU4XError_DataMissingLocaleError = 258, - ICU4XError_DataNeedsVariantError = 259, - ICU4XError_DataNeedsLocaleError = 260, - ICU4XError_DataExtraneousLocaleError = 261, - ICU4XError_DataFilteredResourceError = 262, - ICU4XError_DataMismatchedTypeError = 263, - ICU4XError_DataMissingPayloadError = 264, - ICU4XError_DataInvalidStateError = 265, - ICU4XError_DataCustomError = 266, - ICU4XError_DataIoError = 267, - ICU4XError_DataUnavailableBufferFormatError = 268, - ICU4XError_DataMismatchedAnyBufferError = 269, - ICU4XError_LocaleUndefinedSubtagError = 512, - ICU4XError_LocaleParserLanguageError = 513, - ICU4XError_LocaleParserSubtagError = 514, - ICU4XError_LocaleParserExtensionError = 515, - ICU4XError_DataStructValidityError = 768, - ICU4XError_PropertyUnknownScriptIdError = 1024, - ICU4XError_PropertyUnknownGeneralCategoryGroupError = 1025, - ICU4XError_PropertyUnexpectedPropertyNameError = 1026, - ICU4XError_FixedDecimalLimitError = 1280, - ICU4XError_FixedDecimalSyntaxError = 1281, - ICU4XError_PluralsParserError = 1536, - ICU4XError_CalendarParseError = 1792, - ICU4XError_CalendarOverflowError = 1793, - ICU4XError_CalendarUnderflowError = 1794, - ICU4XError_CalendarOutOfRangeError = 1795, - ICU4XError_CalendarUnknownEraError = 1796, - ICU4XError_CalendarUnknownMonthCodeError = 1797, - ICU4XError_CalendarMissingInputError = 1798, - ICU4XError_CalendarUnknownKindError = 1799, - ICU4XError_CalendarMissingError = 1800, - ICU4XError_DateTimePatternError = 2048, - ICU4XError_DateTimeMissingInputFieldError = 2049, - ICU4XError_DateTimeSkeletonError = 2050, - ICU4XError_DateTimeUnsupportedFieldError = 2051, - ICU4XError_DateTimeUnsupportedOptionsError = 2052, - ICU4XError_DateTimeMissingWeekdaySymbolError = 2053, - ICU4XError_DateTimeMissingMonthSymbolError = 2054, - ICU4XError_DateTimeFixedDecimalError = 2055, - ICU4XError_DateTimeMismatchedCalendarError = 2056, - ICU4XError_TinyStrTooLargeError = 2304, - ICU4XError_TinyStrContainsNullError = 2305, - ICU4XError_TinyStrNonAsciiError = 2306, - ICU4XError_TimeZoneOffsetOutOfBoundsError = 2560, - ICU4XError_TimeZoneInvalidOffsetError = 2561, - ICU4XError_TimeZoneMissingInputError = 2562, - ICU4XError_NormalizerFutureExtensionError = 2816, - ICU4XError_NormalizerValidationError = 2817, -} ICU4XError; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XError_destroy(ICU4XError* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimal.h b/third_party/rust/icu_capi/c/include/ICU4XFixedDecimal.h deleted file mode 100644 index 361294b68748..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimal.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef ICU4XFixedDecimal_H -#define ICU4XFixedDecimal_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XFixedDecimal ICU4XFixedDecimal; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h" -#include "ICU4XFixedDecimalSign.h" -#include "ICU4XFixedDecimalSignDisplay.h" -#include "diplomat_result_void_void.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_i32(int32_t v); - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_u32(uint32_t v); - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_i64(int64_t v); - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_u64(uint64_t v); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_integer_precision(double f); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(double f, int16_t magnitude); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_significant_digits(double f, uint8_t digits); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_floating_precision(double f); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_string(const char* v_data, size_t v_len); - -uint8_t ICU4XFixedDecimal_digit_at(const ICU4XFixedDecimal* self, int16_t magnitude); - -int16_t ICU4XFixedDecimal_magnitude_start(const ICU4XFixedDecimal* self); - -int16_t ICU4XFixedDecimal_magnitude_end(const ICU4XFixedDecimal* self); - -int16_t ICU4XFixedDecimal_nonzero_magnitude_start(const ICU4XFixedDecimal* self); - -int16_t ICU4XFixedDecimal_nonzero_magnitude_end(const ICU4XFixedDecimal* self); - -bool ICU4XFixedDecimal_is_zero(const ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal* self, int16_t power); - -ICU4XFixedDecimalSign ICU4XFixedDecimal_sign(const ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_set_sign(ICU4XFixedDecimal* self, ICU4XFixedDecimalSign sign); - -void ICU4XFixedDecimal_apply_sign_display(ICU4XFixedDecimal* self, ICU4XFixedDecimalSignDisplay sign_display); - -void ICU4XFixedDecimal_trim_start(ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_trim_end(ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_pad_start(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_pad_end(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_set_max_position(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_trunc(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_trunc(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_expand(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_expand(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_ceil(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_ceil(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_floor(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_floor(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_even(ICU4XFixedDecimal* self, int16_t position); - -diplomat_result_void_void ICU4XFixedDecimal_concatenate_end(ICU4XFixedDecimal* self, ICU4XFixedDecimal* other); - -void ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal* self, DiplomatWriteable* to); -void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalFormatter.h deleted file mode 100644 index aa1cfd6a48c5..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalFormatter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XFixedDecimalFormatter_H -#define ICU4XFixedDecimalFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XFixedDecimalFormatter ICU4XFixedDecimalFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XFixedDecimalGroupingStrategy.h" -#include "diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h" -#include "ICU4XDataStruct.h" -#include "ICU4XFixedDecimal.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError ICU4XFixedDecimalFormatter_create_with_grouping_strategy(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XFixedDecimalGroupingStrategy grouping_strategy); - -diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError ICU4XFixedDecimalFormatter_create_with_decimal_symbols_v1(const ICU4XDataStruct* data_struct, ICU4XFixedDecimalGroupingStrategy grouping_strategy); - -diplomat_result_void_ICU4XError ICU4XFixedDecimalFormatter_format(const ICU4XFixedDecimalFormatter* self, const ICU4XFixedDecimal* value, DiplomatWriteable* write); -void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalGroupingStrategy.h b/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalGroupingStrategy.h deleted file mode 100644 index 7648892cc5bb..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalGroupingStrategy.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XFixedDecimalGroupingStrategy_H -#define ICU4XFixedDecimalGroupingStrategy_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XFixedDecimalGroupingStrategy { - ICU4XFixedDecimalGroupingStrategy_Auto = 0, - ICU4XFixedDecimalGroupingStrategy_Never = 1, - ICU4XFixedDecimalGroupingStrategy_Always = 2, - ICU4XFixedDecimalGroupingStrategy_Min2 = 3, -} ICU4XFixedDecimalGroupingStrategy; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XFixedDecimalGroupingStrategy_destroy(ICU4XFixedDecimalGroupingStrategy* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalSign.h b/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalSign.h deleted file mode 100644 index 12fff3cf1cee..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalSign.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XFixedDecimalSign_H -#define ICU4XFixedDecimalSign_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XFixedDecimalSign { - ICU4XFixedDecimalSign_None = 0, - ICU4XFixedDecimalSign_Negative = 1, - ICU4XFixedDecimalSign_Positive = 2, -} ICU4XFixedDecimalSign; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XFixedDecimalSign_destroy(ICU4XFixedDecimalSign* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalSignDisplay.h b/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalSignDisplay.h deleted file mode 100644 index 8c2612e51628..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XFixedDecimalSignDisplay.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XFixedDecimalSignDisplay_H -#define ICU4XFixedDecimalSignDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XFixedDecimalSignDisplay { - ICU4XFixedDecimalSignDisplay_Auto = 0, - ICU4XFixedDecimalSignDisplay_Never = 1, - ICU4XFixedDecimalSignDisplay_Always = 2, - ICU4XFixedDecimalSignDisplay_ExceptZero = 3, - ICU4XFixedDecimalSignDisplay_Negative = 4, -} ICU4XFixedDecimalSignDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XFixedDecimalSignDisplay_destroy(ICU4XFixedDecimalSignDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGeneralCategoryNameToMaskMapper.h b/third_party/rust/icu_capi/c/include/ICU4XGeneralCategoryNameToMaskMapper.h deleted file mode 100644 index 3a4e2d4d13aa..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGeneralCategoryNameToMaskMapper.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XGeneralCategoryNameToMaskMapper_H -#define ICU4XGeneralCategoryNameToMaskMapper_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGeneralCategoryNameToMaskMapper ICU4XGeneralCategoryNameToMaskMapper; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint32_t ICU4XGeneralCategoryNameToMaskMapper_get_strict(const ICU4XGeneralCategoryNameToMaskMapper* self, const char* name_data, size_t name_len); - -uint32_t ICU4XGeneralCategoryNameToMaskMapper_get_loose(const ICU4XGeneralCategoryNameToMaskMapper* self, const char* name_data, size_t name_len); - -diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError ICU4XGeneralCategoryNameToMaskMapper_load(const ICU4XDataProvider* provider); -void ICU4XGeneralCategoryNameToMaskMapper_destroy(ICU4XGeneralCategoryNameToMaskMapper* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorLatin1.h b/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorLatin1.h deleted file mode 100644 index 9e23489fd3dd..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorLatin1.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorLatin1_H -#define ICU4XGraphemeClusterBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterBreakIteratorLatin1 ICU4XGraphemeClusterBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XGraphemeClusterBreakIteratorLatin1_next(ICU4XGraphemeClusterBreakIteratorLatin1* self); -void ICU4XGraphemeClusterBreakIteratorLatin1_destroy(ICU4XGraphemeClusterBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorUtf16.h b/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorUtf16.h deleted file mode 100644 index f0de4c0214d6..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorUtf16.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorUtf16_H -#define ICU4XGraphemeClusterBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterBreakIteratorUtf16 ICU4XGraphemeClusterBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XGraphemeClusterBreakIteratorUtf16_next(ICU4XGraphemeClusterBreakIteratorUtf16* self); -void ICU4XGraphemeClusterBreakIteratorUtf16_destroy(ICU4XGraphemeClusterBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorUtf8.h b/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorUtf8.h deleted file mode 100644 index 331b17eac783..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterBreakIteratorUtf8.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorUtf8_H -#define ICU4XGraphemeClusterBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterBreakIteratorUtf8 ICU4XGraphemeClusterBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XGraphemeClusterBreakIteratorUtf8_next(ICU4XGraphemeClusterBreakIteratorUtf8* self); -void ICU4XGraphemeClusterBreakIteratorUtf8_destroy(ICU4XGraphemeClusterBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterSegmenter.h b/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterSegmenter.h deleted file mode 100644 index 1805090bfbdc..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGraphemeClusterSegmenter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XGraphemeClusterSegmenter_H -#define ICU4XGraphemeClusterSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterSegmenter ICU4XGraphemeClusterSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h" -#include "ICU4XGraphemeClusterBreakIteratorUtf8.h" -#include "ICU4XGraphemeClusterBreakIteratorUtf16.h" -#include "ICU4XGraphemeClusterBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError ICU4XGraphemeClusterSegmenter_create(const ICU4XDataProvider* provider); - -ICU4XGraphemeClusterBreakIteratorUtf8* ICU4XGraphemeClusterSegmenter_segment_utf8(const ICU4XGraphemeClusterSegmenter* self, const char* input_data, size_t input_len); - -ICU4XGraphemeClusterBreakIteratorUtf16* ICU4XGraphemeClusterSegmenter_segment_utf16(const ICU4XGraphemeClusterSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XGraphemeClusterBreakIteratorLatin1* ICU4XGraphemeClusterSegmenter_segment_latin1(const ICU4XGraphemeClusterSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XGraphemeClusterSegmenter_destroy(ICU4XGraphemeClusterSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGregorianDateFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XGregorianDateFormatter.h deleted file mode 100644 index cf3ad9e9f4ae..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGregorianDateFormatter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XGregorianDateFormatter_H -#define ICU4XGregorianDateFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGregorianDateFormatter ICU4XGregorianDateFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError ICU4XGregorianDateFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength length); - -diplomat_result_void_ICU4XError ICU4XGregorianDateFormatter_format_iso_date(const ICU4XGregorianDateFormatter* self, const ICU4XIsoDate* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XGregorianDateFormatter_format_iso_datetime(const ICU4XGregorianDateFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XGregorianDateFormatter_destroy(ICU4XGregorianDateFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGregorianDateTimeFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XGregorianDateTimeFormatter.h deleted file mode 100644 index 0b56ddc3934b..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGregorianDateTimeFormatter.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XGregorianDateTimeFormatter_H -#define ICU4XGregorianDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGregorianDateTimeFormatter ICU4XGregorianDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError ICU4XGregorianDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_void_ICU4XError ICU4XGregorianDateTimeFormatter_format_iso_datetime(const ICU4XGregorianDateTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XGregorianDateTimeFormatter_destroy(ICU4XGregorianDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XGregorianZonedDateTimeFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XGregorianZonedDateTimeFormatter.h deleted file mode 100644 index 4be60c2b0b27..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XGregorianZonedDateTimeFormatter.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef ICU4XGregorianZonedDateTimeFormatter_H -#define ICU4XGregorianZonedDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGregorianZonedDateTimeFormatter ICU4XGregorianZonedDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h" -#include "ICU4XIsoTimeZoneOptions.h" -#include "ICU4XIsoDateTime.h" -#include "ICU4XCustomTimeZone.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options); - -diplomat_result_void_ICU4XError ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(const ICU4XGregorianZonedDateTimeFormatter* self, const ICU4XIsoDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write); -void ICU4XGregorianZonedDateTimeFormatter_destroy(ICU4XGregorianZonedDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoDate.h b/third_party/rust/icu_capi/c/include/ICU4XIsoDate.h deleted file mode 100644 index aadc7590bad9..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoDate.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef ICU4XIsoDate_H -#define ICU4XIsoDate_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XIsoDate ICU4XIsoDate; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XIsoDate_ICU4XError.h" -#include "ICU4XCalendar.h" -#include "ICU4XDate.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XIsoDate_ICU4XError ICU4XIsoDate_create(int32_t year, uint8_t month, uint8_t day); - -ICU4XDate* ICU4XIsoDate_to_calendar(const ICU4XIsoDate* self, const ICU4XCalendar* calendar); - -ICU4XDate* ICU4XIsoDate_to_any(const ICU4XIsoDate* self); - -uint32_t ICU4XIsoDate_day_of_month(const ICU4XIsoDate* self); - -ICU4XIsoWeekday ICU4XIsoDate_day_of_week(const ICU4XIsoDate* self); - -uint32_t ICU4XIsoDate_week_of_month(const ICU4XIsoDate* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XIsoDate_week_of_year(const ICU4XIsoDate* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XIsoDate_month(const ICU4XIsoDate* self); - -int32_t ICU4XIsoDate_year(const ICU4XIsoDate* self); - -uint8_t ICU4XIsoDate_months_in_year(const ICU4XIsoDate* self); - -uint8_t ICU4XIsoDate_days_in_month(const ICU4XIsoDate* self); - -uint32_t ICU4XIsoDate_days_in_year(const ICU4XIsoDate* self); -void ICU4XIsoDate_destroy(ICU4XIsoDate* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoDateTime.h b/third_party/rust/icu_capi/c/include/ICU4XIsoDateTime.h deleted file mode 100644 index 6f1a2acbe2d6..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoDateTime.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef ICU4XIsoDateTime_H -#define ICU4XIsoDateTime_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XIsoDateTime ICU4XIsoDateTime; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "ICU4XTime.h" -#include "ICU4XDateTime.h" -#include "ICU4XCalendar.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XIsoDateTime_ICU4XError ICU4XIsoDateTime_create(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond); - -ICU4XIsoDateTime* ICU4XIsoDateTime_crate_from_date_and_time(const ICU4XIsoDate* date, const ICU4XTime* time); - -ICU4XIsoDateTime* ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(int32_t minutes); - -ICU4XIsoDate* ICU4XIsoDateTime_date(const ICU4XIsoDateTime* self); - -ICU4XTime* ICU4XIsoDateTime_time(const ICU4XIsoDateTime* self); - -ICU4XDateTime* ICU4XIsoDateTime_to_any(const ICU4XIsoDateTime* self); - -int32_t ICU4XIsoDateTime_minutes_since_local_unix_epoch(const ICU4XIsoDateTime* self); - -ICU4XDateTime* ICU4XIsoDateTime_to_calendar(const ICU4XIsoDateTime* self, const ICU4XCalendar* calendar); - -uint8_t ICU4XIsoDateTime_hour(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_minute(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_second(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_nanosecond(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_day_of_month(const ICU4XIsoDateTime* self); - -ICU4XIsoWeekday ICU4XIsoDateTime_day_of_week(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_week_of_month(const ICU4XIsoDateTime* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XIsoDateTime_week_of_year(const ICU4XIsoDateTime* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XIsoDateTime_month(const ICU4XIsoDateTime* self); - -int32_t ICU4XIsoDateTime_year(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_months_in_year(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_days_in_month(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_days_in_year(const ICU4XIsoDateTime* self); -void ICU4XIsoDateTime_destroy(ICU4XIsoDateTime* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneFormat.h b/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneFormat.h deleted file mode 100644 index e48a1142f213..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneFormat.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XIsoTimeZoneFormat_H -#define ICU4XIsoTimeZoneFormat_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoTimeZoneFormat { - ICU4XIsoTimeZoneFormat_Basic = 0, - ICU4XIsoTimeZoneFormat_Extended = 1, - ICU4XIsoTimeZoneFormat_UtcBasic = 2, - ICU4XIsoTimeZoneFormat_UtcExtended = 3, -} ICU4XIsoTimeZoneFormat; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneFormat_destroy(ICU4XIsoTimeZoneFormat* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneMinuteDisplay.h b/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneMinuteDisplay.h deleted file mode 100644 index edeee9701913..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneMinuteDisplay.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XIsoTimeZoneMinuteDisplay_H -#define ICU4XIsoTimeZoneMinuteDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoTimeZoneMinuteDisplay { - ICU4XIsoTimeZoneMinuteDisplay_Required = 0, - ICU4XIsoTimeZoneMinuteDisplay_Optional = 1, -} ICU4XIsoTimeZoneMinuteDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneMinuteDisplay_destroy(ICU4XIsoTimeZoneMinuteDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneOptions.h b/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneOptions.h deleted file mode 100644 index 7ba051c3e617..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneOptions.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XIsoTimeZoneOptions_H -#define ICU4XIsoTimeZoneOptions_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XIsoTimeZoneFormat.h" -#include "ICU4XIsoTimeZoneMinuteDisplay.h" -#include "ICU4XIsoTimeZoneSecondDisplay.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XIsoTimeZoneOptions { - ICU4XIsoTimeZoneFormat format; - ICU4XIsoTimeZoneMinuteDisplay minutes; - ICU4XIsoTimeZoneSecondDisplay seconds; -} ICU4XIsoTimeZoneOptions; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XIsoTimeZoneFormat.h" -#include "ICU4XIsoTimeZoneMinuteDisplay.h" -#include "ICU4XIsoTimeZoneSecondDisplay.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneOptions_destroy(ICU4XIsoTimeZoneOptions* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneSecondDisplay.h b/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneSecondDisplay.h deleted file mode 100644 index 487a248f958a..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoTimeZoneSecondDisplay.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XIsoTimeZoneSecondDisplay_H -#define ICU4XIsoTimeZoneSecondDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoTimeZoneSecondDisplay { - ICU4XIsoTimeZoneSecondDisplay_Optional = 0, - ICU4XIsoTimeZoneSecondDisplay_Never = 1, -} ICU4XIsoTimeZoneSecondDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneSecondDisplay_destroy(ICU4XIsoTimeZoneSecondDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XIsoWeekday.h b/third_party/rust/icu_capi/c/include/ICU4XIsoWeekday.h deleted file mode 100644 index a23d0a3b9e92..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XIsoWeekday.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XIsoWeekday_H -#define ICU4XIsoWeekday_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoWeekday { - ICU4XIsoWeekday_Monday = 1, - ICU4XIsoWeekday_Tuesday = 2, - ICU4XIsoWeekday_Wednesday = 3, - ICU4XIsoWeekday_Thursday = 4, - ICU4XIsoWeekday_Friday = 5, - ICU4XIsoWeekday_Saturday = 6, - ICU4XIsoWeekday_Sunday = 7, -} ICU4XIsoWeekday; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoWeekday_destroy(ICU4XIsoWeekday* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLanguageDisplay.h b/third_party/rust/icu_capi/c/include/ICU4XLanguageDisplay.h deleted file mode 100644 index 0b921351fefa..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLanguageDisplay.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XLanguageDisplay_H -#define ICU4XLanguageDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLanguageDisplay { - ICU4XLanguageDisplay_Dialect = 0, - ICU4XLanguageDisplay_Standard = 1, -} ICU4XLanguageDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLanguageDisplay_destroy(ICU4XLanguageDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorLatin1.h b/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorLatin1.h deleted file mode 100644 index c1a4c391318f..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorLatin1.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLineBreakIteratorLatin1_H -#define ICU4XLineBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakIteratorLatin1 ICU4XLineBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XLineBreakIteratorLatin1_next(ICU4XLineBreakIteratorLatin1* self); -void ICU4XLineBreakIteratorLatin1_destroy(ICU4XLineBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorUtf16.h b/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorUtf16.h deleted file mode 100644 index 78ae12c7e4b4..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorUtf16.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLineBreakIteratorUtf16_H -#define ICU4XLineBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakIteratorUtf16 ICU4XLineBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XLineBreakIteratorUtf16_next(ICU4XLineBreakIteratorUtf16* self); -void ICU4XLineBreakIteratorUtf16_destroy(ICU4XLineBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorUtf8.h b/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorUtf8.h deleted file mode 100644 index 3a08c5ad232b..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineBreakIteratorUtf8.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLineBreakIteratorUtf8_H -#define ICU4XLineBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakIteratorUtf8 ICU4XLineBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XLineBreakIteratorUtf8_next(ICU4XLineBreakIteratorUtf8* self); -void ICU4XLineBreakIteratorUtf8_destroy(ICU4XLineBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineBreakOptionsV1.h b/third_party/rust/icu_capi/c/include/ICU4XLineBreakOptionsV1.h deleted file mode 100644 index 5fbf4b581426..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineBreakOptionsV1.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XLineBreakOptionsV1_H -#define ICU4XLineBreakOptionsV1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XLineBreakStrictness.h" -#include "ICU4XLineBreakWordOption.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakOptionsV1 { - ICU4XLineBreakStrictness strictness; - ICU4XLineBreakWordOption word_option; - bool ja_zh; -} ICU4XLineBreakOptionsV1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLineBreakStrictness.h" -#include "ICU4XLineBreakWordOption.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLineBreakOptionsV1_destroy(ICU4XLineBreakOptionsV1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineBreakStrictness.h b/third_party/rust/icu_capi/c/include/ICU4XLineBreakStrictness.h deleted file mode 100644 index e3534b7ec733..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineBreakStrictness.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XLineBreakStrictness_H -#define ICU4XLineBreakStrictness_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLineBreakStrictness { - ICU4XLineBreakStrictness_Loose = 0, - ICU4XLineBreakStrictness_Normal = 1, - ICU4XLineBreakStrictness_Strict = 2, - ICU4XLineBreakStrictness_Anywhere = 3, -} ICU4XLineBreakStrictness; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLineBreakStrictness_destroy(ICU4XLineBreakStrictness* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineBreakWordOption.h b/third_party/rust/icu_capi/c/include/ICU4XLineBreakWordOption.h deleted file mode 100644 index 02a6ca6f2d41..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineBreakWordOption.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XLineBreakWordOption_H -#define ICU4XLineBreakWordOption_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLineBreakWordOption { - ICU4XLineBreakWordOption_Normal = 0, - ICU4XLineBreakWordOption_BreakAll = 1, - ICU4XLineBreakWordOption_KeepAll = 2, -} ICU4XLineBreakWordOption; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLineBreakWordOption_destroy(ICU4XLineBreakWordOption* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLineSegmenter.h b/third_party/rust/icu_capi/c/include/ICU4XLineSegmenter.h deleted file mode 100644 index f734ec78f827..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLineSegmenter.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef ICU4XLineSegmenter_H -#define ICU4XLineSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineSegmenter ICU4XLineSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h" -#include "ICU4XLineBreakOptionsV1.h" -#include "ICU4XLineBreakIteratorUtf8.h" -#include "ICU4XLineBreakIteratorUtf16.h" -#include "ICU4XLineBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_auto(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_lstm(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_dictionary(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_auto_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_lstm_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_dictionary_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options); - -ICU4XLineBreakIteratorUtf8* ICU4XLineSegmenter_segment_utf8(const ICU4XLineSegmenter* self, const char* input_data, size_t input_len); - -ICU4XLineBreakIteratorUtf16* ICU4XLineSegmenter_segment_utf16(const ICU4XLineSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XLineBreakIteratorLatin1* ICU4XLineSegmenter_segment_latin1(const ICU4XLineSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XLineSegmenter_destroy(ICU4XLineSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XList.h b/third_party/rust/icu_capi/c/include/ICU4XList.h deleted file mode 100644 index 6549561c37ba..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XList.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XList_H -#define ICU4XList_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XList ICU4XList; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XList* ICU4XList_create(); - -ICU4XList* ICU4XList_create_with_capacity(size_t capacity); - -void ICU4XList_push(ICU4XList* self, const char* val_data, size_t val_len); - -size_t ICU4XList_len(const ICU4XList* self); -void ICU4XList_destroy(ICU4XList* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XListFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XListFormatter.h deleted file mode 100644 index ee358dc254cc..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XListFormatter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XListFormatter_H -#define ICU4XListFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XListFormatter ICU4XListFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XListLength.h" -#include "diplomat_result_box_ICU4XListFormatter_ICU4XError.h" -#include "ICU4XList.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_and_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length); - -diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_or_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length); - -diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_unit_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length); - -diplomat_result_void_ICU4XError ICU4XListFormatter_format(const ICU4XListFormatter* self, const ICU4XList* list, DiplomatWriteable* write); -void ICU4XListFormatter_destroy(ICU4XListFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XListLength.h b/third_party/rust/icu_capi/c/include/ICU4XListLength.h deleted file mode 100644 index 7092f6d9dfd7..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XListLength.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XListLength_H -#define ICU4XListLength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XListLength { - ICU4XListLength_Wide = 0, - ICU4XListLength_Short = 1, - ICU4XListLength_Narrow = 2, -} ICU4XListLength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XListLength_destroy(ICU4XListLength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocale.h b/third_party/rust/icu_capi/c/include/ICU4XLocale.h deleted file mode 100644 index dea8d196b5cd..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocale.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef ICU4XLocale_H -#define ICU4XLocale_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocale ICU4XLocale; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XLocale_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XOrdering.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocale_ICU4XError ICU4XLocale_create_from_string(const char* name_data, size_t name_len); - -ICU4XLocale* ICU4XLocale_create_und(); - -ICU4XLocale* ICU4XLocale_clone(const ICU4XLocale* self); - -diplomat_result_void_ICU4XError ICU4XLocale_basename(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_get_unicode_extension(const ICU4XLocale* self, const char* bytes_data, size_t bytes_len, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_language(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_set_language(ICU4XLocale* self, const char* bytes_data, size_t bytes_len); - -diplomat_result_void_ICU4XError ICU4XLocale_region(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_set_region(ICU4XLocale* self, const char* bytes_data, size_t bytes_len); - -diplomat_result_void_ICU4XError ICU4XLocale_script(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_set_script(ICU4XLocale* self, const char* bytes_data, size_t bytes_len); - -diplomat_result_void_ICU4XError ICU4XLocale_canonicalize(const char* bytes_data, size_t bytes_len, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_to_string(const ICU4XLocale* self, DiplomatWriteable* write); - -bool ICU4XLocale_normalizing_eq(const ICU4XLocale* self, const char* other_data, size_t other_len); - -ICU4XOrdering ICU4XLocale_strict_cmp(const ICU4XLocale* self, const char* other_data, size_t other_len); - -ICU4XLocale* ICU4XLocale_create_en(); - -ICU4XLocale* ICU4XLocale_create_bn(); -void ICU4XLocale_destroy(ICU4XLocale* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleCanonicalizer.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleCanonicalizer.h deleted file mode 100644 index 8b48ad8bb602..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleCanonicalizer.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XLocaleCanonicalizer_H -#define ICU4XLocaleCanonicalizer_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleCanonicalizer ICU4XLocaleCanonicalizer; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h" -#include "ICU4XLocale.h" -#include "ICU4XTransformResult.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError ICU4XLocaleCanonicalizer_create(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError ICU4XLocaleCanonicalizer_create_extended(const ICU4XDataProvider* provider); - -ICU4XTransformResult ICU4XLocaleCanonicalizer_canonicalize(const ICU4XLocaleCanonicalizer* self, ICU4XLocale* locale); -void ICU4XLocaleCanonicalizer_destroy(ICU4XLocaleCanonicalizer* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleDisplayNamesFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleDisplayNamesFormatter.h deleted file mode 100644 index 0e164017f485..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleDisplayNamesFormatter.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XLocaleDisplayNamesFormatter_H -#define ICU4XLocaleDisplayNamesFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleDisplayNamesFormatter ICU4XLocaleDisplayNamesFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDisplayNamesOptionsV1.h" -#include "diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError ICU4XLocaleDisplayNamesFormatter_try_new_unstable(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDisplayNamesOptionsV1 options); - -diplomat_result_void_ICU4XError ICU4XLocaleDisplayNamesFormatter_of(const ICU4XLocaleDisplayNamesFormatter* self, const ICU4XLocale* locale, DiplomatWriteable* write); -void ICU4XLocaleDisplayNamesFormatter_destroy(ICU4XLocaleDisplayNamesFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleExpander.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleExpander.h deleted file mode 100644 index a7de7be16b91..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleExpander.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef ICU4XLocaleExpander_H -#define ICU4XLocaleExpander_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleExpander ICU4XLocaleExpander; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h" -#include "ICU4XLocale.h" -#include "ICU4XTransformResult.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleExpander_ICU4XError ICU4XLocaleExpander_create(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLocaleExpander_ICU4XError ICU4XLocaleExpander_create_extended(const ICU4XDataProvider* provider); - -ICU4XTransformResult ICU4XLocaleExpander_maximize(const ICU4XLocaleExpander* self, ICU4XLocale* locale); - -ICU4XTransformResult ICU4XLocaleExpander_minimize(const ICU4XLocaleExpander* self, ICU4XLocale* locale); -void ICU4XLocaleExpander_destroy(ICU4XLocaleExpander* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackConfig.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackConfig.h deleted file mode 100644 index b3741e6bf0f5..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackConfig.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XLocaleFallbackConfig_H -#define ICU4XLocaleFallbackConfig_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XLocaleFallbackPriority.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbackConfig { - ICU4XLocaleFallbackPriority priority; - DiplomatStringView extension_key; -} ICU4XLocaleFallbackConfig; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocaleFallbackPriority.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLocaleFallbackConfig_destroy(ICU4XLocaleFallbackConfig* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackIterator.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackIterator.h deleted file mode 100644 index e2dd7a1a3bab..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackIterator.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XLocaleFallbackIterator_H -#define ICU4XLocaleFallbackIterator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbackIterator ICU4XLocaleFallbackIterator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocale.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XLocale* ICU4XLocaleFallbackIterator_get(const ICU4XLocaleFallbackIterator* self); - -void ICU4XLocaleFallbackIterator_step(ICU4XLocaleFallbackIterator* self); -void ICU4XLocaleFallbackIterator_destroy(ICU4XLocaleFallbackIterator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackPriority.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackPriority.h deleted file mode 100644 index e4ab748065c8..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackPriority.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XLocaleFallbackPriority_H -#define ICU4XLocaleFallbackPriority_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLocaleFallbackPriority { - ICU4XLocaleFallbackPriority_Language = 0, - ICU4XLocaleFallbackPriority_Region = 1, - ICU4XLocaleFallbackPriority_Collation = 2, -} ICU4XLocaleFallbackPriority; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLocaleFallbackPriority_destroy(ICU4XLocaleFallbackPriority* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbacker.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbacker.h deleted file mode 100644 index 24efb0602f66..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbacker.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XLocaleFallbacker_H -#define ICU4XLocaleFallbacker_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbacker ICU4XLocaleFallbacker; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h" -#include "ICU4XLocaleFallbackConfig.h" -#include "diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError ICU4XLocaleFallbacker_create(const ICU4XDataProvider* provider); - -ICU4XLocaleFallbacker* ICU4XLocaleFallbacker_create_without_data(); - -diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError ICU4XLocaleFallbacker_for_config(const ICU4XLocaleFallbacker* self, ICU4XLocaleFallbackConfig config); -void ICU4XLocaleFallbacker_destroy(ICU4XLocaleFallbacker* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackerWithConfig.h b/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackerWithConfig.h deleted file mode 100644 index e8baa9563e86..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLocaleFallbackerWithConfig.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XLocaleFallbackerWithConfig_H -#define ICU4XLocaleFallbackerWithConfig_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbackerWithConfig ICU4XLocaleFallbackerWithConfig; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocale.h" -#include "ICU4XLocaleFallbackIterator.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XLocaleFallbackIterator* ICU4XLocaleFallbackerWithConfig_fallback_for_locale(const ICU4XLocaleFallbackerWithConfig* self, const ICU4XLocale* locale); -void ICU4XLocaleFallbackerWithConfig_destroy(ICU4XLocaleFallbackerWithConfig* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XLogger.h b/third_party/rust/icu_capi/c/include/ICU4XLogger.h deleted file mode 100644 index 3c3a1b8fa321..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XLogger.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLogger_H -#define ICU4XLogger_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLogger ICU4XLogger; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XLogger_init_simple_logger(); -void ICU4XLogger_destroy(ICU4XLogger* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XMetazoneCalculator.h b/third_party/rust/icu_capi/c/include/ICU4XMetazoneCalculator.h deleted file mode 100644 index 9c66754e90eb..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XMetazoneCalculator.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XMetazoneCalculator_H -#define ICU4XMetazoneCalculator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XMetazoneCalculator ICU4XMetazoneCalculator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError ICU4XMetazoneCalculator_create(const ICU4XDataProvider* provider); -void ICU4XMetazoneCalculator_destroy(ICU4XMetazoneCalculator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XOrdering.h b/third_party/rust/icu_capi/c/include/ICU4XOrdering.h deleted file mode 100644 index 2c1885f43e2b..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XOrdering.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XOrdering_H -#define ICU4XOrdering_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XOrdering { - ICU4XOrdering_Less = -1, - ICU4XOrdering_Equal = 0, - ICU4XOrdering_Greater = 1, -} ICU4XOrdering; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XOrdering_destroy(ICU4XOrdering* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XPluralCategories.h b/third_party/rust/icu_capi/c/include/ICU4XPluralCategories.h deleted file mode 100644 index 931ea2daa794..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XPluralCategories.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XPluralCategories_H -#define ICU4XPluralCategories_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPluralCategories { - bool zero; - bool one; - bool two; - bool few; - bool many; - bool other; -} ICU4XPluralCategories; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XPluralCategories_destroy(ICU4XPluralCategories* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XPluralCategory.h b/third_party/rust/icu_capi/c/include/ICU4XPluralCategory.h deleted file mode 100644 index 543681c74646..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XPluralCategory.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XPluralCategory_H -#define ICU4XPluralCategory_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XPluralCategory { - ICU4XPluralCategory_Zero = 0, - ICU4XPluralCategory_One = 1, - ICU4XPluralCategory_Two = 2, - ICU4XPluralCategory_Few = 3, - ICU4XPluralCategory_Many = 4, - ICU4XPluralCategory_Other = 5, -} ICU4XPluralCategory; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_ICU4XPluralCategory_void.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_ICU4XPluralCategory_void ICU4XPluralCategory_get_for_cldr_string(const char* s_data, size_t s_len); -void ICU4XPluralCategory_destroy(ICU4XPluralCategory* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XPluralOperands.h b/third_party/rust/icu_capi/c/include/ICU4XPluralOperands.h deleted file mode 100644 index 14d997555f78..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XPluralOperands.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XPluralOperands_H -#define ICU4XPluralOperands_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPluralOperands ICU4XPluralOperands; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XPluralOperands_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XPluralOperands_ICU4XError ICU4XPluralOperands_create_from_string(const char* s_data, size_t s_len); -void ICU4XPluralOperands_destroy(ICU4XPluralOperands* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XPluralRules.h b/third_party/rust/icu_capi/c/include/ICU4XPluralRules.h deleted file mode 100644 index 0794a7ac8ef3..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XPluralRules.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XPluralRules_H -#define ICU4XPluralRules_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPluralRules ICU4XPluralRules; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XPluralRules_ICU4XError.h" -#include "ICU4XPluralOperands.h" -#include "ICU4XPluralCategory.h" -#include "ICU4XPluralCategories.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XPluralRules_ICU4XError ICU4XPluralRules_create_cardinal(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XPluralRules_ICU4XError ICU4XPluralRules_create_ordinal(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -ICU4XPluralCategory ICU4XPluralRules_category_for(const ICU4XPluralRules* self, const ICU4XPluralOperands* op); - -ICU4XPluralCategories ICU4XPluralRules_categories(const ICU4XPluralRules* self); -void ICU4XPluralRules_destroy(ICU4XPluralRules* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XPropertyValueNameToEnumMapper.h b/third_party/rust/icu_capi/c/include/ICU4XPropertyValueNameToEnumMapper.h deleted file mode 100644 index 7598c1837204..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XPropertyValueNameToEnumMapper.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef ICU4XPropertyValueNameToEnumMapper_H -#define ICU4XPropertyValueNameToEnumMapper_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPropertyValueNameToEnumMapper ICU4XPropertyValueNameToEnumMapper; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int16_t ICU4XPropertyValueNameToEnumMapper_get_strict(const ICU4XPropertyValueNameToEnumMapper* self, const char* name_data, size_t name_len); - -int16_t ICU4XPropertyValueNameToEnumMapper_get_loose(const ICU4XPropertyValueNameToEnumMapper* self, const char* name_data, size_t name_len); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_general_category(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_bidi_class(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_line_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_word_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_sentence_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_script(const ICU4XDataProvider* provider); -void ICU4XPropertyValueNameToEnumMapper_destroy(ICU4XPropertyValueNameToEnumMapper* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XRegionDisplayNames.h b/third_party/rust/icu_capi/c/include/ICU4XRegionDisplayNames.h deleted file mode 100644 index aa8a65020395..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XRegionDisplayNames.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XRegionDisplayNames_H -#define ICU4XRegionDisplayNames_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XRegionDisplayNames ICU4XRegionDisplayNames; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError ICU4XRegionDisplayNames_try_new_unstable(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_void_ICU4XError ICU4XRegionDisplayNames_of(const ICU4XRegionDisplayNames* self, const char* region_data, size_t region_len, DiplomatWriteable* write); -void ICU4XRegionDisplayNames_destroy(ICU4XRegionDisplayNames* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XReorderedIndexMap.h b/third_party/rust/icu_capi/c/include/ICU4XReorderedIndexMap.h deleted file mode 100644 index f5507a72178f..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XReorderedIndexMap.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XReorderedIndexMap_H -#define ICU4XReorderedIndexMap_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XReorderedIndexMap ICU4XReorderedIndexMap; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -DiplomatUsizeView ICU4XReorderedIndexMap_as_slice(const ICU4XReorderedIndexMap* self); - -size_t ICU4XReorderedIndexMap_len(const ICU4XReorderedIndexMap* self); - -size_t ICU4XReorderedIndexMap_get(const ICU4XReorderedIndexMap* self, size_t index); -void ICU4XReorderedIndexMap_destroy(ICU4XReorderedIndexMap* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XScriptExtensionsSet.h b/third_party/rust/icu_capi/c/include/ICU4XScriptExtensionsSet.h deleted file mode 100644 index b4982dc22c34..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XScriptExtensionsSet.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XScriptExtensionsSet_H -#define ICU4XScriptExtensionsSet_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XScriptExtensionsSet ICU4XScriptExtensionsSet; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_uint16_t_void.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XScriptExtensionsSet_contains(const ICU4XScriptExtensionsSet* self, uint16_t script); - -size_t ICU4XScriptExtensionsSet_count(const ICU4XScriptExtensionsSet* self); - -diplomat_result_uint16_t_void ICU4XScriptExtensionsSet_script_at(const ICU4XScriptExtensionsSet* self, size_t index); -void ICU4XScriptExtensionsSet_destroy(ICU4XScriptExtensionsSet* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XScriptWithExtensions.h b/third_party/rust/icu_capi/c/include/ICU4XScriptWithExtensions.h deleted file mode 100644 index df2dd5394649..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XScriptWithExtensions.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XScriptWithExtensions_H -#define ICU4XScriptWithExtensions_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XScriptWithExtensions ICU4XScriptWithExtensions; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h" -#include "ICU4XScriptWithExtensionsBorrowed.h" -#include "CodePointRangeIterator.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError ICU4XScriptWithExtensions_create(const ICU4XDataProvider* provider); - -uint16_t ICU4XScriptWithExtensions_get_script_val(const ICU4XScriptWithExtensions* self, uint32_t code_point); - -bool ICU4XScriptWithExtensions_has_script(const ICU4XScriptWithExtensions* self, uint32_t code_point, uint16_t script); - -ICU4XScriptWithExtensionsBorrowed* ICU4XScriptWithExtensions_as_borrowed(const ICU4XScriptWithExtensions* self); - -CodePointRangeIterator* ICU4XScriptWithExtensions_iter_ranges_for_script(const ICU4XScriptWithExtensions* self, uint16_t script); -void ICU4XScriptWithExtensions_destroy(ICU4XScriptWithExtensions* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XScriptWithExtensionsBorrowed.h b/third_party/rust/icu_capi/c/include/ICU4XScriptWithExtensionsBorrowed.h deleted file mode 100644 index 905b5ecc6bb0..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XScriptWithExtensionsBorrowed.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XScriptWithExtensionsBorrowed_H -#define ICU4XScriptWithExtensionsBorrowed_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XScriptWithExtensionsBorrowed ICU4XScriptWithExtensionsBorrowed; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XScriptExtensionsSet.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint16_t ICU4XScriptWithExtensionsBorrowed_get_script_val(const ICU4XScriptWithExtensionsBorrowed* self, uint32_t code_point); - -ICU4XScriptExtensionsSet* ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(const ICU4XScriptWithExtensionsBorrowed* self, uint32_t code_point); - -bool ICU4XScriptWithExtensionsBorrowed_has_script(const ICU4XScriptWithExtensionsBorrowed* self, uint32_t code_point, uint16_t script); -void ICU4XScriptWithExtensionsBorrowed_destroy(ICU4XScriptWithExtensionsBorrowed* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XSegmenterWordType.h b/third_party/rust/icu_capi/c/include/ICU4XSegmenterWordType.h deleted file mode 100644 index 9f4f81cf10ce..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XSegmenterWordType.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XSegmenterWordType_H -#define ICU4XSegmenterWordType_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XSegmenterWordType { - ICU4XSegmenterWordType_None = 0, - ICU4XSegmenterWordType_Number = 1, - ICU4XSegmenterWordType_Letter = 2, -} ICU4XSegmenterWordType; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XSegmenterWordType_destroy(ICU4XSegmenterWordType* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorLatin1.h b/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorLatin1.h deleted file mode 100644 index 6dd7b132dc37..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorLatin1.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorLatin1_H -#define ICU4XSentenceBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceBreakIteratorLatin1 ICU4XSentenceBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XSentenceBreakIteratorLatin1_next(ICU4XSentenceBreakIteratorLatin1* self); -void ICU4XSentenceBreakIteratorLatin1_destroy(ICU4XSentenceBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorUtf16.h b/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorUtf16.h deleted file mode 100644 index 3ed0dc18c34c..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorUtf16.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorUtf16_H -#define ICU4XSentenceBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceBreakIteratorUtf16 ICU4XSentenceBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XSentenceBreakIteratorUtf16_next(ICU4XSentenceBreakIteratorUtf16* self); -void ICU4XSentenceBreakIteratorUtf16_destroy(ICU4XSentenceBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorUtf8.h b/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorUtf8.h deleted file mode 100644 index 655cb67b6cd1..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XSentenceBreakIteratorUtf8.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorUtf8_H -#define ICU4XSentenceBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceBreakIteratorUtf8 ICU4XSentenceBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XSentenceBreakIteratorUtf8_next(ICU4XSentenceBreakIteratorUtf8* self); -void ICU4XSentenceBreakIteratorUtf8_destroy(ICU4XSentenceBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XSentenceSegmenter.h b/third_party/rust/icu_capi/c/include/ICU4XSentenceSegmenter.h deleted file mode 100644 index 7701c9f04289..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XSentenceSegmenter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XSentenceSegmenter_H -#define ICU4XSentenceSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceSegmenter ICU4XSentenceSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h" -#include "ICU4XSentenceBreakIteratorUtf8.h" -#include "ICU4XSentenceBreakIteratorUtf16.h" -#include "ICU4XSentenceBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError ICU4XSentenceSegmenter_create(const ICU4XDataProvider* provider); - -ICU4XSentenceBreakIteratorUtf8* ICU4XSentenceSegmenter_segment_utf8(const ICU4XSentenceSegmenter* self, const char* input_data, size_t input_len); - -ICU4XSentenceBreakIteratorUtf16* ICU4XSentenceSegmenter_segment_utf16(const ICU4XSentenceSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XSentenceBreakIteratorLatin1* ICU4XSentenceSegmenter_segment_latin1(const ICU4XSentenceSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XSentenceSegmenter_destroy(ICU4XSentenceSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XTime.h b/third_party/rust/icu_capi/c/include/ICU4XTime.h deleted file mode 100644 index d92fef92e4b8..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XTime.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XTime_H -#define ICU4XTime_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XTime ICU4XTime; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XTime_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XTime_ICU4XError ICU4XTime_create(uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond); - -uint8_t ICU4XTime_hour(const ICU4XTime* self); - -uint8_t ICU4XTime_minute(const ICU4XTime* self); - -uint8_t ICU4XTime_second(const ICU4XTime* self); - -uint32_t ICU4XTime_nanosecond(const ICU4XTime* self); -void ICU4XTime_destroy(ICU4XTime* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XTimeFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XTimeFormatter.h deleted file mode 100644 index d200881399fa..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XTimeFormatter.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ICU4XTimeFormatter_H -#define ICU4XTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XTimeFormatter ICU4XTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h" -#include "ICU4XTime.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XDateTime.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XTimeFormatter_ICU4XError ICU4XTimeFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XTimeLength length); - -diplomat_result_void_ICU4XError ICU4XTimeFormatter_format_time(const ICU4XTimeFormatter* self, const ICU4XTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XTimeFormatter_format_datetime(const ICU4XTimeFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XTimeFormatter_format_iso_datetime(const ICU4XTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XTimeFormatter_destroy(ICU4XTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XTimeLength.h b/third_party/rust/icu_capi/c/include/ICU4XTimeLength.h deleted file mode 100644 index 6d98bc8ccb59..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XTimeLength.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XTimeLength_H -#define ICU4XTimeLength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XTimeLength { - ICU4XTimeLength_Full = 0, - ICU4XTimeLength_Long = 1, - ICU4XTimeLength_Medium = 2, - ICU4XTimeLength_Short = 3, -} ICU4XTimeLength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XTimeLength_destroy(ICU4XTimeLength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XTimeZoneFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XTimeZoneFormatter.h deleted file mode 100644 index c11abf4362cb..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XTimeZoneFormatter.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XTimeZoneFormatter_H -#define ICU4XTimeZoneFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XTimeZoneFormatter ICU4XTimeZoneFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h" -#include "ICU4XIsoTimeZoneOptions.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XCustomTimeZone.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XIsoTimeZoneOptions options); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_generic_non_location_long(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_generic_non_location_short(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_specific_non_location_long(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_specific_non_location_short(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_generic_location_format(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_localized_gmt_format(ICU4XTimeZoneFormatter* self); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_iso_8601_format(ICU4XTimeZoneFormatter* self, ICU4XIsoTimeZoneOptions options); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_format_custom_time_zone(const ICU4XTimeZoneFormatter* self, const ICU4XCustomTimeZone* value, DiplomatWriteable* write); -void ICU4XTimeZoneFormatter_destroy(ICU4XTimeZoneFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XTransformResult.h b/third_party/rust/icu_capi/c/include/ICU4XTransformResult.h deleted file mode 100644 index 66b268e266a7..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XTransformResult.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XTransformResult_H -#define ICU4XTransformResult_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XTransformResult { - ICU4XTransformResult_Modified = 0, - ICU4XTransformResult_Unmodified = 1, -} ICU4XTransformResult; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XTransformResult_destroy(ICU4XTransformResult* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XUnicodeSetData.h b/third_party/rust/icu_capi/c/include/ICU4XUnicodeSetData.h deleted file mode 100644 index 3e10e53097e5..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XUnicodeSetData.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef ICU4XUnicodeSetData_H -#define ICU4XUnicodeSetData_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XUnicodeSetData ICU4XUnicodeSetData; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h" -#include "ICU4XLocale.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XUnicodeSetData_contains(const ICU4XUnicodeSetData* self, const char* s_data, size_t s_len); - -bool ICU4XUnicodeSetData_contains_char(const ICU4XUnicodeSetData* self, char32_t cp); - -bool ICU4XUnicodeSetData_contains32(const ICU4XUnicodeSetData* self, uint32_t cp); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_basic_emoji(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_main(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_auxiliary(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_punctuation(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_numbers(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_index(const ICU4XDataProvider* provider, const ICU4XLocale* locale); -void ICU4XUnicodeSetData_destroy(ICU4XUnicodeSetData* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWeekCalculator.h b/third_party/rust/icu_capi/c/include/ICU4XWeekCalculator.h deleted file mode 100644 index 02a52c6e87be..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWeekCalculator.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef ICU4XWeekCalculator_H -#define ICU4XWeekCalculator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWeekCalculator ICU4XWeekCalculator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h" -#include "ICU4XIsoWeekday.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XWeekCalculator_ICU4XError ICU4XWeekCalculator_create(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -ICU4XWeekCalculator* ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(ICU4XIsoWeekday first_weekday, uint8_t min_week_days); - -ICU4XIsoWeekday ICU4XWeekCalculator_first_weekday(const ICU4XWeekCalculator* self); - -uint8_t ICU4XWeekCalculator_min_week_days(const ICU4XWeekCalculator* self); -void ICU4XWeekCalculator_destroy(ICU4XWeekCalculator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWeekOf.h b/third_party/rust/icu_capi/c/include/ICU4XWeekOf.h deleted file mode 100644 index 5441b943d41f..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWeekOf.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XWeekOf_H -#define ICU4XWeekOf_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XWeekRelativeUnit.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWeekOf { - uint16_t week; - ICU4XWeekRelativeUnit unit; -} ICU4XWeekOf; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XWeekRelativeUnit.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XWeekOf_destroy(ICU4XWeekOf* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWeekRelativeUnit.h b/third_party/rust/icu_capi/c/include/ICU4XWeekRelativeUnit.h deleted file mode 100644 index ee6802dc3b37..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWeekRelativeUnit.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XWeekRelativeUnit_H -#define ICU4XWeekRelativeUnit_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XWeekRelativeUnit { - ICU4XWeekRelativeUnit_Previous = 0, - ICU4XWeekRelativeUnit_Current = 1, - ICU4XWeekRelativeUnit_Next = 2, -} ICU4XWeekRelativeUnit; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XWeekRelativeUnit_destroy(ICU4XWeekRelativeUnit* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorLatin1.h b/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorLatin1.h deleted file mode 100644 index 112025bdf510..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorLatin1.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XWordBreakIteratorLatin1_H -#define ICU4XWordBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordBreakIteratorLatin1 ICU4XWordBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XSegmenterWordType.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XWordBreakIteratorLatin1_next(ICU4XWordBreakIteratorLatin1* self); - -ICU4XSegmenterWordType ICU4XWordBreakIteratorLatin1_word_type(const ICU4XWordBreakIteratorLatin1* self); - -bool ICU4XWordBreakIteratorLatin1_is_word_like(const ICU4XWordBreakIteratorLatin1* self); -void ICU4XWordBreakIteratorLatin1_destroy(ICU4XWordBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorUtf16.h b/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorUtf16.h deleted file mode 100644 index 676aea3cff49..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorUtf16.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XWordBreakIteratorUtf16_H -#define ICU4XWordBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordBreakIteratorUtf16 ICU4XWordBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XSegmenterWordType.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XWordBreakIteratorUtf16_next(ICU4XWordBreakIteratorUtf16* self); - -ICU4XSegmenterWordType ICU4XWordBreakIteratorUtf16_word_type(const ICU4XWordBreakIteratorUtf16* self); - -bool ICU4XWordBreakIteratorUtf16_is_word_like(const ICU4XWordBreakIteratorUtf16* self); -void ICU4XWordBreakIteratorUtf16_destroy(ICU4XWordBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorUtf8.h b/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorUtf8.h deleted file mode 100644 index d8e98fb9b19d..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWordBreakIteratorUtf8.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XWordBreakIteratorUtf8_H -#define ICU4XWordBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordBreakIteratorUtf8 ICU4XWordBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XSegmenterWordType.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XWordBreakIteratorUtf8_next(ICU4XWordBreakIteratorUtf8* self); - -ICU4XSegmenterWordType ICU4XWordBreakIteratorUtf8_word_type(const ICU4XWordBreakIteratorUtf8* self); - -bool ICU4XWordBreakIteratorUtf8_is_word_like(const ICU4XWordBreakIteratorUtf8* self); -void ICU4XWordBreakIteratorUtf8_destroy(ICU4XWordBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XWordSegmenter.h b/third_party/rust/icu_capi/c/include/ICU4XWordSegmenter.h deleted file mode 100644 index 5bef9437e092..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XWordSegmenter.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef ICU4XWordSegmenter_H -#define ICU4XWordSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordSegmenter ICU4XWordSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h" -#include "ICU4XWordBreakIteratorUtf8.h" -#include "ICU4XWordBreakIteratorUtf16.h" -#include "ICU4XWordBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XWordSegmenter_ICU4XError ICU4XWordSegmenter_create_auto(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XWordSegmenter_ICU4XError ICU4XWordSegmenter_create_lstm(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XWordSegmenter_ICU4XError ICU4XWordSegmenter_create_dictionary(const ICU4XDataProvider* provider); - -ICU4XWordBreakIteratorUtf8* ICU4XWordSegmenter_segment_utf8(const ICU4XWordSegmenter* self, const char* input_data, size_t input_len); - -ICU4XWordBreakIteratorUtf16* ICU4XWordSegmenter_segment_utf16(const ICU4XWordSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XWordBreakIteratorLatin1* ICU4XWordSegmenter_segment_latin1(const ICU4XWordSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XWordSegmenter_destroy(ICU4XWordSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/ICU4XZonedDateTimeFormatter.h b/third_party/rust/icu_capi/c/include/ICU4XZonedDateTimeFormatter.h deleted file mode 100644 index 77b228a5a2cf..000000000000 --- a/third_party/rust/icu_capi/c/include/ICU4XZonedDateTimeFormatter.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ICU4XZonedDateTimeFormatter_H -#define ICU4XZonedDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XZonedDateTimeFormatter ICU4XZonedDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h" -#include "ICU4XIsoTimeZoneOptions.h" -#include "ICU4XDateTime.h" -#include "ICU4XCustomTimeZone.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError ICU4XZonedDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options); - -diplomat_result_void_ICU4XError ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(const ICU4XZonedDateTimeFormatter* self, const ICU4XDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(const ICU4XZonedDateTimeFormatter* self, const ICU4XIsoDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write); -void ICU4XZonedDateTimeFormatter_destroy(ICU4XZonedDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XAnyCalendarKind_void.h b/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XAnyCalendarKind_void.h deleted file mode 100644 index f67f66ed4db4..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XAnyCalendarKind_void.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef diplomat_result_ICU4XAnyCalendarKind_void_H -#define diplomat_result_ICU4XAnyCalendarKind_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XAnyCalendarKind.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_ICU4XAnyCalendarKind_void { - union { - ICU4XAnyCalendarKind ok; - }; - bool is_ok; -} diplomat_result_ICU4XAnyCalendarKind_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XPluralCategory_void.h b/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XPluralCategory_void.h deleted file mode 100644 index b56ef60acb7f..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XPluralCategory_void.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef diplomat_result_ICU4XPluralCategory_void_H -#define diplomat_result_ICU4XPluralCategory_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XPluralCategory.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_ICU4XPluralCategory_void { - union { - ICU4XPluralCategory ok; - }; - bool is_ok; -} diplomat_result_ICU4XPluralCategory_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XWeekOf_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XWeekOf_ICU4XError.h deleted file mode 100644 index 4dee8f941f70..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_ICU4XWeekOf_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_ICU4XWeekOf_ICU4XError_H -#define diplomat_result_ICU4XWeekOf_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XWeekOf.h" -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_ICU4XWeekOf_ICU4XError { - union { - ICU4XWeekOf ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_ICU4XWeekOf_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_bool_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_bool_ICU4XError.h deleted file mode 100644 index 015930214da6..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_bool_ICU4XError.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef diplomat_result_bool_ICU4XError_H -#define diplomat_result_bool_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_bool_ICU4XError { - union { - bool ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_bool_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XBidi_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XBidi_ICU4XError.h deleted file mode 100644 index f1cd7ca6a30d..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XBidi_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XBidi_ICU4XError_H -#define diplomat_result_box_ICU4XBidi_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XBidi ICU4XBidi; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XBidi_ICU4XError { - union { - ICU4XBidi* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XBidi_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h deleted file mode 100644 index bffa22c6b027..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCalendar_ICU4XError_H -#define diplomat_result_box_ICU4XCalendar_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCalendar ICU4XCalendar; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCalendar_ICU4XError { - union { - ICU4XCalendar* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCalendar_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h deleted file mode 100644 index 2c05f7967151..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError_H -#define diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCanonicalCombiningClassMap ICU4XCanonicalCombiningClassMap; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError { - union { - ICU4XCanonicalCombiningClassMap* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h deleted file mode 100644 index 66d0386ff8b0..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCanonicalComposition_ICU4XError_H -#define diplomat_result_box_ICU4XCanonicalComposition_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCanonicalComposition ICU4XCanonicalComposition; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCanonicalComposition_ICU4XError { - union { - ICU4XCanonicalComposition* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCanonicalComposition_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h deleted file mode 100644 index cf02637fef0f..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError_H -#define diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCanonicalDecomposition ICU4XCanonicalDecomposition; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError { - union { - ICU4XCanonicalDecomposition* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h deleted file mode 100644 index fbe11daad2e1..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCodePointMapData16_ICU4XError_H -#define diplomat_result_box_ICU4XCodePointMapData16_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCodePointMapData16 ICU4XCodePointMapData16; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCodePointMapData16_ICU4XError { - union { - ICU4XCodePointMapData16* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCodePointMapData16_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h deleted file mode 100644 index 2e203279e3b8..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCodePointMapData8_ICU4XError_H -#define diplomat_result_box_ICU4XCodePointMapData8_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCodePointMapData8 ICU4XCodePointMapData8; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCodePointMapData8_ICU4XError { - union { - ICU4XCodePointMapData8* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCodePointMapData8_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h deleted file mode 100644 index e70e39ba61dc..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCodePointSetData_ICU4XError_H -#define diplomat_result_box_ICU4XCodePointSetData_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCodePointSetData ICU4XCodePointSetData; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCodePointSetData_ICU4XError { - union { - ICU4XCodePointSetData* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCodePointSetData_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCollator_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCollator_ICU4XError.h deleted file mode 100644 index abb5c8a59839..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCollator_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCollator_ICU4XError_H -#define diplomat_result_box_ICU4XCollator_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCollator ICU4XCollator; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCollator_ICU4XError { - union { - ICU4XCollator* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCollator_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h deleted file mode 100644 index d0c381ef039c..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XComposingNormalizer_ICU4XError_H -#define diplomat_result_box_ICU4XComposingNormalizer_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XComposingNormalizer ICU4XComposingNormalizer; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XComposingNormalizer_ICU4XError { - union { - ICU4XComposingNormalizer* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XComposingNormalizer_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h deleted file mode 100644 index 4709a89871e5..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCustomTimeZone_ICU4XError_H -#define diplomat_result_box_ICU4XCustomTimeZone_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCustomTimeZone ICU4XCustomTimeZone; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCustomTimeZone_ICU4XError { - union { - ICU4XCustomTimeZone* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCustomTimeZone_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h deleted file mode 100644 index a5be84418382..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDataProvider_ICU4XError_H -#define diplomat_result_box_ICU4XDataProvider_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDataProvider ICU4XDataProvider; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDataProvider_ICU4XError { - union { - ICU4XDataProvider* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDataProvider_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h deleted file mode 100644 index d8c1d33e2107..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDataStruct_ICU4XError_H -#define diplomat_result_box_ICU4XDataStruct_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDataStruct ICU4XDataStruct; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDataStruct_ICU4XError { - union { - ICU4XDataStruct* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDataStruct_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h deleted file mode 100644 index b6d9671434c5..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDateFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XDateFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDateFormatter ICU4XDateFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDateFormatter_ICU4XError { - union { - ICU4XDateFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDateFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 855e74fe6c06..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDateTimeFormatter ICU4XDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError { - union { - ICU4XDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h deleted file mode 100644 index 2d4cb2fe4840..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDateTime_ICU4XError_H -#define diplomat_result_box_ICU4XDateTime_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDateTime ICU4XDateTime; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDateTime_ICU4XError { - union { - ICU4XDateTime* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDateTime_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDate_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDate_ICU4XError.h deleted file mode 100644 index 30461b264a65..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDate_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDate_ICU4XError_H -#define diplomat_result_box_ICU4XDate_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDate ICU4XDate; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDate_ICU4XError { - union { - ICU4XDate* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDate_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h deleted file mode 100644 index c51d9907bc9f..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError_H -#define diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDecomposingNormalizer ICU4XDecomposingNormalizer; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError { - union { - ICU4XDecomposingNormalizer* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h deleted file mode 100644 index 8ee245a09336..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XFixedDecimalFormatter ICU4XFixedDecimalFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError { - union { - ICU4XFixedDecimalFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h deleted file mode 100644 index f45cd78fb93b..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XFixedDecimal_ICU4XError_H -#define diplomat_result_box_ICU4XFixedDecimal_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XFixedDecimal ICU4XFixedDecimal; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XFixedDecimal_ICU4XError { - union { - ICU4XFixedDecimal* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XFixedDecimal_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h deleted file mode 100644 index 98ff137a9a3c..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError_H -#define diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGeneralCategoryNameToMaskMapper ICU4XGeneralCategoryNameToMaskMapper; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError { - union { - ICU4XGeneralCategoryNameToMaskMapper* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h deleted file mode 100644 index d560b381a59d..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGraphemeClusterSegmenter ICU4XGraphemeClusterSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError { - union { - ICU4XGraphemeClusterSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h deleted file mode 100644 index 86b13be9121b..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGregorianDateFormatter ICU4XGregorianDateFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError { - union { - ICU4XGregorianDateFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 4393d9ffb0fb..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGregorianDateTimeFormatter ICU4XGregorianDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError { - union { - ICU4XGregorianDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 270b38ba94ce..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGregorianZonedDateTimeFormatter ICU4XGregorianZonedDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError { - union { - ICU4XGregorianZonedDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h deleted file mode 100644 index 8a55b47a68b0..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XIsoDateTime_ICU4XError_H -#define diplomat_result_box_ICU4XIsoDateTime_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XIsoDateTime ICU4XIsoDateTime; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XIsoDateTime_ICU4XError { - union { - ICU4XIsoDateTime* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XIsoDateTime_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h deleted file mode 100644 index 8528d73b0721..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XIsoDate_ICU4XError_H -#define diplomat_result_box_ICU4XIsoDate_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XIsoDate ICU4XIsoDate; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XIsoDate_ICU4XError { - union { - ICU4XIsoDate* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XIsoDate_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h deleted file mode 100644 index 004d3494ae04..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLineSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XLineSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLineSegmenter ICU4XLineSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLineSegmenter_ICU4XError { - union { - ICU4XLineSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLineSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h deleted file mode 100644 index df40aa2daed1..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XListFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XListFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XListFormatter ICU4XListFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XListFormatter_ICU4XError { - union { - ICU4XListFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XListFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h deleted file mode 100644 index a49bb700ca67..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleCanonicalizer ICU4XLocaleCanonicalizer; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError { - union { - ICU4XLocaleCanonicalizer* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h deleted file mode 100644 index 6b0f09b2a2ff..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleDisplayNamesFormatter ICU4XLocaleDisplayNamesFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError { - union { - ICU4XLocaleDisplayNamesFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h deleted file mode 100644 index c7275e699c2d..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleExpander_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleExpander_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleExpander ICU4XLocaleExpander; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleExpander_ICU4XError { - union { - ICU4XLocaleExpander* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleExpander_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h deleted file mode 100644 index 0dc002718e8c..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleFallbackerWithConfig ICU4XLocaleFallbackerWithConfig; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError { - union { - ICU4XLocaleFallbackerWithConfig* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h deleted file mode 100644 index 3427bf3e3a35..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleFallbacker ICU4XLocaleFallbacker; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError { - union { - ICU4XLocaleFallbacker* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocale_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocale_ICU4XError.h deleted file mode 100644 index f5720b612f3d..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XLocale_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocale_ICU4XError_H -#define diplomat_result_box_ICU4XLocale_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocale ICU4XLocale; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocale_ICU4XError { - union { - ICU4XLocale* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocale_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h deleted file mode 100644 index ebd519e0b5b4..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError_H -#define diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XMetazoneCalculator ICU4XMetazoneCalculator; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError { - union { - ICU4XMetazoneCalculator* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h deleted file mode 100644 index 7c068ba4b801..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XPluralOperands_ICU4XError_H -#define diplomat_result_box_ICU4XPluralOperands_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XPluralOperands ICU4XPluralOperands; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XPluralOperands_ICU4XError { - union { - ICU4XPluralOperands* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XPluralOperands_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h deleted file mode 100644 index 4fa522b8508f..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XPluralRules_ICU4XError_H -#define diplomat_result_box_ICU4XPluralRules_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XPluralRules ICU4XPluralRules; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XPluralRules_ICU4XError { - union { - ICU4XPluralRules* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XPluralRules_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h deleted file mode 100644 index 047ef959b040..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError_H -#define diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XPropertyValueNameToEnumMapper ICU4XPropertyValueNameToEnumMapper; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError { - union { - ICU4XPropertyValueNameToEnumMapper* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h deleted file mode 100644 index fcf7e88a232a..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError_H -#define diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XRegionDisplayNames ICU4XRegionDisplayNames; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError { - union { - ICU4XRegionDisplayNames* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h deleted file mode 100644 index bffd6161aa8d..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError_H -#define diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XScriptWithExtensions ICU4XScriptWithExtensions; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError { - union { - ICU4XScriptWithExtensions* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h deleted file mode 100644 index a8ab968fa946..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XSentenceSegmenter ICU4XSentenceSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError { - union { - ICU4XSentenceSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h deleted file mode 100644 index 0e63cbbc2a80..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XTimeFormatter ICU4XTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XTimeFormatter_ICU4XError { - union { - ICU4XTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h deleted file mode 100644 index 5f4851051e9a..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XTimeZoneFormatter ICU4XTimeZoneFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError { - union { - ICU4XTimeZoneFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTime_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTime_ICU4XError.h deleted file mode 100644 index 3e58b1e4daa6..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XTime_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XTime_ICU4XError_H -#define diplomat_result_box_ICU4XTime_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XTime ICU4XTime; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XTime_ICU4XError { - union { - ICU4XTime* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XTime_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h deleted file mode 100644 index 6dd14e82b64d..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XUnicodeSetData_ICU4XError_H -#define diplomat_result_box_ICU4XUnicodeSetData_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XUnicodeSetData ICU4XUnicodeSetData; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XUnicodeSetData_ICU4XError { - union { - ICU4XUnicodeSetData* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XUnicodeSetData_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h deleted file mode 100644 index 1f547fd383c3..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XWeekCalculator_ICU4XError_H -#define diplomat_result_box_ICU4XWeekCalculator_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XWeekCalculator ICU4XWeekCalculator; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XWeekCalculator_ICU4XError { - union { - ICU4XWeekCalculator* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XWeekCalculator_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h deleted file mode 100644 index e41c59b661e1..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XWordSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XWordSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XWordSegmenter ICU4XWordSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XWordSegmenter_ICU4XError { - union { - ICU4XWordSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XWordSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 52a0ab446213..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XZonedDateTimeFormatter ICU4XZonedDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError { - union { - ICU4XZonedDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_int32_t_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_int32_t_ICU4XError.h deleted file mode 100644 index adbe148dd153..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_int32_t_ICU4XError.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef diplomat_result_int32_t_ICU4XError_H -#define diplomat_result_int32_t_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_int32_t_ICU4XError { - union { - int32_t ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_int32_t_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_uint16_t_void.h b/third_party/rust/icu_capi/c/include/diplomat_result_uint16_t_void.h deleted file mode 100644 index 3adeb5f36de3..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_uint16_t_void.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef diplomat_result_uint16_t_void_H -#define diplomat_result_uint16_t_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_uint16_t_void { - union { - uint16_t ok; - }; - bool is_ok; -} diplomat_result_uint16_t_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_void_ICU4XError.h b/third_party/rust/icu_capi/c/include/diplomat_result_void_ICU4XError.h deleted file mode 100644 index f092491e3404..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_void_ICU4XError.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef diplomat_result_void_ICU4XError_H -#define diplomat_result_void_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_void_ICU4XError { - union { - ICU4XError err; - }; - bool is_ok; -} diplomat_result_void_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_result_void_void.h b/third_party/rust/icu_capi/c/include/diplomat_result_void_void.h deleted file mode 100644 index 2d5cc704e526..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_result_void_void.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef diplomat_result_void_void_H -#define diplomat_result_void_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_void_void { - bool is_ok; -} diplomat_result_void_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/c/include/diplomat_runtime.h b/third_party/rust/icu_capi/c/include/diplomat_runtime.h deleted file mode 100644 index de0f9c76fee3..000000000000 --- a/third_party/rust/icu_capi/c/include/diplomat_runtime.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef DIPLOMAT_RUNTIME_C_H -#define DIPLOMAT_RUNTIME_C_H - -#include -#include -#include -#include - -// uchar.h doesn't always exist, but char32_t is always available -// in C++ anyway -#ifndef __cplusplus -#ifdef __APPLE__ -#include -typedef uint16_t char16_t; -typedef uint32_t char32_t; -#else -#include -#endif -#endif - - -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -typedef struct DiplomatWriteable { - void* context; - char* buf; - size_t len; - size_t cap; - void (*flush)(struct DiplomatWriteable*); - bool (*grow)(struct DiplomatWriteable*, size_t); -} DiplomatWriteable; - -DiplomatWriteable diplomat_simple_writeable(char* buf, size_t buf_size); - -typedef struct DiplomatStringView { - const char* data; - size_t len; -} DiplomatStringView; - -#define MAKE_SLICE_VIEW(name, c_ty) \ - typedef struct Diplomat##name##View { \ - const c_ty* data; \ - size_t len; \ - } Diplomat##name##View; - -MAKE_SLICE_VIEW(I8, int8_t) -MAKE_SLICE_VIEW(U8, uint8_t) -MAKE_SLICE_VIEW(I16, int16_t) -MAKE_SLICE_VIEW(U16, uint16_t) -MAKE_SLICE_VIEW(I32, int32_t) -MAKE_SLICE_VIEW(U32, uint32_t) -MAKE_SLICE_VIEW(I64, int64_t) -MAKE_SLICE_VIEW(U64, uint64_t) -MAKE_SLICE_VIEW(Isize, intptr_t) -MAKE_SLICE_VIEW(Usize, size_t) -MAKE_SLICE_VIEW(F32, float) -MAKE_SLICE_VIEW(F64, double) -MAKE_SLICE_VIEW(Bool, bool) -MAKE_SLICE_VIEW(Char, char32_t) - - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif - -#endif diff --git a/third_party/rust/icu_capi/cpp/README.md b/third_party/rust/icu_capi/cpp/README.md deleted file mode 100644 index 0fd964e92ede..000000000000 --- a/third_party/rust/icu_capi/cpp/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# C++ FFI for ICU4X - -This folder contains the C++ FFI for ICU4X. To re-generate the bindings run: - -```sh -cargo make diplomat-install -cargo make diplomat-gen-cpp -``` - -Or re-generate all of the bindings: - -```sh -cargo make diplomat-gen -``` - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/third_party/rust/icu_capi/cpp/include/CodePointRangeIterator.h b/third_party/rust/icu_capi/cpp/include/CodePointRangeIterator.h deleted file mode 100644 index 36d6d23175a0..000000000000 --- a/third_party/rust/icu_capi/cpp/include/CodePointRangeIterator.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CodePointRangeIterator_H -#define CodePointRangeIterator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct CodePointRangeIterator CodePointRangeIterator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIteratorResult.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -CodePointRangeIteratorResult CodePointRangeIterator_next(CodePointRangeIterator* self); -void CodePointRangeIterator_destroy(CodePointRangeIterator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/CodePointRangeIterator.hpp b/third_party/rust/icu_capi/cpp/include/CodePointRangeIterator.hpp deleted file mode 100644 index 3c2d5caef028..000000000000 --- a/third_party/rust/icu_capi/cpp/include/CodePointRangeIterator.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef CodePointRangeIterator_HPP -#define CodePointRangeIterator_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "CodePointRangeIterator.h" - -struct CodePointRangeIteratorResult; - -/** - * A destruction policy for using CodePointRangeIterator with std::unique_ptr. - */ -struct CodePointRangeIteratorDeleter { - void operator()(capi::CodePointRangeIterator* l) const noexcept { - capi::CodePointRangeIterator_destroy(l); - } -}; - -/** - * An iterator over code point ranges, produced by `ICU4XCodePointSetData` or - * one of the `ICU4XCodePointMapData` types - */ -class CodePointRangeIterator { - public: - - /** - * Advance the iterator by one and return the next range. - * - * If the iterator is out of items, `done` will be true - */ - CodePointRangeIteratorResult next(); - inline const capi::CodePointRangeIterator* AsFFI() const { return this->inner.get(); } - inline capi::CodePointRangeIterator* AsFFIMut() { return this->inner.get(); } - inline CodePointRangeIterator(capi::CodePointRangeIterator* i) : inner(i) {} - CodePointRangeIterator() = default; - CodePointRangeIterator(CodePointRangeIterator&&) noexcept = default; - CodePointRangeIterator& operator=(CodePointRangeIterator&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "CodePointRangeIteratorResult.hpp" - -inline CodePointRangeIteratorResult CodePointRangeIterator::next() { - capi::CodePointRangeIteratorResult diplomat_raw_struct_out_value = capi::CodePointRangeIterator_next(this->inner.get()); - return CodePointRangeIteratorResult{ .start = std::move(diplomat_raw_struct_out_value.start), .end = std::move(diplomat_raw_struct_out_value.end), .done = std::move(diplomat_raw_struct_out_value.done) }; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/CodePointRangeIteratorResult.h b/third_party/rust/icu_capi/cpp/include/CodePointRangeIteratorResult.h deleted file mode 100644 index 846873be11f3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/CodePointRangeIteratorResult.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CodePointRangeIteratorResult_H -#define CodePointRangeIteratorResult_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct CodePointRangeIteratorResult { - uint32_t start; - uint32_t end; - bool done; -} CodePointRangeIteratorResult; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void CodePointRangeIteratorResult_destroy(CodePointRangeIteratorResult* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/CodePointRangeIteratorResult.hpp b/third_party/rust/icu_capi/cpp/include/CodePointRangeIteratorResult.hpp deleted file mode 100644 index 086ddfce0802..000000000000 --- a/third_party/rust/icu_capi/cpp/include/CodePointRangeIteratorResult.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef CodePointRangeIteratorResult_HPP -#define CodePointRangeIteratorResult_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "CodePointRangeIteratorResult.h" - - - -/** - * Result of a single iteration of [`CodePointRangeIterator`]. - * Logically can be considered to be an `Option>`, - * - * `start` and `end` represent an inclusive range of code points [start, end], - * and `done` will be true if the iterator has already finished. The last contentful - * iteration will NOT produce a range done=true, in other words `start` and `end` are useful - * values if and only if `done=false`. - */ -struct CodePointRangeIteratorResult { - public: - uint32_t start; - uint32_t end; - bool done; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XAnyCalendarKind.h b/third_party/rust/icu_capi/cpp/include/ICU4XAnyCalendarKind.h deleted file mode 100644 index 035ec9ef17ba..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XAnyCalendarKind.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ICU4XAnyCalendarKind_H -#define ICU4XAnyCalendarKind_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XAnyCalendarKind { - ICU4XAnyCalendarKind_Iso = 0, - ICU4XAnyCalendarKind_Gregorian = 1, - ICU4XAnyCalendarKind_Buddhist = 2, - ICU4XAnyCalendarKind_Japanese = 3, - ICU4XAnyCalendarKind_JapaneseExtended = 4, - ICU4XAnyCalendarKind_Ethiopian = 5, - ICU4XAnyCalendarKind_EthiopianAmeteAlem = 6, - ICU4XAnyCalendarKind_Indian = 7, - ICU4XAnyCalendarKind_Coptic = 8, -} ICU4XAnyCalendarKind; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocale.h" -#include "diplomat_result_ICU4XAnyCalendarKind_void.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_ICU4XAnyCalendarKind_void ICU4XAnyCalendarKind_get_for_locale(const ICU4XLocale* locale); - -diplomat_result_ICU4XAnyCalendarKind_void ICU4XAnyCalendarKind_get_for_bcp47(const char* s_data, size_t s_len); - -diplomat_result_void_ICU4XError ICU4XAnyCalendarKind_bcp47(ICU4XAnyCalendarKind self, DiplomatWriteable* write); -void ICU4XAnyCalendarKind_destroy(ICU4XAnyCalendarKind* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XAnyCalendarKind.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XAnyCalendarKind.hpp deleted file mode 100644 index 8fc9fa8a9230..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XAnyCalendarKind.hpp +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef ICU4XAnyCalendarKind_HPP -#define ICU4XAnyCalendarKind_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XAnyCalendarKind.h" - - - -/** - * The various calendar types currently supported by [`ICU4XCalendar`] - * - * See the [Rust documentation for `AnyCalendarKind`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html) for more information. - */ -enum struct ICU4XAnyCalendarKind { - - /** - * The kind of an Iso calendar - */ - Iso = 0, - - /** - * The kind of a Gregorian calendar - */ - Gregorian = 1, - - /** - * The kind of a Buddhist calendar - */ - Buddhist = 2, - - /** - * The kind of a Japanese calendar with modern eras - */ - Japanese = 3, - - /** - * The kind of a Japanese calendar with modern and historic eras - */ - JapaneseExtended = 4, - - /** - * The kind of an Ethiopian calendar, with Amete Mihret era - */ - Ethiopian = 5, - - /** - * The kind of an Ethiopian calendar, with Amete Alem era - */ - EthiopianAmeteAlem = 6, - - /** - * The kind of a Indian calendar - */ - Indian = 7, - - /** - * The kind of a Coptic calendar - */ - Coptic = 8, -}; -class ICU4XLocale; -#include "ICU4XError.hpp" - -#include "ICU4XLocale.hpp" -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidi.h b/third_party/rust/icu_capi/cpp/include/ICU4XBidi.h deleted file mode 100644 index 1ed7cfc8c245..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidi.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ICU4XBidi_H -#define ICU4XBidi_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XBidi ICU4XBidi; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XBidi_ICU4XError.h" -#include "ICU4XBidiInfo.h" -#include "ICU4XReorderedIndexMap.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XBidi_ICU4XError ICU4XBidi_create(const ICU4XDataProvider* provider); - -ICU4XBidiInfo* ICU4XBidi_for_text(const ICU4XBidi* self, const char* text_data, size_t text_len, uint8_t default_level); - -ICU4XReorderedIndexMap* ICU4XBidi_reorder_visual(const ICU4XBidi* self, const uint8_t* levels_data, size_t levels_len); - -bool ICU4XBidi_level_is_rtl(uint8_t level); - -bool ICU4XBidi_level_is_ltr(uint8_t level); - -uint8_t ICU4XBidi_level_rtl(); - -uint8_t ICU4XBidi_level_ltr(); -void ICU4XBidi_destroy(ICU4XBidi* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidi.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XBidi.hpp deleted file mode 100644 index d3fa1827d01d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidi.hpp +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef ICU4XBidi_HPP -#define ICU4XBidi_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XBidi.h" - -class ICU4XDataProvider; -class ICU4XBidi; -#include "ICU4XError.hpp" -class ICU4XBidiInfo; -class ICU4XReorderedIndexMap; - -/** - * A destruction policy for using ICU4XBidi with std::unique_ptr. - */ -struct ICU4XBidiDeleter { - void operator()(capi::ICU4XBidi* l) const noexcept { - capi::ICU4XBidi_destroy(l); - } -}; - -/** - * An ICU4X Bidi object, containing loaded bidi data - * - * See the [Rust documentation for `BidiClassAdapter`](https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html) for more information. - */ -class ICU4XBidi { - public: - - /** - * Creates a new [`ICU4XBidi`] from locale data. - * - * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html#method.new) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Use the data loaded in this object to process a string and calculate bidi information - * - * Takes in a Level for the default level, if it is an invalid value it will default to LTR - * - * See the [Rust documentation for `new_with_data_source`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.new_with_data_source) for more information. - * - * Lifetimes: `text` must live at least as long as the output. - */ - ICU4XBidiInfo for_text(const std::string_view text, uint8_t default_level) const; - - /** - * Utility function for producing reorderings given a list of levels - * - * Produces a map saying which visual index maps to which source index. - * - * The levels array must not have values greater than 126 (this is the - * Bidi maximum explicit depth plus one). - * Failure to follow this invariant may lead to incorrect results, - * but is still safe. - * - * See the [Rust documentation for `reorder_visual`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.reorder_visual) for more information. - */ - ICU4XReorderedIndexMap reorder_visual(const diplomat::span levels) const; - - /** - * Check if a Level returned by level_at is an RTL level. - * - * Invalid levels (numbers greater than 125) will be assumed LTR - * - * See the [Rust documentation for `is_rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_rtl) for more information. - */ - static bool level_is_rtl(uint8_t level); - - /** - * Check if a Level returned by level_at is an LTR level. - * - * Invalid levels (numbers greater than 125) will be assumed LTR - * - * See the [Rust documentation for `is_ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_ltr) for more information. - */ - static bool level_is_ltr(uint8_t level); - - /** - * Get a basic RTL Level value - * - * See the [Rust documentation for `rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.rtl) for more information. - */ - static uint8_t level_rtl(); - - /** - * Get a simple LTR Level value - * - * See the [Rust documentation for `ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.ltr) for more information. - */ - static uint8_t level_ltr(); - inline const capi::ICU4XBidi* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XBidi* AsFFIMut() { return this->inner.get(); } - inline ICU4XBidi(capi::ICU4XBidi* i) : inner(i) {} - ICU4XBidi() = default; - ICU4XBidi(ICU4XBidi&&) noexcept = default; - ICU4XBidi& operator=(ICU4XBidi&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XBidiInfo.hpp" -#include "ICU4XReorderedIndexMap.hpp" - -inline diplomat::result ICU4XBidi::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XBidi_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XBidi(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XBidiInfo ICU4XBidi::for_text(const std::string_view text, uint8_t default_level) const { - return ICU4XBidiInfo(capi::ICU4XBidi_for_text(this->inner.get(), text.data(), text.size(), default_level)); -} -inline ICU4XReorderedIndexMap ICU4XBidi::reorder_visual(const diplomat::span levels) const { - return ICU4XReorderedIndexMap(capi::ICU4XBidi_reorder_visual(this->inner.get(), levels.data(), levels.size())); -} -inline bool ICU4XBidi::level_is_rtl(uint8_t level) { - return capi::ICU4XBidi_level_is_rtl(level); -} -inline bool ICU4XBidi::level_is_ltr(uint8_t level) { - return capi::ICU4XBidi_level_is_ltr(level); -} -inline uint8_t ICU4XBidi::level_rtl() { - return capi::ICU4XBidi_level_rtl(); -} -inline uint8_t ICU4XBidi::level_ltr() { - return capi::ICU4XBidi_level_ltr(); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidiDirection.h b/third_party/rust/icu_capi/cpp/include/ICU4XBidiDirection.h deleted file mode 100644 index 33de81d6e9da..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidiDirection.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XBidiDirection_H -#define ICU4XBidiDirection_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XBidiDirection { - ICU4XBidiDirection_Ltr = 0, - ICU4XBidiDirection_Rtl = 1, - ICU4XBidiDirection_Mixed = 2, -} ICU4XBidiDirection; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XBidiDirection_destroy(ICU4XBidiDirection* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidiDirection.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XBidiDirection.hpp deleted file mode 100644 index ad21e51910ea..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidiDirection.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ICU4XBidiDirection_HPP -#define ICU4XBidiDirection_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XBidiDirection.h" - - -enum struct ICU4XBidiDirection { - Ltr = 0, - Rtl = 1, - Mixed = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidiInfo.h b/third_party/rust/icu_capi/cpp/include/ICU4XBidiInfo.h deleted file mode 100644 index 02e8c21659a6..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidiInfo.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XBidiInfo_H -#define ICU4XBidiInfo_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XBidiInfo ICU4XBidiInfo; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XBidiParagraph.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -size_t ICU4XBidiInfo_paragraph_count(const ICU4XBidiInfo* self); - -ICU4XBidiParagraph* ICU4XBidiInfo_paragraph_at(const ICU4XBidiInfo* self, size_t n); - -size_t ICU4XBidiInfo_size(const ICU4XBidiInfo* self); - -uint8_t ICU4XBidiInfo_level_at(const ICU4XBidiInfo* self, size_t pos); -void ICU4XBidiInfo_destroy(ICU4XBidiInfo* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidiInfo.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XBidiInfo.hpp deleted file mode 100644 index 11cf6162d2f7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidiInfo.hpp +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef ICU4XBidiInfo_HPP -#define ICU4XBidiInfo_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XBidiInfo.h" - -class ICU4XBidiParagraph; - -/** - * A destruction policy for using ICU4XBidiInfo with std::unique_ptr. - */ -struct ICU4XBidiInfoDeleter { - void operator()(capi::ICU4XBidiInfo* l) const noexcept { - capi::ICU4XBidiInfo_destroy(l); - } -}; - -/** - * An object containing bidi information for a given string, produced by `for_text()` on `ICU4XBidi` - * - * See the [Rust documentation for `BidiInfo`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html) for more information. - */ -class ICU4XBidiInfo { - public: - - /** - * The number of paragraphs contained here - */ - size_t paragraph_count() const; - - /** - * Get the nth paragraph, returning None if out of bounds - * - * Lifetimes: `this` must live at least as long as the output. - */ - std::optional paragraph_at(size_t n) const; - - /** - * The number of bytes in this full text - */ - size_t size() const; - - /** - * Get the BIDI level at a particular byte index in the full text. - * This integer is conceptually a `unicode_bidi::Level`, - * and can be further inspected using the static methods on ICU4XBidi. - * - * Returns 0 (equivalent to `Level::ltr()`) on error - */ - uint8_t level_at(size_t pos) const; - inline const capi::ICU4XBidiInfo* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XBidiInfo* AsFFIMut() { return this->inner.get(); } - inline ICU4XBidiInfo(capi::ICU4XBidiInfo* i) : inner(i) {} - ICU4XBidiInfo() = default; - ICU4XBidiInfo(ICU4XBidiInfo&&) noexcept = default; - ICU4XBidiInfo& operator=(ICU4XBidiInfo&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XBidiParagraph.hpp" - -inline size_t ICU4XBidiInfo::paragraph_count() const { - return capi::ICU4XBidiInfo_paragraph_count(this->inner.get()); -} -inline std::optional ICU4XBidiInfo::paragraph_at(size_t n) const { - auto diplomat_optional_raw_out_value = capi::ICU4XBidiInfo_paragraph_at(this->inner.get(), n); - std::optional diplomat_optional_out_value; - if (diplomat_optional_raw_out_value != nullptr) { - diplomat_optional_out_value = ICU4XBidiParagraph(diplomat_optional_raw_out_value); - } else { - diplomat_optional_out_value = std::nullopt; - } - return diplomat_optional_out_value; -} -inline size_t ICU4XBidiInfo::size() const { - return capi::ICU4XBidiInfo_size(this->inner.get()); -} -inline uint8_t ICU4XBidiInfo::level_at(size_t pos) const { - return capi::ICU4XBidiInfo_level_at(this->inner.get(), pos); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidiParagraph.h b/third_party/rust/icu_capi/cpp/include/ICU4XBidiParagraph.h deleted file mode 100644 index 269f940cc7d7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidiParagraph.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ICU4XBidiParagraph_H -#define ICU4XBidiParagraph_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XBidiParagraph ICU4XBidiParagraph; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XBidiDirection.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_void_ICU4XError ICU4XBidiParagraph_set_paragraph_in_text(ICU4XBidiParagraph* self, size_t n); - -ICU4XBidiDirection ICU4XBidiParagraph_direction(const ICU4XBidiParagraph* self); - -size_t ICU4XBidiParagraph_size(const ICU4XBidiParagraph* self); - -size_t ICU4XBidiParagraph_range_start(const ICU4XBidiParagraph* self); - -size_t ICU4XBidiParagraph_range_end(const ICU4XBidiParagraph* self); - -diplomat_result_void_ICU4XError ICU4XBidiParagraph_reorder_line(const ICU4XBidiParagraph* self, size_t range_start, size_t range_end, DiplomatWriteable* out); - -uint8_t ICU4XBidiParagraph_level_at(const ICU4XBidiParagraph* self, size_t pos); -void ICU4XBidiParagraph_destroy(ICU4XBidiParagraph* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XBidiParagraph.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XBidiParagraph.hpp deleted file mode 100644 index a7c9ad5d4ef3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XBidiParagraph.hpp +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef ICU4XBidiParagraph_HPP -#define ICU4XBidiParagraph_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XBidiParagraph.h" - -#include "ICU4XError.hpp" -#include "ICU4XBidiDirection.hpp" - -/** - * A destruction policy for using ICU4XBidiParagraph with std::unique_ptr. - */ -struct ICU4XBidiParagraphDeleter { - void operator()(capi::ICU4XBidiParagraph* l) const noexcept { - capi::ICU4XBidiParagraph_destroy(l); - } -}; - -/** - * Bidi information for a single processed paragraph - */ -class ICU4XBidiParagraph { - public: - - /** - * Given a paragraph index `n` within the surrounding text, this sets this - * object to the paragraph at that index. Returns `ICU4XError::OutOfBoundsError` when out of bounds. - * - * This is equivalent to calling `paragraph_at()` on `ICU4XBidiInfo` but doesn't - * create a new object - */ - diplomat::result set_paragraph_in_text(size_t n); - - /** - * The primary direction of this paragraph - * - * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. - */ - ICU4XBidiDirection direction() const; - - /** - * The number of bytes in this paragraph - * - * See the [Rust documentation for `len`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.ParagraphInfo.html#method.len) for more information. - */ - size_t size() const; - - /** - * The start index of this paragraph within the source text - */ - size_t range_start() const; - - /** - * The end index of this paragraph within the source text - */ - size_t range_end() const; - - /** - * Reorder a line based on display order. The ranges are specified relative to the source text and must be contained - * within this paragraph's range. - * - * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. - */ - template diplomat::result reorder_line_to_writeable(size_t range_start, size_t range_end, W& out) const; - - /** - * Reorder a line based on display order. The ranges are specified relative to the source text and must be contained - * within this paragraph's range. - * - * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. - */ - diplomat::result reorder_line(size_t range_start, size_t range_end) const; - - /** - * Get the BIDI level at a particular byte index in this paragraph. - * This integer is conceptually a `unicode_bidi::Level`, - * and can be further inspected using the static methods on ICU4XBidi. - * - * Returns 0 (equivalent to `Level::ltr()`) on error - * - * See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. - */ - uint8_t level_at(size_t pos) const; - inline const capi::ICU4XBidiParagraph* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XBidiParagraph* AsFFIMut() { return this->inner.get(); } - inline ICU4XBidiParagraph(capi::ICU4XBidiParagraph* i) : inner(i) {} - ICU4XBidiParagraph() = default; - ICU4XBidiParagraph(ICU4XBidiParagraph&&) noexcept = default; - ICU4XBidiParagraph& operator=(ICU4XBidiParagraph&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline diplomat::result ICU4XBidiParagraph::set_paragraph_in_text(size_t n) { - auto diplomat_result_raw_out_value = capi::ICU4XBidiParagraph_set_paragraph_in_text(this->inner.get(), n); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XBidiDirection ICU4XBidiParagraph::direction() const { - return static_cast(capi::ICU4XBidiParagraph_direction(this->inner.get())); -} -inline size_t ICU4XBidiParagraph::size() const { - return capi::ICU4XBidiParagraph_size(this->inner.get()); -} -inline size_t ICU4XBidiParagraph::range_start() const { - return capi::ICU4XBidiParagraph_range_start(this->inner.get()); -} -inline size_t ICU4XBidiParagraph::range_end() const { - return capi::ICU4XBidiParagraph_range_end(this->inner.get()); -} -template inline diplomat::result ICU4XBidiParagraph::reorder_line_to_writeable(size_t range_start, size_t range_end, W& out) const { - capi::DiplomatWriteable out_writer = diplomat::WriteableTrait::Construct(out); - auto diplomat_result_raw_out_value = capi::ICU4XBidiParagraph_reorder_line(this->inner.get(), range_start, range_end, &out_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XBidiParagraph::reorder_line(size_t range_start, size_t range_end) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XBidiParagraph_reorder_line(this->inner.get(), range_start, range_end, &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline uint8_t ICU4XBidiParagraph::level_at(size_t pos) const { - return capi::ICU4XBidiParagraph_level_at(this->inner.get(), pos); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCalendar.h b/third_party/rust/icu_capi/cpp/include/ICU4XCalendar.h deleted file mode 100644 index 9ea6484b5f89..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCalendar.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XCalendar_H -#define ICU4XCalendar_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCalendar ICU4XCalendar; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XCalendar_ICU4XError.h" -#include "ICU4XAnyCalendarKind.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCalendar_ICU4XError ICU4XCalendar_create_for_locale(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XCalendar_ICU4XError ICU4XCalendar_create_for_kind(const ICU4XDataProvider* provider, ICU4XAnyCalendarKind kind); - -ICU4XAnyCalendarKind ICU4XCalendar_kind(const ICU4XCalendar* self); -void ICU4XCalendar_destroy(ICU4XCalendar* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCalendar.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCalendar.hpp deleted file mode 100644 index 5748eae9b875..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCalendar.hpp +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef ICU4XCalendar_HPP -#define ICU4XCalendar_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCalendar.h" - -class ICU4XDataProvider; -class ICU4XLocale; -class ICU4XCalendar; -#include "ICU4XError.hpp" -#include "ICU4XAnyCalendarKind.hpp" - -/** - * A destruction policy for using ICU4XCalendar with std::unique_ptr. - */ -struct ICU4XCalendarDeleter { - void operator()(capi::ICU4XCalendar* l) const noexcept { - capi::ICU4XCalendar_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `AnyCalendar`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html) for more information. - */ -class ICU4XCalendar { - public: - - /** - * Creates a new [`ICU4XCalendar`] from the specified date and time. - * - * See the [Rust documentation for `try_new_for_locale_unstable`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.try_new_for_locale_unstable) for more information. - */ - static diplomat::result create_for_locale(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * Creates a new [`ICU4XCalendar`] from the specified date and time. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_for_kind(const ICU4XDataProvider& provider, ICU4XAnyCalendarKind kind); - - /** - * Returns the kind of this calendar - * - * See the [Rust documentation for `kind`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.kind) for more information. - */ - ICU4XAnyCalendarKind kind() const; - inline const capi::ICU4XCalendar* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCalendar* AsFFIMut() { return this->inner.get(); } - inline ICU4XCalendar(capi::ICU4XCalendar* i) : inner(i) {} - ICU4XCalendar() = default; - ICU4XCalendar(ICU4XCalendar&&) noexcept = default; - ICU4XCalendar& operator=(ICU4XCalendar&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" - -inline diplomat::result ICU4XCalendar::create_for_locale(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XCalendar_create_for_locale(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCalendar(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCalendar::create_for_kind(const ICU4XDataProvider& provider, ICU4XAnyCalendarKind kind) { - auto diplomat_result_raw_out_value = capi::ICU4XCalendar_create_for_kind(provider.AsFFI(), static_cast(kind)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCalendar(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XAnyCalendarKind ICU4XCalendar::kind() const { - return static_cast(capi::ICU4XCalendar_kind(this->inner.get())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalCombiningClassMap.h b/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalCombiningClassMap.h deleted file mode 100644 index f0fc447ba0d4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalCombiningClassMap.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XCanonicalCombiningClassMap_H -#define ICU4XCanonicalCombiningClassMap_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCanonicalCombiningClassMap ICU4XCanonicalCombiningClassMap; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError ICU4XCanonicalCombiningClassMap_create(const ICU4XDataProvider* provider); - -uint8_t ICU4XCanonicalCombiningClassMap_get(const ICU4XCanonicalCombiningClassMap* self, char32_t ch); - -uint8_t ICU4XCanonicalCombiningClassMap_get32(const ICU4XCanonicalCombiningClassMap* self, uint32_t ch); -void ICU4XCanonicalCombiningClassMap_destroy(ICU4XCanonicalCombiningClassMap* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalCombiningClassMap.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalCombiningClassMap.hpp deleted file mode 100644 index f2d092b9db5d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalCombiningClassMap.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef ICU4XCanonicalCombiningClassMap_HPP -#define ICU4XCanonicalCombiningClassMap_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCanonicalCombiningClassMap.h" - -class ICU4XDataProvider; -class ICU4XCanonicalCombiningClassMap; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XCanonicalCombiningClassMap with std::unique_ptr. - */ -struct ICU4XCanonicalCombiningClassMapDeleter { - void operator()(capi::ICU4XCanonicalCombiningClassMap* l) const noexcept { - capi::ICU4XCanonicalCombiningClassMap_destroy(l); - } -}; - -/** - * Lookup of the Canonical_Combining_Class Unicode property - * - * See the [Rust documentation for `CanonicalCombiningClassMap`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html) for more information. - */ -class ICU4XCanonicalCombiningClassMap { - public: - - /** - * Construct a new ICU4XCanonicalCombiningClassMap instance for NFC - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.get) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/properties/properties/struct.CanonicalCombiningClass.html) - */ - uint8_t get(char32_t ch) const; - - /** - * - * - * See the [Rust documentation for `get32`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.get32) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/properties/properties/struct.CanonicalCombiningClass.html) - */ - uint8_t get32(uint32_t ch) const; - inline const capi::ICU4XCanonicalCombiningClassMap* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCanonicalCombiningClassMap* AsFFIMut() { return this->inner.get(); } - inline ICU4XCanonicalCombiningClassMap(capi::ICU4XCanonicalCombiningClassMap* i) : inner(i) {} - ICU4XCanonicalCombiningClassMap() = default; - ICU4XCanonicalCombiningClassMap(ICU4XCanonicalCombiningClassMap&&) noexcept = default; - ICU4XCanonicalCombiningClassMap& operator=(ICU4XCanonicalCombiningClassMap&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline diplomat::result ICU4XCanonicalCombiningClassMap::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCanonicalCombiningClassMap_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCanonicalCombiningClassMap(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint8_t ICU4XCanonicalCombiningClassMap::get(char32_t ch) const { - return capi::ICU4XCanonicalCombiningClassMap_get(this->inner.get(), ch); -} -inline uint8_t ICU4XCanonicalCombiningClassMap::get32(uint32_t ch) const { - return capi::ICU4XCanonicalCombiningClassMap_get32(this->inner.get(), ch); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalComposition.h b/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalComposition.h deleted file mode 100644 index e9ae621739fb..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalComposition.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XCanonicalComposition_H -#define ICU4XCanonicalComposition_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCanonicalComposition ICU4XCanonicalComposition; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCanonicalComposition_ICU4XError ICU4XCanonicalComposition_create(const ICU4XDataProvider* provider); - -char32_t ICU4XCanonicalComposition_compose(const ICU4XCanonicalComposition* self, char32_t starter, char32_t second); -void ICU4XCanonicalComposition_destroy(ICU4XCanonicalComposition* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalComposition.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalComposition.hpp deleted file mode 100644 index 19f128bc5fe5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalComposition.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef ICU4XCanonicalComposition_HPP -#define ICU4XCanonicalComposition_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCanonicalComposition.h" - -class ICU4XDataProvider; -class ICU4XCanonicalComposition; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XCanonicalComposition with std::unique_ptr. - */ -struct ICU4XCanonicalCompositionDeleter { - void operator()(capi::ICU4XCanonicalComposition* l) const noexcept { - capi::ICU4XCanonicalComposition_destroy(l); - } -}; - -/** - * The raw canonical composition operation. - * - * Callers should generally use ICU4XComposingNormalizer unless they specifically need raw composition operations - * - * See the [Rust documentation for `CanonicalComposition`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html) for more information. - */ -class ICU4XCanonicalComposition { - public: - - /** - * Construct a new ICU4XCanonicalComposition instance for NFC - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Performs canonical composition (including Hangul) on a pair of characters - * or returns NUL if these characters don’t compose. Composition exclusions are taken into account. - * - * See the [Rust documentation for `compose`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html#method.compose) for more information. - */ - char32_t compose(char32_t starter, char32_t second) const; - inline const capi::ICU4XCanonicalComposition* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCanonicalComposition* AsFFIMut() { return this->inner.get(); } - inline ICU4XCanonicalComposition(capi::ICU4XCanonicalComposition* i) : inner(i) {} - ICU4XCanonicalComposition() = default; - ICU4XCanonicalComposition(ICU4XCanonicalComposition&&) noexcept = default; - ICU4XCanonicalComposition& operator=(ICU4XCanonicalComposition&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline diplomat::result ICU4XCanonicalComposition::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCanonicalComposition_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCanonicalComposition(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline char32_t ICU4XCanonicalComposition::compose(char32_t starter, char32_t second) const { - return capi::ICU4XCanonicalComposition_compose(this->inner.get(), starter, second); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalDecomposition.h b/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalDecomposition.h deleted file mode 100644 index d18d108b905e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalDecomposition.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XCanonicalDecomposition_H -#define ICU4XCanonicalDecomposition_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCanonicalDecomposition ICU4XCanonicalDecomposition; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h" -#include "ICU4XDecomposed.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError ICU4XCanonicalDecomposition_create(const ICU4XDataProvider* provider); - -ICU4XDecomposed ICU4XCanonicalDecomposition_decompose(const ICU4XCanonicalDecomposition* self, char32_t c); -void ICU4XCanonicalDecomposition_destroy(ICU4XCanonicalDecomposition* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalDecomposition.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalDecomposition.hpp deleted file mode 100644 index ebc5b89a3bc9..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCanonicalDecomposition.hpp +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef ICU4XCanonicalDecomposition_HPP -#define ICU4XCanonicalDecomposition_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCanonicalDecomposition.h" - -class ICU4XDataProvider; -class ICU4XCanonicalDecomposition; -#include "ICU4XError.hpp" -struct ICU4XDecomposed; - -/** - * A destruction policy for using ICU4XCanonicalDecomposition with std::unique_ptr. - */ -struct ICU4XCanonicalDecompositionDeleter { - void operator()(capi::ICU4XCanonicalDecomposition* l) const noexcept { - capi::ICU4XCanonicalDecomposition_destroy(l); - } -}; - -/** - * The raw (non-recursive) canonical decomposition operation. - * - * Callers should generally use ICU4XDecomposingNormalizer unless they specifically need raw composition operations - * - * See the [Rust documentation for `CanonicalDecomposition`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html) for more information. - */ -class ICU4XCanonicalDecomposition { - public: - - /** - * Construct a new ICU4XCanonicalDecomposition instance for NFC - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Performs non-recursive canonical decomposition (including for Hangul). - * - * See the [Rust documentation for `decompose`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.decompose) for more information. - */ - ICU4XDecomposed decompose(char32_t c) const; - inline const capi::ICU4XCanonicalDecomposition* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCanonicalDecomposition* AsFFIMut() { return this->inner.get(); } - inline ICU4XCanonicalDecomposition(capi::ICU4XCanonicalDecomposition* i) : inner(i) {} - ICU4XCanonicalDecomposition() = default; - ICU4XCanonicalDecomposition(ICU4XCanonicalDecomposition&&) noexcept = default; - ICU4XCanonicalDecomposition& operator=(ICU4XCanonicalDecomposition&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XDecomposed.hpp" - -inline diplomat::result ICU4XCanonicalDecomposition::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCanonicalDecomposition_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCanonicalDecomposition(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XDecomposed ICU4XCanonicalDecomposition::decompose(char32_t c) const { - capi::ICU4XDecomposed diplomat_raw_struct_out_value = capi::ICU4XCanonicalDecomposition_decompose(this->inner.get(), c); - return ICU4XDecomposed{ .first = std::move(diplomat_raw_struct_out_value.first), .second = std::move(diplomat_raw_struct_out_value.second) }; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData16.h b/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData16.h deleted file mode 100644 index 19effe2d921f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData16.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ICU4XCodePointMapData16_H -#define ICU4XCodePointMapData16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCodePointMapData16 ICU4XCodePointMapData16; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIterator.h" -#include "ICU4XCodePointSetData.h" -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint16_t ICU4XCodePointMapData16_get(const ICU4XCodePointMapData16* self, char32_t cp); - -uint16_t ICU4XCodePointMapData16_get32(const ICU4XCodePointMapData16* self, uint32_t cp); - -CodePointRangeIterator* ICU4XCodePointMapData16_iter_ranges_for_value(const ICU4XCodePointMapData16* self, uint16_t value); - -CodePointRangeIterator* ICU4XCodePointMapData16_iter_ranges_for_value_complemented(const ICU4XCodePointMapData16* self, uint16_t value); - -ICU4XCodePointSetData* ICU4XCodePointMapData16_get_set_for_value(const ICU4XCodePointMapData16* self, uint16_t value); - -diplomat_result_box_ICU4XCodePointMapData16_ICU4XError ICU4XCodePointMapData16_load_script(const ICU4XDataProvider* provider); -void ICU4XCodePointMapData16_destroy(ICU4XCodePointMapData16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData16.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData16.hpp deleted file mode 100644 index b2ef8318aaca..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData16.hpp +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef ICU4XCodePointMapData16_HPP -#define ICU4XCodePointMapData16_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCodePointMapData16.h" - -class CodePointRangeIterator; -class ICU4XCodePointSetData; -class ICU4XDataProvider; -class ICU4XCodePointMapData16; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XCodePointMapData16 with std::unique_ptr. - */ -struct ICU4XCodePointMapData16Deleter { - void operator()(capi::ICU4XCodePointMapData16* l) const noexcept { - capi::ICU4XCodePointMapData16_destroy(l); - } -}; - -/** - * An ICU4X Unicode Map Property object, capable of querying whether a code point (key) to obtain the Unicode property value, for a specific Unicode property. - * - * For properties whose values fit into 16 bits. - * - * See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information. - * - * See the [Rust documentation for `CodePointMapData`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html) for more information. - * - * See the [Rust documentation for `CodePointMapDataBorrowed`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html) for more information. - */ -class ICU4XCodePointMapData16 { - public: - - /** - * Gets the value for a code point. - * - * See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get) for more information. - */ - uint16_t get(char32_t cp) const; - - /** - * Gets the value for a code point (specified as a 32 bit integer, in UTF-32) - */ - uint16_t get32(uint32_t cp) const; - - /** - * Produces an iterator over ranges of code points that map to `value` - * - * See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_for_value(uint16_t value) const; - - /** - * Produces an iterator over ranges of code points that do not map to `value` - * - * See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_for_value_complemented(uint16_t value) const; - - /** - * Gets a [`ICU4XCodePointSetData`] representing all entries in this map that map to the given value - * - * See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information. - */ - ICU4XCodePointSetData get_set_for_value(uint16_t value) const; - - /** - * - * - * See the [Rust documentation for `load_script`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_script.html) for more information. - */ - static diplomat::result load_script(const ICU4XDataProvider& provider); - inline const capi::ICU4XCodePointMapData16* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCodePointMapData16* AsFFIMut() { return this->inner.get(); } - inline ICU4XCodePointMapData16(capi::ICU4XCodePointMapData16* i) : inner(i) {} - ICU4XCodePointMapData16() = default; - ICU4XCodePointMapData16(ICU4XCodePointMapData16&&) noexcept = default; - ICU4XCodePointMapData16& operator=(ICU4XCodePointMapData16&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "CodePointRangeIterator.hpp" -#include "ICU4XCodePointSetData.hpp" -#include "ICU4XDataProvider.hpp" - -inline uint16_t ICU4XCodePointMapData16::get(char32_t cp) const { - return capi::ICU4XCodePointMapData16_get(this->inner.get(), cp); -} -inline uint16_t ICU4XCodePointMapData16::get32(uint32_t cp) const { - return capi::ICU4XCodePointMapData16_get32(this->inner.get(), cp); -} -inline CodePointRangeIterator ICU4XCodePointMapData16::iter_ranges_for_value(uint16_t value) const { - return CodePointRangeIterator(capi::ICU4XCodePointMapData16_iter_ranges_for_value(this->inner.get(), value)); -} -inline CodePointRangeIterator ICU4XCodePointMapData16::iter_ranges_for_value_complemented(uint16_t value) const { - return CodePointRangeIterator(capi::ICU4XCodePointMapData16_iter_ranges_for_value_complemented(this->inner.get(), value)); -} -inline ICU4XCodePointSetData ICU4XCodePointMapData16::get_set_for_value(uint16_t value) const { - return ICU4XCodePointSetData(capi::ICU4XCodePointMapData16_get_set_for_value(this->inner.get(), value)); -} -inline diplomat::result ICU4XCodePointMapData16::load_script(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData16_load_script(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData16(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData8.h b/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData8.h deleted file mode 100644 index 69a6a46b900a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData8.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef ICU4XCodePointMapData8_H -#define ICU4XCodePointMapData8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCodePointMapData8 ICU4XCodePointMapData8; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIterator.h" -#include "ICU4XCodePointSetData.h" -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint8_t ICU4XCodePointMapData8_get(const ICU4XCodePointMapData8* self, char32_t cp); - -uint8_t ICU4XCodePointMapData8_get32(const ICU4XCodePointMapData8* self, uint32_t cp); - -uint32_t ICU4XCodePointMapData8_general_category_to_mask(uint8_t gc); - -CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_value(const ICU4XCodePointMapData8* self, uint8_t value); - -CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_value_complemented(const ICU4XCodePointMapData8* self, uint8_t value); - -CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_mask(const ICU4XCodePointMapData8* self, uint32_t mask); - -ICU4XCodePointSetData* ICU4XCodePointMapData8_get_set_for_value(const ICU4XCodePointMapData8* self, uint8_t value); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_general_category(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_bidi_class(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_east_asian_width(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_line_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_try_grapheme_cluster_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_word_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_sentence_break(const ICU4XDataProvider* provider); -void ICU4XCodePointMapData8_destroy(ICU4XCodePointMapData8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData8.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData8.hpp deleted file mode 100644 index b74ea2061b48..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointMapData8.hpp +++ /dev/null @@ -1,258 +0,0 @@ -#ifndef ICU4XCodePointMapData8_HPP -#define ICU4XCodePointMapData8_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCodePointMapData8.h" - -class CodePointRangeIterator; -class ICU4XCodePointSetData; -class ICU4XDataProvider; -class ICU4XCodePointMapData8; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XCodePointMapData8 with std::unique_ptr. - */ -struct ICU4XCodePointMapData8Deleter { - void operator()(capi::ICU4XCodePointMapData8* l) const noexcept { - capi::ICU4XCodePointMapData8_destroy(l); - } -}; - -/** - * An ICU4X Unicode Map Property object, capable of querying whether a code point (key) to obtain the Unicode property value, for a specific Unicode property. - * - * For properties whose values fit into 8 bits. - * - * See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information. - * - * See the [Rust documentation for `CodePointMapData`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html) for more information. - * - * See the [Rust documentation for `CodePointMapDataBorrowed`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html) for more information. - */ -class ICU4XCodePointMapData8 { - public: - - /** - * Gets the value for a code point. - * - * See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get) for more information. - */ - uint8_t get(char32_t cp) const; - - /** - * Gets the value for a code point (specified as a 32 bit integer, in UTF-32) - */ - uint8_t get32(uint32_t cp) const; - - /** - * Converts a general category to its corresponding mask value - * - * Nonexistant general categories will map to the empty mask - * - * See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html) for more information. - */ - static uint32_t general_category_to_mask(uint8_t gc); - - /** - * Produces an iterator over ranges of code points that map to `value` - * - * See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_for_value(uint8_t value) const; - - /** - * Produces an iterator over ranges of code points that do not map to `value` - * - * See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_for_value_complemented(uint8_t value) const; - - /** - * Given a mask value (the nth bit marks property value = n), produce an iterator over ranges of code points - * whose property values are contained in the mask. - * - * The main mask property supported is that for General_Category, which can be obtained via `general_category_to_mask()` or - * by using `ICU4XGeneralCategoryNameToMaskMapper` - * - * Should only be used on maps for properties with values less than 32 (like Generak_Category), - * other maps will have unpredictable results - * - * See the [Rust documentation for `iter_ranges_for_group`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_group) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_for_mask(uint32_t mask) const; - - /** - * Gets a [`ICU4XCodePointSetData`] representing all entries in this map that map to the given value - * - * See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information. - */ - ICU4XCodePointSetData get_set_for_value(uint8_t value) const; - - /** - * - * - * See the [Rust documentation for `load_general_category`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_general_category.html) for more information. - */ - static diplomat::result load_general_category(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_bidi_class`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_bidi_class.html) for more information. - */ - static diplomat::result load_bidi_class(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_east_asian_width`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_east_asian_width.html) for more information. - */ - static diplomat::result load_east_asian_width(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_line_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_line_break.html) for more information. - */ - static diplomat::result load_line_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_grapheme_cluster_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_grapheme_cluster_break.html) for more information. - */ - static diplomat::result try_grapheme_cluster_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_word_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_word_break.html) for more information. - */ - static diplomat::result load_word_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_sentence_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.load_sentence_break.html) for more information. - */ - static diplomat::result load_sentence_break(const ICU4XDataProvider& provider); - inline const capi::ICU4XCodePointMapData8* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCodePointMapData8* AsFFIMut() { return this->inner.get(); } - inline ICU4XCodePointMapData8(capi::ICU4XCodePointMapData8* i) : inner(i) {} - ICU4XCodePointMapData8() = default; - ICU4XCodePointMapData8(ICU4XCodePointMapData8&&) noexcept = default; - ICU4XCodePointMapData8& operator=(ICU4XCodePointMapData8&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "CodePointRangeIterator.hpp" -#include "ICU4XCodePointSetData.hpp" -#include "ICU4XDataProvider.hpp" - -inline uint8_t ICU4XCodePointMapData8::get(char32_t cp) const { - return capi::ICU4XCodePointMapData8_get(this->inner.get(), cp); -} -inline uint8_t ICU4XCodePointMapData8::get32(uint32_t cp) const { - return capi::ICU4XCodePointMapData8_get32(this->inner.get(), cp); -} -inline uint32_t ICU4XCodePointMapData8::general_category_to_mask(uint8_t gc) { - return capi::ICU4XCodePointMapData8_general_category_to_mask(gc); -} -inline CodePointRangeIterator ICU4XCodePointMapData8::iter_ranges_for_value(uint8_t value) const { - return CodePointRangeIterator(capi::ICU4XCodePointMapData8_iter_ranges_for_value(this->inner.get(), value)); -} -inline CodePointRangeIterator ICU4XCodePointMapData8::iter_ranges_for_value_complemented(uint8_t value) const { - return CodePointRangeIterator(capi::ICU4XCodePointMapData8_iter_ranges_for_value_complemented(this->inner.get(), value)); -} -inline CodePointRangeIterator ICU4XCodePointMapData8::iter_ranges_for_mask(uint32_t mask) const { - return CodePointRangeIterator(capi::ICU4XCodePointMapData8_iter_ranges_for_mask(this->inner.get(), mask)); -} -inline ICU4XCodePointSetData ICU4XCodePointMapData8::get_set_for_value(uint8_t value) const { - return ICU4XCodePointSetData(capi::ICU4XCodePointMapData8_get_set_for_value(this->inner.get(), value)); -} -inline diplomat::result ICU4XCodePointMapData8::load_general_category(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_load_general_category(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointMapData8::load_bidi_class(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_load_bidi_class(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointMapData8::load_east_asian_width(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_load_east_asian_width(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointMapData8::load_line_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_load_line_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointMapData8::try_grapheme_cluster_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_try_grapheme_cluster_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointMapData8::load_word_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_load_word_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointMapData8::load_sentence_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointMapData8_load_sentence_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointMapData8(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointSetData.h b/third_party/rust/icu_capi/cpp/include/ICU4XCodePointSetData.h deleted file mode 100644 index 10356e90b7b5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointSetData.h +++ /dev/null @@ -1,172 +0,0 @@ -#ifndef ICU4XCodePointSetData_H -#define ICU4XCodePointSetData_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCodePointSetData ICU4XCodePointSetData; -#ifdef __cplusplus -} // namespace capi -#endif -#include "CodePointRangeIterator.h" -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XCodePointSetData_contains(const ICU4XCodePointSetData* self, char32_t cp); - -bool ICU4XCodePointSetData_contains32(const ICU4XCodePointSetData* self, uint32_t cp); - -CodePointRangeIterator* ICU4XCodePointSetData_iter_ranges(const ICU4XCodePointSetData* self); - -CodePointRangeIterator* ICU4XCodePointSetData_iter_ranges_complemented(const ICU4XCodePointSetData* self); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_for_general_category_group(const ICU4XDataProvider* provider, uint32_t group); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ascii_hex_digit(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_alnum(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_alphabetic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_bidi_control(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_bidi_mirrored(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_blank(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_cased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_case_ignorable(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_full_composition_exclusion(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_casefolded(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_casemapped(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_lowercased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_titlecased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_uppercased(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_dash(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_deprecated(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_default_ignorable_code_point(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_diacritic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_modifier_base(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_component(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_modifier(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_presentation(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_extender(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_extended_pictographic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_graph(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_base(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_extend(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_link(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_hex_digit(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_hyphen(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_id_continue(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ideographic(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_id_start(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ids_binary_operator(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ids_trinary_operator(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_join_control(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_logical_order_exception(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_lowercase(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_math(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_noncharacter_code_point(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfc_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfd_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfkc_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfkd_inert(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_pattern_syntax(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_pattern_white_space(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_prepended_concatenation_mark(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_print(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_quotation_mark(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_radical(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_regional_indicator(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_soft_dotted(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_segment_starter(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_case_sensitive(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_sentence_terminal(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_terminal_punctuation(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_unified_ideograph(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_uppercase(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_variation_selector(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_white_space(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xdigit(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xid_continue(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xid_start(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_for_ecma262(const ICU4XDataProvider* provider, const char* property_name_data, size_t property_name_len); -void ICU4XCodePointSetData_destroy(ICU4XCodePointSetData* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointSetData.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCodePointSetData.hpp deleted file mode 100644 index d46d6bba10a6..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCodePointSetData.hpp +++ /dev/null @@ -1,1239 +0,0 @@ -#ifndef ICU4XCodePointSetData_HPP -#define ICU4XCodePointSetData_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCodePointSetData.h" - -class CodePointRangeIterator; -class ICU4XDataProvider; -class ICU4XCodePointSetData; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XCodePointSetData with std::unique_ptr. - */ -struct ICU4XCodePointSetDataDeleter { - void operator()(capi::ICU4XCodePointSetData* l) const noexcept { - capi::ICU4XCodePointSetData_destroy(l); - } -}; - -/** - * An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property. - * - * See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information. - * - * See the [Rust documentation for `CodePointSetData`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetData.html) for more information. - * - * See the [Rust documentation for `CodePointSetDataBorrowed`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html) for more information. - */ -class ICU4XCodePointSetData { - public: - - /** - * Checks whether the code point is in the set. - * - * See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.contains) for more information. - */ - bool contains(char32_t cp) const; - - /** - * Checks whether the code point (specified as a 32 bit integer, in UTF-32) is in the set. - */ - bool contains32(uint32_t cp) const; - - /** - * Produces an iterator over ranges of code points contained in this set - * - * See the [Rust documentation for `iter_ranges`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges() const; - - /** - * Produces an iterator over ranges of code points not contained in this set - * - * See the [Rust documentation for `iter_ranges_complemented`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges_complemented) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_complemented() const; - - /** - * which is a mask with the same format as the `U_GC_XX_MASK` mask in ICU4C - * - * See the [Rust documentation for `load_for_general_category_group`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_for_general_category_group.html) for more information. - */ - static diplomat::result load_for_general_category_group(const ICU4XDataProvider& provider, uint32_t group); - - /** - * - * - * See the [Rust documentation for `load_ascii_hex_digit`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_ascii_hex_digit.html) for more information. - */ - static diplomat::result load_ascii_hex_digit(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_alnum`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_alnum.html) for more information. - */ - static diplomat::result load_alnum(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_alphabetic`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_alphabetic.html) for more information. - */ - static diplomat::result load_alphabetic(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_bidi_control`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_bidi_control.html) for more information. - */ - static diplomat::result load_bidi_control(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_bidi_mirrored`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_bidi_mirrored.html) for more information. - */ - static diplomat::result load_bidi_mirrored(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_blank`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_blank.html) for more information. - */ - static diplomat::result load_blank(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_cased`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_cased.html) for more information. - */ - static diplomat::result load_cased(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_case_ignorable`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_case_ignorable.html) for more information. - */ - static diplomat::result load_case_ignorable(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_full_composition_exclusion`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_full_composition_exclusion.html) for more information. - */ - static diplomat::result load_full_composition_exclusion(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_changes_when_casefolded`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_casefolded.html) for more information. - */ - static diplomat::result load_changes_when_casefolded(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_changes_when_casemapped`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_casemapped.html) for more information. - */ - static diplomat::result load_changes_when_casemapped(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_changes_when_nfkc_casefolded`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_nfkc_casefolded.html) for more information. - */ - static diplomat::result load_changes_when_nfkc_casefolded(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_changes_when_lowercased`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_lowercased.html) for more information. - */ - static diplomat::result load_changes_when_lowercased(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_changes_when_titlecased`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_titlecased.html) for more information. - */ - static diplomat::result load_changes_when_titlecased(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_changes_when_uppercased`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_uppercased.html) for more information. - */ - static diplomat::result load_changes_when_uppercased(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_dash`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_dash.html) for more information. - */ - static diplomat::result load_dash(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_deprecated`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_deprecated.html) for more information. - */ - static diplomat::result load_deprecated(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_default_ignorable_code_point`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_default_ignorable_code_point.html) for more information. - */ - static diplomat::result load_default_ignorable_code_point(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_diacritic`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_diacritic.html) for more information. - */ - static diplomat::result load_diacritic(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_emoji_modifier_base`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_modifier_base.html) for more information. - */ - static diplomat::result load_emoji_modifier_base(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_emoji_component`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_component.html) for more information. - */ - static diplomat::result load_emoji_component(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_emoji_modifier`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_modifier.html) for more information. - */ - static diplomat::result load_emoji_modifier(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_emoji`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji.html) for more information. - */ - static diplomat::result load_emoji(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_emoji_presentation`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_presentation.html) for more information. - */ - static diplomat::result load_emoji_presentation(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_extender`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_extender.html) for more information. - */ - static diplomat::result load_extender(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_extended_pictographic`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_extended_pictographic.html) for more information. - */ - static diplomat::result load_extended_pictographic(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_graph`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_graph.html) for more information. - */ - static diplomat::result load_graph(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_grapheme_base`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_grapheme_base.html) for more information. - */ - static diplomat::result load_grapheme_base(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_grapheme_extend`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_grapheme_extend.html) for more information. - */ - static diplomat::result load_grapheme_extend(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_grapheme_link`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_grapheme_link.html) for more information. - */ - static diplomat::result load_grapheme_link(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_hex_digit`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_hex_digit.html) for more information. - */ - static diplomat::result load_hex_digit(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_hyphen`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_hyphen.html) for more information. - */ - static diplomat::result load_hyphen(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_id_continue`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_id_continue.html) for more information. - */ - static diplomat::result load_id_continue(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_ideographic`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_ideographic.html) for more information. - */ - static diplomat::result load_ideographic(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_id_start`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_id_start.html) for more information. - */ - static diplomat::result load_id_start(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_ids_binary_operator`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_ids_binary_operator.html) for more information. - */ - static diplomat::result load_ids_binary_operator(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_ids_trinary_operator`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_ids_trinary_operator.html) for more information. - */ - static diplomat::result load_ids_trinary_operator(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_join_control`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_join_control.html) for more information. - */ - static diplomat::result load_join_control(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_logical_order_exception`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_logical_order_exception.html) for more information. - */ - static diplomat::result load_logical_order_exception(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_lowercase`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_lowercase.html) for more information. - */ - static diplomat::result load_lowercase(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_math`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_math.html) for more information. - */ - static diplomat::result load_math(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_noncharacter_code_point`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_noncharacter_code_point.html) for more information. - */ - static diplomat::result load_noncharacter_code_point(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_nfc_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfc_inert.html) for more information. - */ - static diplomat::result load_nfc_inert(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_nfd_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfd_inert.html) for more information. - */ - static diplomat::result load_nfd_inert(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_nfkc_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfkc_inert.html) for more information. - */ - static diplomat::result load_nfkc_inert(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_nfkd_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfkd_inert.html) for more information. - */ - static diplomat::result load_nfkd_inert(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_pattern_syntax`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_pattern_syntax.html) for more information. - */ - static diplomat::result load_pattern_syntax(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_pattern_white_space`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_pattern_white_space.html) for more information. - */ - static diplomat::result load_pattern_white_space(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_prepended_concatenation_mark`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_prepended_concatenation_mark.html) for more information. - */ - static diplomat::result load_prepended_concatenation_mark(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_print`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_print.html) for more information. - */ - static diplomat::result load_print(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_quotation_mark`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_quotation_mark.html) for more information. - */ - static diplomat::result load_quotation_mark(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_radical`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_radical.html) for more information. - */ - static diplomat::result load_radical(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_regional_indicator`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_regional_indicator.html) for more information. - */ - static diplomat::result load_regional_indicator(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_soft_dotted`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_soft_dotted.html) for more information. - */ - static diplomat::result load_soft_dotted(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_segment_starter`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_segment_starter.html) for more information. - */ - static diplomat::result load_segment_starter(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_case_sensitive`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_case_sensitive.html) for more information. - */ - static diplomat::result load_case_sensitive(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_sentence_terminal`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_sentence_terminal.html) for more information. - */ - static diplomat::result load_sentence_terminal(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_terminal_punctuation`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_terminal_punctuation.html) for more information. - */ - static diplomat::result load_terminal_punctuation(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_unified_ideograph`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_unified_ideograph.html) for more information. - */ - static diplomat::result load_unified_ideograph(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_uppercase`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_uppercase.html) for more information. - */ - static diplomat::result load_uppercase(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_variation_selector`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_variation_selector.html) for more information. - */ - static diplomat::result load_variation_selector(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_white_space`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_white_space.html) for more information. - */ - static diplomat::result load_white_space(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_xdigit`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_xdigit.html) for more information. - */ - static diplomat::result load_xdigit(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_xid_continue`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_xid_continue.html) for more information. - */ - static diplomat::result load_xid_continue(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_xid_start`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_xid_start.html) for more information. - */ - static diplomat::result load_xid_start(const ICU4XDataProvider& provider); - - /** - * Loads data for a property specified as a string as long as it is one of the - * [ECMA-262 binary properties][ecma] (not including Any, ASCII, and Assigned pseudoproperties). - * - * Returns `ICU4XError::PropertyUnexpectedPropertyNameError` in case the string does not - * match any property in the list - * - * [ecma]: https://tc39.es/ecma262/#table-binary-unicode-properties - * - * See the [Rust documentation for `load_for_ecma262_unstable`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_for_ecma262_unstable.html) for more information. - */ - static diplomat::result load_for_ecma262(const ICU4XDataProvider& provider, const std::string_view property_name); - inline const capi::ICU4XCodePointSetData* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCodePointSetData* AsFFIMut() { return this->inner.get(); } - inline ICU4XCodePointSetData(capi::ICU4XCodePointSetData* i) : inner(i) {} - ICU4XCodePointSetData() = default; - ICU4XCodePointSetData(ICU4XCodePointSetData&&) noexcept = default; - ICU4XCodePointSetData& operator=(ICU4XCodePointSetData&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "CodePointRangeIterator.hpp" -#include "ICU4XDataProvider.hpp" - -inline bool ICU4XCodePointSetData::contains(char32_t cp) const { - return capi::ICU4XCodePointSetData_contains(this->inner.get(), cp); -} -inline bool ICU4XCodePointSetData::contains32(uint32_t cp) const { - return capi::ICU4XCodePointSetData_contains32(this->inner.get(), cp); -} -inline CodePointRangeIterator ICU4XCodePointSetData::iter_ranges() const { - return CodePointRangeIterator(capi::ICU4XCodePointSetData_iter_ranges(this->inner.get())); -} -inline CodePointRangeIterator ICU4XCodePointSetData::iter_ranges_complemented() const { - return CodePointRangeIterator(capi::ICU4XCodePointSetData_iter_ranges_complemented(this->inner.get())); -} -inline diplomat::result ICU4XCodePointSetData::load_for_general_category_group(const ICU4XDataProvider& provider, uint32_t group) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_for_general_category_group(provider.AsFFI(), group); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_ascii_hex_digit(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_ascii_hex_digit(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_alnum(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_alnum(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_alphabetic(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_alphabetic(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_bidi_control(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_bidi_control(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_bidi_mirrored(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_bidi_mirrored(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_blank(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_blank(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_cased(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_cased(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_case_ignorable(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_case_ignorable(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_full_composition_exclusion(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_full_composition_exclusion(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_changes_when_casefolded(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_changes_when_casefolded(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_changes_when_casemapped(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_changes_when_casemapped(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_changes_when_nfkc_casefolded(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_changes_when_lowercased(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_changes_when_lowercased(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_changes_when_titlecased(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_changes_when_titlecased(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_changes_when_uppercased(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_changes_when_uppercased(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_dash(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_dash(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_deprecated(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_deprecated(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_default_ignorable_code_point(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_default_ignorable_code_point(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_diacritic(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_diacritic(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_emoji_modifier_base(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_emoji_modifier_base(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_emoji_component(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_emoji_component(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_emoji_modifier(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_emoji_modifier(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_emoji(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_emoji(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_emoji_presentation(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_emoji_presentation(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_extender(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_extender(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_extended_pictographic(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_extended_pictographic(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_graph(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_graph(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_grapheme_base(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_grapheme_base(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_grapheme_extend(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_grapheme_extend(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_grapheme_link(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_grapheme_link(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_hex_digit(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_hex_digit(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_hyphen(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_hyphen(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_id_continue(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_id_continue(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_ideographic(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_ideographic(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_id_start(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_id_start(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_ids_binary_operator(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_ids_binary_operator(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_ids_trinary_operator(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_ids_trinary_operator(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_join_control(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_join_control(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_logical_order_exception(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_logical_order_exception(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_lowercase(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_lowercase(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_math(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_math(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_noncharacter_code_point(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_noncharacter_code_point(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_nfc_inert(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_nfc_inert(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_nfd_inert(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_nfd_inert(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_nfkc_inert(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_nfkc_inert(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_nfkd_inert(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_nfkd_inert(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_pattern_syntax(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_pattern_syntax(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_pattern_white_space(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_pattern_white_space(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_prepended_concatenation_mark(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_prepended_concatenation_mark(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_print(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_print(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_quotation_mark(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_quotation_mark(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_radical(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_radical(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_regional_indicator(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_regional_indicator(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_soft_dotted(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_soft_dotted(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_segment_starter(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_segment_starter(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_case_sensitive(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_case_sensitive(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_sentence_terminal(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_sentence_terminal(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_terminal_punctuation(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_terminal_punctuation(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_unified_ideograph(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_unified_ideograph(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_uppercase(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_uppercase(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_variation_selector(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_variation_selector(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_white_space(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_white_space(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_xdigit(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_xdigit(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_xid_continue(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_xid_continue(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_xid_start(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_xid_start(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCodePointSetData::load_for_ecma262(const ICU4XDataProvider& provider, const std::string_view property_name) { - auto diplomat_result_raw_out_value = capi::ICU4XCodePointSetData_load_for_ecma262(provider.AsFFI(), property_name.data(), property_name.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCodePointSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollator.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollator.h deleted file mode 100644 index 973c2cedd96a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollator.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XCollator_H -#define ICU4XCollator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCollator ICU4XCollator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XCollatorOptionsV1.h" -#include "diplomat_result_box_ICU4XCollator_ICU4XError.h" -#include "ICU4XOrdering.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCollator_ICU4XError ICU4XCollator_create_v1(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XCollatorOptionsV1 options); - -ICU4XOrdering ICU4XCollator_compare(const ICU4XCollator* self, const char* left_data, size_t left_len, const char* right_data, size_t right_len); - -ICU4XOrdering ICU4XCollator_compare_valid_utf8(const ICU4XCollator* self, const char* left_data, size_t left_len, const char* right_data, size_t right_len); - -ICU4XOrdering ICU4XCollator_compare_utf16(const ICU4XCollator* self, const uint16_t* left_data, size_t left_len, const uint16_t* right_data, size_t right_len); -void ICU4XCollator_destroy(ICU4XCollator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollator.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollator.hpp deleted file mode 100644 index daba03c9f124..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollator.hpp +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef ICU4XCollator_HPP -#define ICU4XCollator_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollator.h" - -class ICU4XDataProvider; -class ICU4XLocale; -struct ICU4XCollatorOptionsV1; -class ICU4XCollator; -#include "ICU4XError.hpp" -#include "ICU4XOrdering.hpp" - -/** - * A destruction policy for using ICU4XCollator with std::unique_ptr. - */ -struct ICU4XCollatorDeleter { - void operator()(capi::ICU4XCollator* l) const noexcept { - capi::ICU4XCollator_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `Collator`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html) for more information. - */ -class ICU4XCollator { - public: - - /** - * Construct a new Collator instance. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_v1(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XCollatorOptionsV1 options); - - /** - * Compare potentially ill-formed UTF-8 strings. - * - * Ill-formed input is compared - * as if errors had been replaced with REPLACEMENT CHARACTERs according - * to the WHATWG Encoding Standard. - * - * See the [Rust documentation for `compare_utf8`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf8) for more information. - */ - ICU4XOrdering compare(const std::string_view left, const std::string_view right) const; - - /** - * Compare guaranteed well-formed UTF-8 strings. - * - * Note: In C++, passing ill-formed UTF-8 strings is undefined behavior - * (and may be memory-unsafe to do so, too). - * - * See the [Rust documentation for `compare`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare) for more information. - */ - ICU4XOrdering compare_valid_utf8(const std::string_view left, const std::string_view right) const; - - /** - * Compare potentially ill-formed UTF-16 strings, with unpaired surrogates - * compared as REPLACEMENT CHARACTER. - * - * See the [Rust documentation for `compare_utf16`](https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf16) for more information. - */ - ICU4XOrdering compare_utf16(const diplomat::span left, const diplomat::span right) const; - inline const capi::ICU4XCollator* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCollator* AsFFIMut() { return this->inner.get(); } - inline ICU4XCollator(capi::ICU4XCollator* i) : inner(i) {} - ICU4XCollator() = default; - ICU4XCollator(ICU4XCollator&&) noexcept = default; - ICU4XCollator& operator=(ICU4XCollator&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XCollatorOptionsV1.hpp" - -inline diplomat::result ICU4XCollator::create_v1(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XCollatorOptionsV1 options) { - ICU4XCollatorOptionsV1 diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XCollator_create_v1(provider.AsFFI(), locale.AsFFI(), capi::ICU4XCollatorOptionsV1{ .strength = static_cast(diplomat_wrapped_struct_options.strength), .alternate_handling = static_cast(diplomat_wrapped_struct_options.alternate_handling), .case_first = static_cast(diplomat_wrapped_struct_options.case_first), .max_variable = static_cast(diplomat_wrapped_struct_options.max_variable), .case_level = static_cast(diplomat_wrapped_struct_options.case_level), .numeric = static_cast(diplomat_wrapped_struct_options.numeric), .backward_second_level = static_cast(diplomat_wrapped_struct_options.backward_second_level) }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCollator(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XOrdering ICU4XCollator::compare(const std::string_view left, const std::string_view right) const { - return static_cast(capi::ICU4XCollator_compare(this->inner.get(), left.data(), left.size(), right.data(), right.size())); -} -inline ICU4XOrdering ICU4XCollator::compare_valid_utf8(const std::string_view left, const std::string_view right) const { - return static_cast(capi::ICU4XCollator_compare_valid_utf8(this->inner.get(), left.data(), left.size(), right.data(), right.size())); -} -inline ICU4XOrdering ICU4XCollator::compare_utf16(const diplomat::span left, const diplomat::span right) const { - return static_cast(capi::ICU4XCollator_compare_utf16(this->inner.get(), left.data(), left.size(), right.data(), right.size())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorAlternateHandling.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorAlternateHandling.h deleted file mode 100644 index dfc3d595eb2a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorAlternateHandling.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorAlternateHandling_H -#define ICU4XCollatorAlternateHandling_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorAlternateHandling { - ICU4XCollatorAlternateHandling_Auto = 0, - ICU4XCollatorAlternateHandling_NonIgnorable = 1, - ICU4XCollatorAlternateHandling_Shifted = 2, -} ICU4XCollatorAlternateHandling; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorAlternateHandling_destroy(ICU4XCollatorAlternateHandling* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorAlternateHandling.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorAlternateHandling.hpp deleted file mode 100644 index f48e89367a2b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorAlternateHandling.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XCollatorAlternateHandling_HPP -#define ICU4XCollatorAlternateHandling_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorAlternateHandling.h" - - - -/** - * - * - * See the [Rust documentation for `AlternateHandling`](https://docs.rs/icu/latest/icu/collator/enum.AlternateHandling.html) for more information. - */ -enum struct ICU4XCollatorAlternateHandling { - Auto = 0, - NonIgnorable = 1, - Shifted = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorBackwardSecondLevel.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorBackwardSecondLevel.h deleted file mode 100644 index 659f9b2f1093..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorBackwardSecondLevel.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorBackwardSecondLevel_H -#define ICU4XCollatorBackwardSecondLevel_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorBackwardSecondLevel { - ICU4XCollatorBackwardSecondLevel_Auto = 0, - ICU4XCollatorBackwardSecondLevel_Off = 1, - ICU4XCollatorBackwardSecondLevel_On = 2, -} ICU4XCollatorBackwardSecondLevel; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorBackwardSecondLevel_destroy(ICU4XCollatorBackwardSecondLevel* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorBackwardSecondLevel.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorBackwardSecondLevel.hpp deleted file mode 100644 index ecab822487cc..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorBackwardSecondLevel.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XCollatorBackwardSecondLevel_HPP -#define ICU4XCollatorBackwardSecondLevel_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorBackwardSecondLevel.h" - - - -/** - * - * - * See the [Rust documentation for `BackwardSecondLevel`](https://docs.rs/icu/latest/icu/collator/enum.BackwardSecondLevel.html) for more information. - */ -enum struct ICU4XCollatorBackwardSecondLevel { - Auto = 0, - Off = 1, - On = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseFirst.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseFirst.h deleted file mode 100644 index c01eb216d09d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseFirst.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XCollatorCaseFirst_H -#define ICU4XCollatorCaseFirst_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorCaseFirst { - ICU4XCollatorCaseFirst_Auto = 0, - ICU4XCollatorCaseFirst_Off = 1, - ICU4XCollatorCaseFirst_LowerFirst = 2, - ICU4XCollatorCaseFirst_UpperFirst = 3, -} ICU4XCollatorCaseFirst; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorCaseFirst_destroy(ICU4XCollatorCaseFirst* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseFirst.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseFirst.hpp deleted file mode 100644 index d93c67b4e907..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseFirst.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ICU4XCollatorCaseFirst_HPP -#define ICU4XCollatorCaseFirst_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorCaseFirst.h" - - - -/** - * - * - * See the [Rust documentation for `CaseFirst`](https://docs.rs/icu/latest/icu/collator/enum.CaseFirst.html) for more information. - */ -enum struct ICU4XCollatorCaseFirst { - Auto = 0, - Off = 1, - LowerFirst = 2, - UpperFirst = 3, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseLevel.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseLevel.h deleted file mode 100644 index cbf686596775..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseLevel.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorCaseLevel_H -#define ICU4XCollatorCaseLevel_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorCaseLevel { - ICU4XCollatorCaseLevel_Auto = 0, - ICU4XCollatorCaseLevel_Off = 1, - ICU4XCollatorCaseLevel_On = 2, -} ICU4XCollatorCaseLevel; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorCaseLevel_destroy(ICU4XCollatorCaseLevel* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseLevel.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseLevel.hpp deleted file mode 100644 index 30670910c817..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorCaseLevel.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XCollatorCaseLevel_HPP -#define ICU4XCollatorCaseLevel_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorCaseLevel.h" - - - -/** - * - * - * See the [Rust documentation for `CaseLevel`](https://docs.rs/icu/latest/icu/collator/enum.CaseLevel.html) for more information. - */ -enum struct ICU4XCollatorCaseLevel { - Auto = 0, - Off = 1, - On = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorMaxVariable.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorMaxVariable.h deleted file mode 100644 index 0e5a3a516fec..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorMaxVariable.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XCollatorMaxVariable_H -#define ICU4XCollatorMaxVariable_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorMaxVariable { - ICU4XCollatorMaxVariable_Auto = 0, - ICU4XCollatorMaxVariable_Space = 1, - ICU4XCollatorMaxVariable_Punctuation = 2, - ICU4XCollatorMaxVariable_Symbol = 3, - ICU4XCollatorMaxVariable_Currency = 4, -} ICU4XCollatorMaxVariable; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorMaxVariable_destroy(ICU4XCollatorMaxVariable* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorMaxVariable.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorMaxVariable.hpp deleted file mode 100644 index 60ce7e267e7d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorMaxVariable.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XCollatorMaxVariable_HPP -#define ICU4XCollatorMaxVariable_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorMaxVariable.h" - - - -/** - * - * - * See the [Rust documentation for `MaxVariable`](https://docs.rs/icu/latest/icu/collator/enum.MaxVariable.html) for more information. - */ -enum struct ICU4XCollatorMaxVariable { - Auto = 0, - Space = 1, - Punctuation = 2, - Symbol = 3, - Currency = 4, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorNumeric.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorNumeric.h deleted file mode 100644 index 4dd2ec0408f2..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorNumeric.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XCollatorNumeric_H -#define ICU4XCollatorNumeric_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorNumeric { - ICU4XCollatorNumeric_Auto = 0, - ICU4XCollatorNumeric_Off = 1, - ICU4XCollatorNumeric_On = 2, -} ICU4XCollatorNumeric; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorNumeric_destroy(ICU4XCollatorNumeric* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorNumeric.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorNumeric.hpp deleted file mode 100644 index c7def97bb3bc..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorNumeric.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XCollatorNumeric_HPP -#define ICU4XCollatorNumeric_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorNumeric.h" - - - -/** - * - * - * See the [Rust documentation for `Numeric`](https://docs.rs/icu/latest/icu/collator/enum.Numeric.html) for more information. - */ -enum struct ICU4XCollatorNumeric { - Auto = 0, - Off = 1, - On = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorOptionsV1.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorOptionsV1.h deleted file mode 100644 index dc73557efe67..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorOptionsV1.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ICU4XCollatorOptionsV1_H -#define ICU4XCollatorOptionsV1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XCollatorStrength.h" -#include "ICU4XCollatorAlternateHandling.h" -#include "ICU4XCollatorCaseFirst.h" -#include "ICU4XCollatorMaxVariable.h" -#include "ICU4XCollatorCaseLevel.h" -#include "ICU4XCollatorNumeric.h" -#include "ICU4XCollatorBackwardSecondLevel.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCollatorOptionsV1 { - ICU4XCollatorStrength strength; - ICU4XCollatorAlternateHandling alternate_handling; - ICU4XCollatorCaseFirst case_first; - ICU4XCollatorMaxVariable max_variable; - ICU4XCollatorCaseLevel case_level; - ICU4XCollatorNumeric numeric; - ICU4XCollatorBackwardSecondLevel backward_second_level; -} ICU4XCollatorOptionsV1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XCollatorStrength.h" -#include "ICU4XCollatorAlternateHandling.h" -#include "ICU4XCollatorCaseFirst.h" -#include "ICU4XCollatorMaxVariable.h" -#include "ICU4XCollatorCaseLevel.h" -#include "ICU4XCollatorNumeric.h" -#include "ICU4XCollatorBackwardSecondLevel.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorOptionsV1_destroy(ICU4XCollatorOptionsV1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorOptionsV1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorOptionsV1.hpp deleted file mode 100644 index fdffa2c9c1a8..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorOptionsV1.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XCollatorOptionsV1_HPP -#define ICU4XCollatorOptionsV1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorOptionsV1.h" - -#include "ICU4XCollatorStrength.hpp" -#include "ICU4XCollatorAlternateHandling.hpp" -#include "ICU4XCollatorCaseFirst.hpp" -#include "ICU4XCollatorMaxVariable.hpp" -#include "ICU4XCollatorCaseLevel.hpp" -#include "ICU4XCollatorNumeric.hpp" -#include "ICU4XCollatorBackwardSecondLevel.hpp" - - -/** - * - * - * See the [Rust documentation for `CollatorOptions`](https://docs.rs/icu/latest/icu/collator/struct.CollatorOptions.html) for more information. - */ -struct ICU4XCollatorOptionsV1 { - public: - ICU4XCollatorStrength strength; - ICU4XCollatorAlternateHandling alternate_handling; - ICU4XCollatorCaseFirst case_first; - ICU4XCollatorMaxVariable max_variable; - ICU4XCollatorCaseLevel case_level; - ICU4XCollatorNumeric numeric; - ICU4XCollatorBackwardSecondLevel backward_second_level; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorStrength.h b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorStrength.h deleted file mode 100644 index f230214febad..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorStrength.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XCollatorStrength_H -#define ICU4XCollatorStrength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XCollatorStrength { - ICU4XCollatorStrength_Auto = 0, - ICU4XCollatorStrength_Primary = 1, - ICU4XCollatorStrength_Secondary = 2, - ICU4XCollatorStrength_Tertiary = 3, - ICU4XCollatorStrength_Quaternary = 4, - ICU4XCollatorStrength_Identical = 5, -} ICU4XCollatorStrength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XCollatorStrength_destroy(ICU4XCollatorStrength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorStrength.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCollatorStrength.hpp deleted file mode 100644 index dd9ace1ae8a8..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCollatorStrength.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XCollatorStrength_HPP -#define ICU4XCollatorStrength_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCollatorStrength.h" - - - -/** - * - * - * See the [Rust documentation for `Strength`](https://docs.rs/icu/latest/icu/collator/enum.Strength.html) for more information. - */ -enum struct ICU4XCollatorStrength { - Auto = 0, - Primary = 1, - Secondary = 2, - Tertiary = 3, - Quaternary = 4, - Identical = 5, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XComposingNormalizer.h b/third_party/rust/icu_capi/cpp/include/ICU4XComposingNormalizer.h deleted file mode 100644 index 1798af0d8e3e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XComposingNormalizer.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XComposingNormalizer_H -#define ICU4XComposingNormalizer_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XComposingNormalizer ICU4XComposingNormalizer; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XComposingNormalizer_ICU4XError ICU4XComposingNormalizer_create_nfc(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XComposingNormalizer_ICU4XError ICU4XComposingNormalizer_create_nfkc(const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XComposingNormalizer_normalize(const ICU4XComposingNormalizer* self, const char* s_data, size_t s_len, DiplomatWriteable* write); - -bool ICU4XComposingNormalizer_is_normalized(const ICU4XComposingNormalizer* self, const char* s_data, size_t s_len); -void ICU4XComposingNormalizer_destroy(ICU4XComposingNormalizer* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XComposingNormalizer.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XComposingNormalizer.hpp deleted file mode 100644 index 7089a7d1f317..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XComposingNormalizer.hpp +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef ICU4XComposingNormalizer_HPP -#define ICU4XComposingNormalizer_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XComposingNormalizer.h" - -class ICU4XDataProvider; -class ICU4XComposingNormalizer; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XComposingNormalizer with std::unique_ptr. - */ -struct ICU4XComposingNormalizerDeleter { - void operator()(capi::ICU4XComposingNormalizer* l) const noexcept { - capi::ICU4XComposingNormalizer_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `ComposingNormalizer`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html) for more information. - */ -class ICU4XComposingNormalizer { - public: - - /** - * Construct a new ICU4XComposingNormalizer instance for NFC - * - * See the [Rust documentation for `try_new_nfc_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.try_new_nfc_unstable) for more information. - */ - static diplomat::result create_nfc(const ICU4XDataProvider& provider); - - /** - * Construct a new ICU4XComposingNormalizer instance for NFKC - * - * See the [Rust documentation for `try_new_nfkc_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.try_new_nfkc_unstable) for more information. - */ - static diplomat::result create_nfkc(const ICU4XDataProvider& provider); - - /** - * Normalize a (potentially ill-formed) UTF8 string - * - * Errors are mapped to REPLACEMENT CHARACTER - * - * See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.normalize_utf8) for more information. - */ - template diplomat::result normalize_to_writeable(const std::string_view s, W& write) const; - - /** - * Normalize a (potentially ill-formed) UTF8 string - * - * Errors are mapped to REPLACEMENT CHARACTER - * - * See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.normalize_utf8) for more information. - */ - diplomat::result normalize(const std::string_view s) const; - - /** - * Check if a (potentially ill-formed) UTF8 string is normalized - * - * Errors are mapped to REPLACEMENT CHARACTER - * - * See the [Rust documentation for `is_normalized_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.is_normalized_utf8) for more information. - */ - bool is_normalized(const std::string_view s) const; - inline const capi::ICU4XComposingNormalizer* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XComposingNormalizer* AsFFIMut() { return this->inner.get(); } - inline ICU4XComposingNormalizer(capi::ICU4XComposingNormalizer* i) : inner(i) {} - ICU4XComposingNormalizer() = default; - ICU4XComposingNormalizer(ICU4XComposingNormalizer&&) noexcept = default; - ICU4XComposingNormalizer& operator=(ICU4XComposingNormalizer&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline diplomat::result ICU4XComposingNormalizer::create_nfc(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XComposingNormalizer_create_nfc(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XComposingNormalizer(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XComposingNormalizer::create_nfkc(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XComposingNormalizer_create_nfkc(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XComposingNormalizer(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XComposingNormalizer::normalize_to_writeable(const std::string_view s, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XComposingNormalizer_normalize(this->inner.get(), s.data(), s.size(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XComposingNormalizer::normalize(const std::string_view s) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XComposingNormalizer_normalize(this->inner.get(), s.data(), s.size(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline bool ICU4XComposingNormalizer::is_normalized(const std::string_view s) const { - return capi::ICU4XComposingNormalizer_is_normalized(this->inner.get(), s.data(), s.size()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCustomTimeZone.h b/third_party/rust/icu_capi/cpp/include/ICU4XCustomTimeZone.h deleted file mode 100644 index fe6181a1049b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCustomTimeZone.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef ICU4XCustomTimeZone_H -#define ICU4XCustomTimeZone_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XCustomTimeZone ICU4XCustomTimeZone; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#include "diplomat_result_int32_t_ICU4XError.h" -#include "diplomat_result_bool_ICU4XError.h" -#include "ICU4XMetazoneCalculator.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XCustomTimeZone_ICU4XError ICU4XCustomTimeZone_create_from_string(const char* s_data, size_t s_len); - -ICU4XCustomTimeZone* ICU4XCustomTimeZone_create_empty(); - -ICU4XCustomTimeZone* ICU4XCustomTimeZone_create_utc(); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_gmt_offset_seconds(ICU4XCustomTimeZone* self, int32_t offset_seconds); - -void ICU4XCustomTimeZone_clear_gmt_offset(ICU4XCustomTimeZone* self); - -diplomat_result_int32_t_ICU4XError ICU4XCustomTimeZone_gmt_offset_seconds(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_gmt_offset_positive(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_gmt_offset_zero(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_gmt_offset_has_minutes(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_gmt_offset_has_seconds(const ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_time_zone_id(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len); - -void ICU4XCustomTimeZone_clear_time_zone_id(ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_time_zone_id(const ICU4XCustomTimeZone* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_metazone_id(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len); - -void ICU4XCustomTimeZone_clear_metazone_id(ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_metazone_id(const ICU4XCustomTimeZone* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_zone_variant(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len); - -void ICU4XCustomTimeZone_clear_zone_variant(ICU4XCustomTimeZone* self); - -diplomat_result_void_ICU4XError ICU4XCustomTimeZone_zone_variant(const ICU4XCustomTimeZone* self, DiplomatWriteable* write); - -void ICU4XCustomTimeZone_set_standard_time(ICU4XCustomTimeZone* self); - -void ICU4XCustomTimeZone_set_daylight_time(ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_standard_time(const ICU4XCustomTimeZone* self); - -diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_daylight_time(const ICU4XCustomTimeZone* self); - -void ICU4XCustomTimeZone_maybe_calculate_metazone(ICU4XCustomTimeZone* self, const ICU4XMetazoneCalculator* metazone_calculator, const ICU4XIsoDateTime* local_datetime); -void ICU4XCustomTimeZone_destroy(ICU4XCustomTimeZone* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XCustomTimeZone.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XCustomTimeZone.hpp deleted file mode 100644 index fc1ccea36fdc..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XCustomTimeZone.hpp +++ /dev/null @@ -1,527 +0,0 @@ -#ifndef ICU4XCustomTimeZone_HPP -#define ICU4XCustomTimeZone_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XCustomTimeZone.h" - -class ICU4XCustomTimeZone; -#include "ICU4XError.hpp" -class ICU4XMetazoneCalculator; -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XCustomTimeZone with std::unique_ptr. - */ -struct ICU4XCustomTimeZoneDeleter { - void operator()(capi::ICU4XCustomTimeZone* l) const noexcept { - capi::ICU4XCustomTimeZone_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `CustomTimeZone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html) for more information. - */ -class ICU4XCustomTimeZone { - public: - - /** - * 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. - */ - static diplomat::result create_from_string(const std::string_view s); - - /** - * Creates a time zone with no information. - * - * See the [Rust documentation for `new_empty`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.new_empty) for more information. - */ - static ICU4XCustomTimeZone create_empty(); - - /** - * Creates a time zone for UTC. - * - * See the [Rust documentation for `utc`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.utc) for more information. - */ - static ICU4XCustomTimeZone create_utc(); - - /** - * Sets the `gmt_offset` field from offset seconds. - * - * Errors if the offset seconds are out of range. - * - * See the [Rust documentation for `try_from_offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.try_from_offset_seconds) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html) - */ - diplomat::result try_set_gmt_offset_seconds(int32_t offset_seconds); - - /** - * Clears the `gmt_offset` field. - * - * See the [Rust documentation for `offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html) - */ - void clear_gmt_offset(); - - /** - * Returns the value of the `gmt_offset` field as offset seconds. - * - * Errors if the `gmt_offset` field is empty. - * - * See the [Rust documentation for `offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html) - */ - diplomat::result gmt_offset_seconds() const; - - /** - * Returns whether the `gmt_offset` field is positive. - * - * Errors if the `gmt_offset` field is empty. - * - * See the [Rust documentation for `is_positive`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_positive) for more information. - */ - diplomat::result is_gmt_offset_positive() const; - - /** - * Returns whether the `gmt_offset` field is zero. - * - * Errors if the `gmt_offset` field is empty (which is not the same as zero). - * - * See the [Rust documentation for `is_zero`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_zero) for more information. - */ - diplomat::result is_gmt_offset_zero() const; - - /** - * Returns whether the `gmt_offset` field has nonzero minutes. - * - * Errors if the `gmt_offset` field is empty. - * - * See the [Rust documentation for `has_minutes`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_minutes) for more information. - */ - diplomat::result gmt_offset_has_minutes() const; - - /** - * Returns whether the `gmt_offset` field has nonzero seconds. - * - * Errors if the `gmt_offset` field is empty. - * - * See the [Rust documentation for `has_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_seconds) for more information. - */ - diplomat::result gmt_offset_has_seconds() const; - - /** - * Sets the `time_zone_id` field from a string. - * - * 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html) - */ - diplomat::result try_set_time_zone_id(const std::string_view id); - - /** - * Clears the `time_zone_id` field. - * - * 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html) - */ - void clear_time_zone_id(); - - /** - * Writes the value of the `time_zone_id` field as a string. - * - * Errors 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html) - */ - template diplomat::result time_zone_id_to_writeable(W& write) const; - - /** - * Writes the value of the `time_zone_id` field as a string. - * - * Errors 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html) - */ - diplomat::result time_zone_id() const; - - /** - * Sets the `metazone_id` field from a string. - * - * Errors 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) - */ - diplomat::result try_set_metazone_id(const std::string_view id); - - /** - * Clears the `metazone_id` field. - * - * 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 clear_metazone_id(); - - /** - * Writes the value of the `metazone_id` field as a string. - * - * Errors if the `metazone_id` field is empty. - * - * 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) - */ - template diplomat::result metazone_id_to_writeable(W& write) const; - - /** - * Writes the value of the `metazone_id` field as a string. - * - * Errors if the `metazone_id` field is empty. - * - * 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) - */ - diplomat::result metazone_id() const; - - /** - * Sets the `zone_variant` field from a string. - * - * Errors 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) - */ - diplomat::result try_set_zone_variant(const std::string_view id); - - /** - * 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) - */ - void clear_zone_variant(); - - /** - * Writes the value of the `zone_variant` field as a string. - * - * Errors 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) - */ - template diplomat::result zone_variant_to_writeable(W& write) const; - - /** - * Writes the value of the `zone_variant` field as a string. - * - * Errors 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. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html) - */ - diplomat::result zone_variant() const; - - /** - * Sets the `zone_variant` field to standard time. - * - * 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) - */ - void set_standard_time(); - - /** - * Sets the `zone_variant` field to daylight time. - * - * 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) - */ - void set_daylight_time(); - - /** - * Returns whether the `zone_variant` field is standard time. - * - * Errors if the `zone_variant` field is empty. - * - * 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) - */ - diplomat::result is_standard_time() const; - - /** - * Returns whether the `zone_variant` field is daylight time. - * - * Errors if the `zone_variant` field is empty. - * - * 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) - */ - diplomat::result is_daylight_time() const; - - /** - * 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 maybe_calculate_metazone(const ICU4XMetazoneCalculator& metazone_calculator, const ICU4XIsoDateTime& local_datetime); - inline const capi::ICU4XCustomTimeZone* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XCustomTimeZone* AsFFIMut() { return this->inner.get(); } - inline ICU4XCustomTimeZone(capi::ICU4XCustomTimeZone* i) : inner(i) {} - ICU4XCustomTimeZone() = default; - ICU4XCustomTimeZone(ICU4XCustomTimeZone&&) noexcept = default; - ICU4XCustomTimeZone& operator=(ICU4XCustomTimeZone&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XMetazoneCalculator.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XCustomTimeZone::create_from_string(const std::string_view s) { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_create_from_string(s.data(), s.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XCustomTimeZone(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XCustomTimeZone ICU4XCustomTimeZone::create_empty() { - return ICU4XCustomTimeZone(capi::ICU4XCustomTimeZone_create_empty()); -} -inline ICU4XCustomTimeZone ICU4XCustomTimeZone::create_utc() { - return ICU4XCustomTimeZone(capi::ICU4XCustomTimeZone_create_utc()); -} -inline diplomat::result ICU4XCustomTimeZone::try_set_gmt_offset_seconds(int32_t offset_seconds) { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_try_set_gmt_offset_seconds(this->inner.get(), offset_seconds); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline void ICU4XCustomTimeZone::clear_gmt_offset() { - capi::ICU4XCustomTimeZone_clear_gmt_offset(this->inner.get()); -} -inline diplomat::result ICU4XCustomTimeZone::gmt_offset_seconds() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_gmt_offset_seconds(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::is_gmt_offset_positive() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_is_gmt_offset_positive(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::is_gmt_offset_zero() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_is_gmt_offset_zero(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::gmt_offset_has_minutes() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_gmt_offset_has_minutes(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::gmt_offset_has_seconds() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_gmt_offset_has_seconds(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::try_set_time_zone_id(const std::string_view id) { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_try_set_time_zone_id(this->inner.get(), id.data(), id.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline void ICU4XCustomTimeZone::clear_time_zone_id() { - capi::ICU4XCustomTimeZone_clear_time_zone_id(this->inner.get()); -} -template inline diplomat::result ICU4XCustomTimeZone::time_zone_id_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_time_zone_id(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::time_zone_id() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_time_zone_id(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline diplomat::result ICU4XCustomTimeZone::try_set_metazone_id(const std::string_view id) { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_try_set_metazone_id(this->inner.get(), id.data(), id.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline void ICU4XCustomTimeZone::clear_metazone_id() { - capi::ICU4XCustomTimeZone_clear_metazone_id(this->inner.get()); -} -template inline diplomat::result ICU4XCustomTimeZone::metazone_id_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_metazone_id(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::metazone_id() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_metazone_id(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline diplomat::result ICU4XCustomTimeZone::try_set_zone_variant(const std::string_view id) { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_try_set_zone_variant(this->inner.get(), id.data(), id.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline void ICU4XCustomTimeZone::clear_zone_variant() { - capi::ICU4XCustomTimeZone_clear_zone_variant(this->inner.get()); -} -template inline diplomat::result ICU4XCustomTimeZone::zone_variant_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_zone_variant(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::zone_variant() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_zone_variant(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline void ICU4XCustomTimeZone::set_standard_time() { - capi::ICU4XCustomTimeZone_set_standard_time(this->inner.get()); -} -inline void ICU4XCustomTimeZone::set_daylight_time() { - capi::ICU4XCustomTimeZone_set_daylight_time(this->inner.get()); -} -inline diplomat::result ICU4XCustomTimeZone::is_standard_time() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_is_standard_time(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XCustomTimeZone::is_daylight_time() const { - auto diplomat_result_raw_out_value = capi::ICU4XCustomTimeZone_is_daylight_time(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline void ICU4XCustomTimeZone::maybe_calculate_metazone(const ICU4XMetazoneCalculator& metazone_calculator, const ICU4XIsoDateTime& local_datetime) { - capi::ICU4XCustomTimeZone_maybe_calculate_metazone(this->inner.get(), metazone_calculator.AsFFI(), local_datetime.AsFFI()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDataProvider.h b/third_party/rust/icu_capi/cpp/include/ICU4XDataProvider.h deleted file mode 100644 index fd8b35b78778..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDataProvider.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ICU4XDataProvider_H -#define ICU4XDataProvider_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDataProvider ICU4XDataProvider; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XDataProvider_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XLocaleFallbacker.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDataProvider_ICU4XError ICU4XDataProvider_create_fs(const char* path_data, size_t path_len); - -ICU4XDataProvider* ICU4XDataProvider_create_test(); - -diplomat_result_box_ICU4XDataProvider_ICU4XError ICU4XDataProvider_create_from_byte_slice(const uint8_t* blob_data, size_t blob_len); - -ICU4XDataProvider* ICU4XDataProvider_create_empty(); - -diplomat_result_void_ICU4XError ICU4XDataProvider_fork_by_key(ICU4XDataProvider* self, ICU4XDataProvider* other); - -diplomat_result_void_ICU4XError ICU4XDataProvider_fork_by_locale(ICU4XDataProvider* self, ICU4XDataProvider* other); - -diplomat_result_void_ICU4XError ICU4XDataProvider_enable_locale_fallback(ICU4XDataProvider* self); - -diplomat_result_void_ICU4XError ICU4XDataProvider_enable_locale_fallback_with(ICU4XDataProvider* self, const ICU4XLocaleFallbacker* fallbacker); -void ICU4XDataProvider_destroy(ICU4XDataProvider* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDataProvider.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDataProvider.hpp deleted file mode 100644 index 81cb2ea8551a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDataProvider.hpp +++ /dev/null @@ -1,186 +0,0 @@ -#ifndef ICU4XDataProvider_HPP -#define ICU4XDataProvider_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDataProvider.h" - -class ICU4XDataProvider; -#include "ICU4XError.hpp" -class ICU4XLocaleFallbacker; - -/** - * A destruction policy for using ICU4XDataProvider with std::unique_ptr. - */ -struct ICU4XDataProviderDeleter { - void operator()(capi::ICU4XDataProvider* l) const noexcept { - capi::ICU4XDataProvider_destroy(l); - } -}; - -/** - * An ICU4X data provider, capable of loading ICU4X data keys from some source. - * - * See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information. - */ -class ICU4XDataProvider { - public: - - /** - * Constructs an `FsDataProvider` and returns it as an [`ICU4XDataProvider`]. - * Requires the `provider_fs` Cargo feature. - * Not supported in WASM. - * - * See the [Rust documentation for `FsDataProvider`](https://docs.rs/icu_provider_fs/latest/icu_provider_fs/struct.FsDataProvider.html) for more information. - */ - static diplomat::result create_fs(const std::string_view path); - - /** - * Constructs a testdata provider and returns it as an [`ICU4XDataProvider`]. - * Requires the `provider_test` and one of `any_provider` or `buffer_provider` Cargo features. - * - * See the [Rust documentation for `icu_testdata`](https://docs.rs/icu_testdata/latest/icu_testdata/index.html) for more information. - */ - static ICU4XDataProvider create_test(); - - /** - * Constructs a `BlobDataProvider` and returns it as an [`ICU4XDataProvider`]. - * - * See the [Rust documentation for `BlobDataProvider`](https://docs.rs/icu_provider_blob/latest/icu_provider_blob/struct.BlobDataProvider.html) for more information. - * - * Lifetimes: `blob` must live for the duration of the program. - */ - static diplomat::result create_from_byte_slice(const diplomat::span blob); - - /** - * Constructs an empty [`ICU4XDataProvider`]. - * - * See the [Rust documentation for `EmptyDataProvider`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/empty/struct.EmptyDataProvider.html) for more information. - */ - static ICU4XDataProvider create_empty(); - - /** - * Creates a provider that tries the current provider and then, if the current provider - * doesn't support the data key, another provider `other`. - * - * This takes ownership of the `other` provider, leaving an empty provider in its place. - * - * The providers must be the same type (Any or Buffer). This condition is satisfied if - * both providers originate from the same constructor, such as `create_from_byte_slice` - * or `create_fs`. If the condition is not upheld, a runtime error occurs. - * - * See the [Rust documentation for `ForkByKeyProvider`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/type.ForkByKeyProvider.html) for more information. - */ - diplomat::result fork_by_key(ICU4XDataProvider& other); - - /** - * Same as `fork_by_key` but forks by locale instead of key. - * - * See the [Rust documentation for `MissingLocalePredicate`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/predicates/struct.MissingLocalePredicate.html) for more information. - */ - diplomat::result fork_by_locale(ICU4XDataProvider& other); - - /** - * Enables locale fallbacking for data requests made to this provider. - * - * Note that the test provider (from `create_test`) already has fallbacking enabled. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.try_new_unstable) for more information. - * - * Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html) - */ - diplomat::result enable_locale_fallback(); - - /** - * - * - * See the [Rust documentation for `new_with_fallbacker`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new_with_fallbacker) for more information. - * - * Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html) - */ - diplomat::result enable_locale_fallback_with(const ICU4XLocaleFallbacker& fallbacker); - inline const capi::ICU4XDataProvider* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDataProvider* AsFFIMut() { return this->inner.get(); } - inline ICU4XDataProvider(capi::ICU4XDataProvider* i) : inner(i) {} - ICU4XDataProvider() = default; - ICU4XDataProvider(ICU4XDataProvider&&) noexcept = default; - ICU4XDataProvider& operator=(ICU4XDataProvider&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XLocaleFallbacker.hpp" - -inline diplomat::result ICU4XDataProvider::create_fs(const std::string_view path) { - auto diplomat_result_raw_out_value = capi::ICU4XDataProvider_create_fs(path.data(), path.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDataProvider(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XDataProvider ICU4XDataProvider::create_test() { - return ICU4XDataProvider(capi::ICU4XDataProvider_create_test()); -} -inline diplomat::result ICU4XDataProvider::create_from_byte_slice(const diplomat::span blob) { - auto diplomat_result_raw_out_value = capi::ICU4XDataProvider_create_from_byte_slice(blob.data(), blob.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDataProvider(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XDataProvider ICU4XDataProvider::create_empty() { - return ICU4XDataProvider(capi::ICU4XDataProvider_create_empty()); -} -inline diplomat::result ICU4XDataProvider::fork_by_key(ICU4XDataProvider& other) { - auto diplomat_result_raw_out_value = capi::ICU4XDataProvider_fork_by_key(this->inner.get(), other.AsFFIMut()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDataProvider::fork_by_locale(ICU4XDataProvider& other) { - auto diplomat_result_raw_out_value = capi::ICU4XDataProvider_fork_by_locale(this->inner.get(), other.AsFFIMut()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDataProvider::enable_locale_fallback() { - auto diplomat_result_raw_out_value = capi::ICU4XDataProvider_enable_locale_fallback(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDataProvider::enable_locale_fallback_with(const ICU4XLocaleFallbacker& fallbacker) { - auto diplomat_result_raw_out_value = capi::ICU4XDataProvider_enable_locale_fallback_with(this->inner.get(), fallbacker.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDataStruct.h b/third_party/rust/icu_capi/cpp/include/ICU4XDataStruct.h deleted file mode 100644 index a07ff02fb8e4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDataStruct.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XDataStruct_H -#define ICU4XDataStruct_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDataStruct ICU4XDataStruct; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XDataStruct_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDataStruct_ICU4XError ICU4XDataStruct_create_decimal_symbols_v1(const char* plus_sign_prefix_data, size_t plus_sign_prefix_len, const char* plus_sign_suffix_data, size_t plus_sign_suffix_len, const char* minus_sign_prefix_data, size_t minus_sign_prefix_len, const char* minus_sign_suffix_data, size_t minus_sign_suffix_len, const char* decimal_separator_data, size_t decimal_separator_len, const char* grouping_separator_data, size_t grouping_separator_len, uint8_t primary_group_size, uint8_t secondary_group_size, uint8_t min_group_size, const char32_t* digits_data, size_t digits_len); -void ICU4XDataStruct_destroy(ICU4XDataStruct* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDataStruct.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDataStruct.hpp deleted file mode 100644 index cff3bf0373ba..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDataStruct.hpp +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef ICU4XDataStruct_HPP -#define ICU4XDataStruct_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDataStruct.h" - -class ICU4XDataStruct; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XDataStruct with std::unique_ptr. - */ -struct ICU4XDataStructDeleter { - void operator()(capi::ICU4XDataStruct* l) const noexcept { - capi::ICU4XDataStruct_destroy(l); - } -}; - -/** - * A generic data struct to be used by ICU4X - * - * This can be used to construct a StructDataProvider. - */ -class ICU4XDataStruct { - public: - - /** - * Construct a new DecimalSymbolsV1 data struct. - * - * C++ users: All string arguments must be valid UTF8 - * - * See the [Rust documentation for `DecimalSymbolsV1`](https://docs.rs/icu/latest/icu/decimal/provider/struct.DecimalSymbolsV1.html) for more information. - */ - static diplomat::result create_decimal_symbols_v1(const std::string_view plus_sign_prefix, const std::string_view plus_sign_suffix, const std::string_view minus_sign_prefix, const std::string_view minus_sign_suffix, const std::string_view decimal_separator, const std::string_view grouping_separator, uint8_t primary_group_size, uint8_t secondary_group_size, uint8_t min_group_size, const diplomat::span digits); - inline const capi::ICU4XDataStruct* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDataStruct* AsFFIMut() { return this->inner.get(); } - inline ICU4XDataStruct(capi::ICU4XDataStruct* i) : inner(i) {} - ICU4XDataStruct() = default; - ICU4XDataStruct(ICU4XDataStruct&&) noexcept = default; - ICU4XDataStruct& operator=(ICU4XDataStruct&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline diplomat::result ICU4XDataStruct::create_decimal_symbols_v1(const std::string_view plus_sign_prefix, const std::string_view plus_sign_suffix, const std::string_view minus_sign_prefix, const std::string_view minus_sign_suffix, const std::string_view decimal_separator, const std::string_view grouping_separator, uint8_t primary_group_size, uint8_t secondary_group_size, uint8_t min_group_size, const diplomat::span digits) { - auto diplomat_result_raw_out_value = capi::ICU4XDataStruct_create_decimal_symbols_v1(plus_sign_prefix.data(), plus_sign_prefix.size(), plus_sign_suffix.data(), plus_sign_suffix.size(), minus_sign_prefix.data(), minus_sign_prefix.size(), minus_sign_suffix.data(), minus_sign_suffix.size(), decimal_separator.data(), decimal_separator.size(), grouping_separator.data(), grouping_separator.size(), primary_group_size, secondary_group_size, min_group_size, digits.data(), digits.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDataStruct(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDate.h b/third_party/rust/icu_capi/cpp/include/ICU4XDate.h deleted file mode 100644 index e88128678899..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDate.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef ICU4XDate_H -#define ICU4XDate_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDate ICU4XDate; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XCalendar.h" -#include "diplomat_result_box_ICU4XDate_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDate_ICU4XError ICU4XDate_create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, const ICU4XCalendar* calendar); - -diplomat_result_box_ICU4XDate_ICU4XError ICU4XDate_create_from_codes_in_calendar(const char* era_code_data, size_t era_code_len, int32_t year, const char* month_code_data, size_t month_code_len, uint8_t day, const ICU4XCalendar* calendar); - -ICU4XDate* ICU4XDate_to_calendar(const ICU4XDate* self, const ICU4XCalendar* calendar); - -ICU4XIsoDate* ICU4XDate_to_iso(const ICU4XDate* self); - -uint32_t ICU4XDate_day_of_month(const ICU4XDate* self); - -ICU4XIsoWeekday ICU4XDate_day_of_week(const ICU4XDate* self); - -uint32_t ICU4XDate_week_of_month(const ICU4XDate* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XDate_week_of_year(const ICU4XDate* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XDate_ordinal_month(const ICU4XDate* self); - -diplomat_result_void_ICU4XError ICU4XDate_month_code(const ICU4XDate* self, DiplomatWriteable* write); - -int32_t ICU4XDate_year_in_era(const ICU4XDate* self); - -diplomat_result_void_ICU4XError ICU4XDate_era(const ICU4XDate* self, DiplomatWriteable* write); - -uint8_t ICU4XDate_months_in_year(const ICU4XDate* self); - -uint8_t ICU4XDate_days_in_month(const ICU4XDate* self); - -uint32_t ICU4XDate_days_in_year(const ICU4XDate* self); - -ICU4XCalendar* ICU4XDate_calendar(const ICU4XDate* self); -void ICU4XDate_destroy(ICU4XDate* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDate.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDate.hpp deleted file mode 100644 index 440236a53ca3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDate.hpp +++ /dev/null @@ -1,303 +0,0 @@ -#ifndef ICU4XDate_HPP -#define ICU4XDate_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDate.h" - -class ICU4XCalendar; -class ICU4XDate; -#include "ICU4XError.hpp" -class ICU4XIsoDate; -#include "ICU4XIsoWeekday.hpp" -class ICU4XWeekCalculator; -struct ICU4XWeekOf; - -/** - * A destruction policy for using ICU4XDate with std::unique_ptr. - */ -struct ICU4XDateDeleter { - void operator()(capi::ICU4XDate* l) const noexcept { - capi::ICU4XDate_destroy(l); - } -}; - -/** - * An ICU4X Date object capable of containing a date and time for any calendar. - * - * See the [Rust documentation for `Date`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html) for more information. - */ -class ICU4XDate { - public: - - /** - * Creates a new [`ICU4XDate`] representing the ISO date and time - * given but in a given calendar - * - * See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.new_from_iso) for more information. - */ - static diplomat::result create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, const ICU4XCalendar& calendar); - - /** - * Creates a new [`ICU4XDate`] from the given codes, which are interpreted in the given calendar system - * - * See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_from_codes) for more information. - */ - static diplomat::result create_from_codes_in_calendar(const std::string_view era_code, int32_t year, const std::string_view month_code, uint8_t day, const ICU4XCalendar& calendar); - - /** - * Convert this date to one in a different calendar - * - * See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar) for more information. - */ - ICU4XDate to_calendar(const ICU4XCalendar& calendar) const; - - /** - * Converts this date to ISO - * - * See the [Rust documentation for `to_iso`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_iso) for more information. - */ - ICU4XIsoDate to_iso() const; - - /** - * Returns the 1-indexed day in the month for this date - * - * See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. - */ - uint32_t day_of_month() const; - - /** - * Returns the day in the week for this day - * - * See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. - */ - ICU4XIsoWeekday day_of_week() const; - - /** - * Returns the week number in this month, 1-indexed, based on what - * is considered the first day of the week (often a locale preference). - * - * `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - * - * See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information. - */ - uint32_t week_of_month(ICU4XIsoWeekday first_weekday) const; - - /** - * Returns the week number in this year, using week data - * - * See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. - */ - diplomat::result week_of_year(const ICU4XWeekCalculator& calculator) const; - - /** - * Returns 1-indexed number of the month of this date in its year - * - * Note that for lunar calendars this may not lead to the same month - * having the same ordinal month across years; use month_code if you care - * about month identity. - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - uint32_t ordinal_month() const; - - /** - * Returns the month code for this date. Typically something - * like "M01", "M02", but can be more complicated for lunar calendars. - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - template diplomat::result month_code_to_writeable(W& write) const; - - /** - * Returns the month code for this date. Typically something - * like "M01", "M02", but can be more complicated for lunar calendars. - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - diplomat::result month_code() const; - - /** - * Returns the year number in the current era for this date - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. - */ - int32_t year_in_era() const; - - /** - * Returns the era for this date, - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/struct.Date.html#method.year) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/types/struct.Era.html) - */ - template diplomat::result era_to_writeable(W& write) const; - - /** - * Returns the era for this date, - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/struct.Date.html#method.year) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/types/struct.Era.html) - */ - diplomat::result era() const; - - /** - * Returns the number of months in the year represented by this date - * - * See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. - */ - uint8_t months_in_year() const; - - /** - * Returns the number of days in the month represented by this date - * - * See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. - */ - uint8_t days_in_month() const; - - /** - * Returns the number of days in the year represented by this date - * - * See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. - */ - uint32_t days_in_year() const; - - /** - * Returns the [`ICU4XCalendar`] object backing this date - * - * See the [Rust documentation for `calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar) for more information. - */ - ICU4XCalendar calendar() const; - inline const capi::ICU4XDate* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDate* AsFFIMut() { return this->inner.get(); } - inline ICU4XDate(capi::ICU4XDate* i) : inner(i) {} - ICU4XDate() = default; - ICU4XDate(ICU4XDate&&) noexcept = default; - ICU4XDate& operator=(ICU4XDate&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XCalendar.hpp" -#include "ICU4XIsoDate.hpp" -#include "ICU4XWeekCalculator.hpp" -#include "ICU4XWeekOf.hpp" - -inline diplomat::result ICU4XDate::create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, const ICU4XCalendar& calendar) { - auto diplomat_result_raw_out_value = capi::ICU4XDate_create_from_iso_in_calendar(year, month, day, calendar.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDate(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDate::create_from_codes_in_calendar(const std::string_view era_code, int32_t year, const std::string_view month_code, uint8_t day, const ICU4XCalendar& calendar) { - auto diplomat_result_raw_out_value = capi::ICU4XDate_create_from_codes_in_calendar(era_code.data(), era_code.size(), year, month_code.data(), month_code.size(), day, calendar.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDate(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XDate ICU4XDate::to_calendar(const ICU4XCalendar& calendar) const { - return ICU4XDate(capi::ICU4XDate_to_calendar(this->inner.get(), calendar.AsFFI())); -} -inline ICU4XIsoDate ICU4XDate::to_iso() const { - return ICU4XIsoDate(capi::ICU4XDate_to_iso(this->inner.get())); -} -inline uint32_t ICU4XDate::day_of_month() const { - return capi::ICU4XDate_day_of_month(this->inner.get()); -} -inline ICU4XIsoWeekday ICU4XDate::day_of_week() const { - return static_cast(capi::ICU4XDate_day_of_week(this->inner.get())); -} -inline uint32_t ICU4XDate::week_of_month(ICU4XIsoWeekday first_weekday) const { - return capi::ICU4XDate_week_of_month(this->inner.get(), static_cast(first_weekday)); -} -inline diplomat::result ICU4XDate::week_of_year(const ICU4XWeekCalculator& calculator) const { - auto diplomat_result_raw_out_value = capi::ICU4XDate_week_of_year(this->inner.get(), calculator.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - capi::ICU4XWeekOf diplomat_raw_struct_out_value = diplomat_result_raw_out_value.ok; - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWeekOf{ .week = std::move(diplomat_raw_struct_out_value.week), .unit = std::move(static_cast(diplomat_raw_struct_out_value.unit)) })); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint32_t ICU4XDate::ordinal_month() const { - return capi::ICU4XDate_ordinal_month(this->inner.get()); -} -template inline diplomat::result ICU4XDate::month_code_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDate_month_code(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDate::month_code() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDate_month_code(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline int32_t ICU4XDate::year_in_era() const { - return capi::ICU4XDate_year_in_era(this->inner.get()); -} -template inline diplomat::result ICU4XDate::era_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDate_era(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDate::era() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDate_era(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline uint8_t ICU4XDate::months_in_year() const { - return capi::ICU4XDate_months_in_year(this->inner.get()); -} -inline uint8_t ICU4XDate::days_in_month() const { - return capi::ICU4XDate_days_in_month(this->inner.get()); -} -inline uint32_t ICU4XDate::days_in_year() const { - return capi::ICU4XDate_days_in_year(this->inner.get()); -} -inline ICU4XCalendar ICU4XDate::calendar() const { - return ICU4XCalendar(capi::ICU4XDate_calendar(this->inner.get())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XDateFormatter.h deleted file mode 100644 index 8dc5316e4789..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateFormatter.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ICU4XDateFormatter_H -#define ICU4XDateFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDateFormatter ICU4XDateFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "diplomat_result_box_ICU4XDateFormatter_ICU4XError.h" -#include "ICU4XDate.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "ICU4XDateTime.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDateFormatter_ICU4XError ICU4XDateFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_date(const ICU4XDateFormatter* self, const ICU4XDate* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_iso_date(const ICU4XDateFormatter* self, const ICU4XIsoDate* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_datetime(const ICU4XDateFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateFormatter_format_iso_datetime(const ICU4XDateFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XDateFormatter_destroy(ICU4XDateFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDateFormatter.hpp deleted file mode 100644 index e230bf29ab00..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateFormatter.hpp +++ /dev/null @@ -1,231 +0,0 @@ -#ifndef ICU4XDateFormatter_HPP -#define ICU4XDateFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDateFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XDateLength.hpp" -class ICU4XDateFormatter; -#include "ICU4XError.hpp" -class ICU4XDate; -class ICU4XIsoDate; -class ICU4XDateTime; -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XDateFormatter with std::unique_ptr. - */ -struct ICU4XDateFormatterDeleter { - void operator()(capi::ICU4XDateFormatter* l) const noexcept { - capi::ICU4XDateFormatter_destroy(l); - } -}; - -/** - * An ICU4X DateFormatter object capable of formatting a [`ICU4XDate`] as a string, - * using some calendar specified at runtime in the locale. - * - * See the [Rust documentation for `DateFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html) for more information. - */ -class ICU4XDateFormatter { - public: - - /** - * Creates a new [`ICU4XDateFormatter`] from locale data. - * - * See the [Rust documentation for `try_new_with_length_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.try_new_with_length_unstable) for more information. - */ - static diplomat::result create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length); - - /** - * Formats a [`ICU4XDate`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - template diplomat::result format_date_to_writeable(const ICU4XDate& value, W& write) const; - - /** - * Formats a [`ICU4XDate`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - diplomat::result format_date(const ICU4XDate& value) const; - - /** - * Formats a [`ICU4XIsoDate`] to a string. - * - * Will convert to this formatter's calendar first - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_date_to_writeable(const ICU4XIsoDate& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDate`] to a string. - * - * Will convert to this formatter's calendar first - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_date(const ICU4XIsoDate& value) const; - - /** - * Formats a [`ICU4XDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - template diplomat::result format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - diplomat::result format_datetime(const ICU4XDateTime& value) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * Will convert to this formatter's calendar first - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * Will convert to this formatter's calendar first - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime(const ICU4XIsoDateTime& value) const; - inline const capi::ICU4XDateFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDateFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XDateFormatter(capi::ICU4XDateFormatter* i) : inner(i) {} - ICU4XDateFormatter() = default; - ICU4XDateFormatter(ICU4XDateFormatter&&) noexcept = default; - ICU4XDateFormatter& operator=(ICU4XDateFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XDate.hpp" -#include "ICU4XIsoDate.hpp" -#include "ICU4XDateTime.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XDateFormatter::create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length) { - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_create_with_length(provider.AsFFI(), locale.AsFFI(), static_cast(date_length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDateFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XDateFormatter::format_date_to_writeable(const ICU4XDate& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_date(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateFormatter::format_date(const ICU4XDate& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_date(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XDateFormatter::format_iso_date_to_writeable(const ICU4XIsoDate& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_iso_date(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateFormatter::format_iso_date(const ICU4XIsoDate& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_iso_date(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XDateFormatter::format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateFormatter::format_datetime(const ICU4XDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XDateFormatter::format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateFormatter::format_iso_datetime(const ICU4XIsoDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateLength.h b/third_party/rust/icu_capi/cpp/include/ICU4XDateLength.h deleted file mode 100644 index b2ca91823365..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateLength.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XDateLength_H -#define ICU4XDateLength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XDateLength { - ICU4XDateLength_Full = 0, - ICU4XDateLength_Long = 1, - ICU4XDateLength_Medium = 2, - ICU4XDateLength_Short = 3, -} ICU4XDateLength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDateLength_destroy(ICU4XDateLength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateLength.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDateLength.hpp deleted file mode 100644 index 0e6a33326e46..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateLength.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ICU4XDateLength_HPP -#define ICU4XDateLength_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDateLength.h" - - - -/** - * - * - * See the [Rust documentation for `Date`](https://docs.rs/icu/latest/icu/datetime/options/length/enum.Date.html) for more information. - */ -enum struct ICU4XDateLength { - Full = 0, - Long = 1, - Medium = 2, - Short = 3, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateTime.h b/third_party/rust/icu_capi/cpp/include/ICU4XDateTime.h deleted file mode 100644 index a9dc1cee7160..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateTime.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef ICU4XDateTime_H -#define ICU4XDateTime_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDateTime ICU4XDateTime; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XCalendar.h" -#include "diplomat_result_box_ICU4XDateTime_ICU4XError.h" -#include "ICU4XDate.h" -#include "ICU4XTime.h" -#include "ICU4XIsoDateTime.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDateTime_ICU4XError ICU4XDateTime_create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar* calendar); - -diplomat_result_box_ICU4XDateTime_ICU4XError ICU4XDateTime_create_from_codes_in_calendar(const char* era_code_data, size_t era_code_len, int32_t year, const char* month_code_data, size_t month_code_len, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar* calendar); - -ICU4XDateTime* ICU4XDateTime_create_from_date_and_time(const ICU4XDate* date, const ICU4XTime* time); - -ICU4XDate* ICU4XDateTime_date(const ICU4XDateTime* self); - -ICU4XTime* ICU4XDateTime_time(const ICU4XDateTime* self); - -ICU4XIsoDateTime* ICU4XDateTime_to_iso(const ICU4XDateTime* self); - -ICU4XDateTime* ICU4XDateTime_to_calendar(const ICU4XDateTime* self, const ICU4XCalendar* calendar); - -uint8_t ICU4XDateTime_hour(const ICU4XDateTime* self); - -uint8_t ICU4XDateTime_minute(const ICU4XDateTime* self); - -uint8_t ICU4XDateTime_second(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_nanosecond(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_day_of_month(const ICU4XDateTime* self); - -ICU4XIsoWeekday ICU4XDateTime_day_of_week(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_week_of_month(const ICU4XDateTime* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XDateTime_week_of_year(const ICU4XDateTime* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XDateTime_ordinal_month(const ICU4XDateTime* self); - -diplomat_result_void_ICU4XError ICU4XDateTime_month_code(const ICU4XDateTime* self, DiplomatWriteable* write); - -int32_t ICU4XDateTime_year_in_era(const ICU4XDateTime* self); - -diplomat_result_void_ICU4XError ICU4XDateTime_era(const ICU4XDateTime* self, DiplomatWriteable* write); - -uint8_t ICU4XDateTime_months_in_year(const ICU4XDateTime* self); - -uint8_t ICU4XDateTime_days_in_month(const ICU4XDateTime* self); - -uint32_t ICU4XDateTime_days_in_year(const ICU4XDateTime* self); - -ICU4XCalendar* ICU4XDateTime_calendar(const ICU4XDateTime* self); -void ICU4XDateTime_destroy(ICU4XDateTime* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateTime.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDateTime.hpp deleted file mode 100644 index 5f26e0f4e604..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateTime.hpp +++ /dev/null @@ -1,373 +0,0 @@ -#ifndef ICU4XDateTime_HPP -#define ICU4XDateTime_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDateTime.h" - -class ICU4XCalendar; -class ICU4XDateTime; -#include "ICU4XError.hpp" -class ICU4XDate; -class ICU4XTime; -class ICU4XIsoDateTime; -#include "ICU4XIsoWeekday.hpp" -class ICU4XWeekCalculator; -struct ICU4XWeekOf; - -/** - * A destruction policy for using ICU4XDateTime with std::unique_ptr. - */ -struct ICU4XDateTimeDeleter { - void operator()(capi::ICU4XDateTime* l) const noexcept { - capi::ICU4XDateTime_destroy(l); - } -}; - -/** - * An ICU4X DateTime object capable of containing a date and time for any calendar. - * - * See the [Rust documentation for `DateTime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html) for more information. - */ -class ICU4XDateTime { - public: - - /** - * Creates a new [`ICU4XDateTime`] representing the ISO date and time - * given but in a given calendar - * - * See the [Rust documentation for `new_from_iso`](https://docs.rs/icu/latest/icu/struct.DateTime.html#method.new_from_iso) for more information. - */ - static diplomat::result create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar& calendar); - - /** - * Creates a new [`ICU4XDateTime`] from the given codes, which are interpreted in the given calendar system - * - * See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_from_codes) for more information. - */ - static diplomat::result create_from_codes_in_calendar(const std::string_view era_code, int32_t year, const std::string_view month_code, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar& calendar); - - /** - * Creates a new [`ICU4XDateTime`] from an [`ICU4XDate`] and [`ICU4XTime`] object - * - * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information. - */ - static ICU4XDateTime create_from_date_and_time(const ICU4XDate& date, const ICU4XTime& time); - - /** - * Gets a copy of the date contained in this object - * - * See the [Rust documentation for `date`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date) for more information. - */ - ICU4XDate date() const; - - /** - * Gets the time contained in this object - * - * See the [Rust documentation for `time`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time) for more information. - */ - ICU4XTime time() const; - - /** - * Converts this date to ISO - * - * See the [Rust documentation for `to_iso`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_iso) for more information. - */ - ICU4XIsoDateTime to_iso() const; - - /** - * Convert this datetime to one in a different calendar - * - * See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar) for more information. - */ - ICU4XDateTime to_calendar(const ICU4XCalendar& calendar) const; - - /** - * Returns the hour in this time - * - * See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour) for more information. - */ - uint8_t hour() const; - - /** - * Returns the minute in this time - * - * See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute) for more information. - */ - uint8_t minute() const; - - /** - * Returns the second in this time - * - * See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second) for more information. - */ - uint8_t second() const; - - /** - * Returns the nanosecond in this time - * - * See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond) for more information. - */ - uint32_t nanosecond() const; - - /** - * Returns the 1-indexed day in the month for this date - * - * See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. - */ - uint32_t day_of_month() const; - - /** - * Returns the day in the week for this day - * - * See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. - */ - ICU4XIsoWeekday day_of_week() const; - - /** - * Returns the week number in this month, 1-indexed, based on what - * is considered the first day of the week (often a locale preference). - * - * `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - * - * See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information. - */ - uint32_t week_of_month(ICU4XIsoWeekday first_weekday) const; - - /** - * Returns the week number in this year, using week data - * - * See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. - */ - diplomat::result week_of_year(const ICU4XWeekCalculator& calculator) const; - - /** - * Returns 1-indexed number of the month of this date in its year - * - * Note that for lunar calendars this may not lead to the same month - * having the same ordinal month across years; use month_code if you care - * about month identity. - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - uint32_t ordinal_month() const; - - /** - * Returns the month code for this date. Typically something - * like "M01", "M02", but can be more complicated for lunar calendars. - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - template diplomat::result month_code_to_writeable(W& write) const; - - /** - * Returns the month code for this date. Typically something - * like "M01", "M02", but can be more complicated for lunar calendars. - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - diplomat::result month_code() const; - - /** - * Returns the year number in the current era for this date - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. - */ - int32_t year_in_era() const; - - /** - * Returns the era for this date, - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. - */ - template diplomat::result era_to_writeable(W& write) const; - - /** - * Returns the era for this date, - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. - */ - diplomat::result era() const; - - /** - * Returns the number of months in the year represented by this date - * - * See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. - */ - uint8_t months_in_year() const; - - /** - * Returns the number of days in the month represented by this date - * - * See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. - */ - uint8_t days_in_month() const; - - /** - * Returns the number of days in the year represented by this date - * - * See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. - */ - uint32_t days_in_year() const; - - /** - * Returns the [`ICU4XCalendar`] object backing this date - * - * See the [Rust documentation for `calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar) for more information. - */ - ICU4XCalendar calendar() const; - inline const capi::ICU4XDateTime* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDateTime* AsFFIMut() { return this->inner.get(); } - inline ICU4XDateTime(capi::ICU4XDateTime* i) : inner(i) {} - ICU4XDateTime() = default; - ICU4XDateTime(ICU4XDateTime&&) noexcept = default; - ICU4XDateTime& operator=(ICU4XDateTime&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XCalendar.hpp" -#include "ICU4XDate.hpp" -#include "ICU4XTime.hpp" -#include "ICU4XIsoDateTime.hpp" -#include "ICU4XWeekCalculator.hpp" -#include "ICU4XWeekOf.hpp" - -inline diplomat::result ICU4XDateTime::create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar& calendar) { - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_create_from_iso_in_calendar(year, month, day, hour, minute, second, nanosecond, calendar.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDateTime(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateTime::create_from_codes_in_calendar(const std::string_view era_code, int32_t year, const std::string_view month_code, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar& calendar) { - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_create_from_codes_in_calendar(era_code.data(), era_code.size(), year, month_code.data(), month_code.size(), day, hour, minute, second, nanosecond, calendar.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDateTime(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XDateTime ICU4XDateTime::create_from_date_and_time(const ICU4XDate& date, const ICU4XTime& time) { - return ICU4XDateTime(capi::ICU4XDateTime_create_from_date_and_time(date.AsFFI(), time.AsFFI())); -} -inline ICU4XDate ICU4XDateTime::date() const { - return ICU4XDate(capi::ICU4XDateTime_date(this->inner.get())); -} -inline ICU4XTime ICU4XDateTime::time() const { - return ICU4XTime(capi::ICU4XDateTime_time(this->inner.get())); -} -inline ICU4XIsoDateTime ICU4XDateTime::to_iso() const { - return ICU4XIsoDateTime(capi::ICU4XDateTime_to_iso(this->inner.get())); -} -inline ICU4XDateTime ICU4XDateTime::to_calendar(const ICU4XCalendar& calendar) const { - return ICU4XDateTime(capi::ICU4XDateTime_to_calendar(this->inner.get(), calendar.AsFFI())); -} -inline uint8_t ICU4XDateTime::hour() const { - return capi::ICU4XDateTime_hour(this->inner.get()); -} -inline uint8_t ICU4XDateTime::minute() const { - return capi::ICU4XDateTime_minute(this->inner.get()); -} -inline uint8_t ICU4XDateTime::second() const { - return capi::ICU4XDateTime_second(this->inner.get()); -} -inline uint32_t ICU4XDateTime::nanosecond() const { - return capi::ICU4XDateTime_nanosecond(this->inner.get()); -} -inline uint32_t ICU4XDateTime::day_of_month() const { - return capi::ICU4XDateTime_day_of_month(this->inner.get()); -} -inline ICU4XIsoWeekday ICU4XDateTime::day_of_week() const { - return static_cast(capi::ICU4XDateTime_day_of_week(this->inner.get())); -} -inline uint32_t ICU4XDateTime::week_of_month(ICU4XIsoWeekday first_weekday) const { - return capi::ICU4XDateTime_week_of_month(this->inner.get(), static_cast(first_weekday)); -} -inline diplomat::result ICU4XDateTime::week_of_year(const ICU4XWeekCalculator& calculator) const { - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_week_of_year(this->inner.get(), calculator.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - capi::ICU4XWeekOf diplomat_raw_struct_out_value = diplomat_result_raw_out_value.ok; - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWeekOf{ .week = std::move(diplomat_raw_struct_out_value.week), .unit = std::move(static_cast(diplomat_raw_struct_out_value.unit)) })); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint32_t ICU4XDateTime::ordinal_month() const { - return capi::ICU4XDateTime_ordinal_month(this->inner.get()); -} -template inline diplomat::result ICU4XDateTime::month_code_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_month_code(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateTime::month_code() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_month_code(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline int32_t ICU4XDateTime::year_in_era() const { - return capi::ICU4XDateTime_year_in_era(this->inner.get()); -} -template inline diplomat::result ICU4XDateTime::era_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_era(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateTime::era() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateTime_era(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline uint8_t ICU4XDateTime::months_in_year() const { - return capi::ICU4XDateTime_months_in_year(this->inner.get()); -} -inline uint8_t ICU4XDateTime::days_in_month() const { - return capi::ICU4XDateTime_days_in_month(this->inner.get()); -} -inline uint32_t ICU4XDateTime::days_in_year() const { - return capi::ICU4XDateTime_days_in_year(this->inner.get()); -} -inline ICU4XCalendar ICU4XDateTime::calendar() const { - return ICU4XCalendar(capi::ICU4XDateTime_calendar(this->inner.get())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateTimeFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XDateTimeFormatter.h deleted file mode 100644 index 5f0af4ddba1e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateTimeFormatter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XDateTimeFormatter_H -#define ICU4XDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDateTimeFormatter ICU4XDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h" -#include "ICU4XDateTime.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError ICU4XDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_void_ICU4XError ICU4XDateTimeFormatter_format_datetime(const ICU4XDateTimeFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XDateTimeFormatter_format_iso_datetime(const ICU4XDateTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XDateTimeFormatter_destroy(ICU4XDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDateTimeFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDateTimeFormatter.hpp deleted file mode 100644 index 93224309ff15..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDateTimeFormatter.hpp +++ /dev/null @@ -1,150 +0,0 @@ -#ifndef ICU4XDateTimeFormatter_HPP -#define ICU4XDateTimeFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDateTimeFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XDateLength.hpp" -#include "ICU4XTimeLength.hpp" -class ICU4XDateTimeFormatter; -#include "ICU4XError.hpp" -class ICU4XDateTime; -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XDateTimeFormatter with std::unique_ptr. - */ -struct ICU4XDateTimeFormatterDeleter { - void operator()(capi::ICU4XDateTimeFormatter* l) const noexcept { - capi::ICU4XDateTimeFormatter_destroy(l); - } -}; - -/** - * An ICU4X DateFormatter object capable of formatting a [`ICU4XDateTime`] as a string, - * using some calendar specified at runtime in the locale. - * - * See the [Rust documentation for `DateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html) for more information. - */ -class ICU4XDateTimeFormatter { - public: - - /** - * Creates a new [`ICU4XDateTimeFormatter`] from locale data. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - - /** - * Formats a [`ICU4XDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information. - */ - diplomat::result format_datetime(const ICU4XDateTime& value) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * Will convert to this formatter's calendar first - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * Will convert to this formatter's calendar first - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime(const ICU4XIsoDateTime& value) const; - inline const capi::ICU4XDateTimeFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDateTimeFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XDateTimeFormatter(capi::ICU4XDateTimeFormatter* i) : inner(i) {} - ICU4XDateTimeFormatter() = default; - ICU4XDateTimeFormatter(ICU4XDateTimeFormatter&&) noexcept = default; - ICU4XDateTimeFormatter& operator=(ICU4XDateTimeFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XDateTime.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XDateTimeFormatter::create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length) { - auto diplomat_result_raw_out_value = capi::ICU4XDateTimeFormatter_create_with_lengths(provider.AsFFI(), locale.AsFFI(), static_cast(date_length), static_cast(time_length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDateTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XDateTimeFormatter::format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateTimeFormatter_format_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateTimeFormatter::format_datetime(const ICU4XDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateTimeFormatter_format_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XDateTimeFormatter::format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDateTimeFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDateTimeFormatter::format_iso_datetime(const ICU4XIsoDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDateTimeFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposed.h b/third_party/rust/icu_capi/cpp/include/ICU4XDecomposed.h deleted file mode 100644 index 3f287e8192a9..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposed.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XDecomposed_H -#define ICU4XDecomposed_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDecomposed { - char32_t first; - char32_t second; -} ICU4XDecomposed; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDecomposed_destroy(ICU4XDecomposed* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposed.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDecomposed.hpp deleted file mode 100644 index 5628ae2be9f7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposed.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XDecomposed_HPP -#define ICU4XDecomposed_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDecomposed.h" - - - -/** - * The outcome of non-recursive canonical decomposition of a character. - * `second` will be NUL when the decomposition expands to a single character - * (which may or may not be the original one) - * - * See the [Rust documentation for `Decomposed`](https://docs.rs/icu/latest/icu/normalizer/properties/enum.Decomposed.html) for more information. - */ -struct ICU4XDecomposed { - public: - char32_t first; - char32_t second; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposingNormalizer.h b/third_party/rust/icu_capi/cpp/include/ICU4XDecomposingNormalizer.h deleted file mode 100644 index f542f7a7302e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposingNormalizer.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XDecomposingNormalizer_H -#define ICU4XDecomposingNormalizer_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDecomposingNormalizer ICU4XDecomposingNormalizer; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError ICU4XDecomposingNormalizer_create_nfd(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError ICU4XDecomposingNormalizer_create_nfkd(const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XDecomposingNormalizer_normalize(const ICU4XDecomposingNormalizer* self, const char* s_data, size_t s_len, DiplomatWriteable* write); - -bool ICU4XDecomposingNormalizer_is_normalized(const ICU4XDecomposingNormalizer* self, const char* s_data, size_t s_len); -void ICU4XDecomposingNormalizer_destroy(ICU4XDecomposingNormalizer* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposingNormalizer.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDecomposingNormalizer.hpp deleted file mode 100644 index 59bdf422b7a1..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDecomposingNormalizer.hpp +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef ICU4XDecomposingNormalizer_HPP -#define ICU4XDecomposingNormalizer_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDecomposingNormalizer.h" - -class ICU4XDataProvider; -class ICU4XDecomposingNormalizer; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XDecomposingNormalizer with std::unique_ptr. - */ -struct ICU4XDecomposingNormalizerDeleter { - void operator()(capi::ICU4XDecomposingNormalizer* l) const noexcept { - capi::ICU4XDecomposingNormalizer_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `DecomposingNormalizer`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html) for more information. - */ -class ICU4XDecomposingNormalizer { - public: - - /** - * Construct a new ICU4XDecomposingNormalizer instance for NFC - * - * See the [Rust documentation for `try_new_nfd_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.try_new_nfd_unstable) for more information. - */ - static diplomat::result create_nfd(const ICU4XDataProvider& provider); - - /** - * Construct a new ICU4XDecomposingNormalizer instance for NFKC - * - * See the [Rust documentation for `try_new_nfkd_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.try_new_nfkd_unstable) for more information. - */ - static diplomat::result create_nfkd(const ICU4XDataProvider& provider); - - /** - * Normalize a (potentially ill-formed) UTF8 string - * - * Errors are mapped to REPLACEMENT CHARACTER - * - * See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.normalize_utf8) for more information. - */ - template diplomat::result normalize_to_writeable(const std::string_view s, W& write) const; - - /** - * Normalize a (potentially ill-formed) UTF8 string - * - * Errors are mapped to REPLACEMENT CHARACTER - * - * See the [Rust documentation for `normalize_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.normalize_utf8) for more information. - */ - diplomat::result normalize(const std::string_view s) const; - - /** - * Check if a (potentially ill-formed) UTF8 string is normalized - * - * Errors are mapped to REPLACEMENT CHARACTER - * - * See the [Rust documentation for `is_normalized_utf8`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.is_normalized_utf8) for more information. - */ - bool is_normalized(const std::string_view s) const; - inline const capi::ICU4XDecomposingNormalizer* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XDecomposingNormalizer* AsFFIMut() { return this->inner.get(); } - inline ICU4XDecomposingNormalizer(capi::ICU4XDecomposingNormalizer* i) : inner(i) {} - ICU4XDecomposingNormalizer() = default; - ICU4XDecomposingNormalizer(ICU4XDecomposingNormalizer&&) noexcept = default; - ICU4XDecomposingNormalizer& operator=(ICU4XDecomposingNormalizer&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline diplomat::result ICU4XDecomposingNormalizer::create_nfd(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XDecomposingNormalizer_create_nfd(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDecomposingNormalizer(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDecomposingNormalizer::create_nfkd(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XDecomposingNormalizer_create_nfkd(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XDecomposingNormalizer(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XDecomposingNormalizer::normalize_to_writeable(const std::string_view s, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XDecomposingNormalizer_normalize(this->inner.get(), s.data(), s.size(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XDecomposingNormalizer::normalize(const std::string_view s) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XDecomposingNormalizer_normalize(this->inner.get(), s.data(), s.size(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline bool ICU4XDecomposingNormalizer::is_normalized(const std::string_view s) const { - return capi::ICU4XDecomposingNormalizer_is_normalized(this->inner.get(), s.data(), s.size()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesFallback.h b/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesFallback.h deleted file mode 100644 index 085fc8de5dde..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesFallback.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XDisplayNamesFallback_H -#define ICU4XDisplayNamesFallback_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XDisplayNamesFallback { - ICU4XDisplayNamesFallback_Code = 0, - ICU4XDisplayNamesFallback_None = 1, -} ICU4XDisplayNamesFallback; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDisplayNamesFallback_destroy(ICU4XDisplayNamesFallback* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesFallback.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesFallback.hpp deleted file mode 100644 index f328622befbd..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesFallback.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ICU4XDisplayNamesFallback_HPP -#define ICU4XDisplayNamesFallback_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDisplayNamesFallback.h" - - - -/** - * - * - * See the [Rust documentation for `Fallback`](https://docs.rs/icu/latest/icu/displaynames/options/enum.Fallback.html) for more information. - */ -enum struct ICU4XDisplayNamesFallback { - Code = 0, - None = 1, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesOptionsV1.h b/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesOptionsV1.h deleted file mode 100644 index e998cde0e779..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesOptionsV1.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XDisplayNamesOptionsV1_H -#define ICU4XDisplayNamesOptionsV1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XDisplayNamesStyle.h" -#include "ICU4XDisplayNamesFallback.h" -#include "ICU4XLanguageDisplay.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XDisplayNamesOptionsV1 { - ICU4XDisplayNamesStyle style; - ICU4XDisplayNamesFallback fallback; - ICU4XLanguageDisplay language_display; -} ICU4XDisplayNamesOptionsV1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDisplayNamesStyle.h" -#include "ICU4XDisplayNamesFallback.h" -#include "ICU4XLanguageDisplay.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDisplayNamesOptionsV1_destroy(ICU4XDisplayNamesOptionsV1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesOptionsV1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesOptionsV1.hpp deleted file mode 100644 index 9a49f2eef1fe..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesOptionsV1.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ICU4XDisplayNamesOptionsV1_HPP -#define ICU4XDisplayNamesOptionsV1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDisplayNamesOptionsV1.h" - -#include "ICU4XDisplayNamesStyle.hpp" -#include "ICU4XDisplayNamesFallback.hpp" -#include "ICU4XLanguageDisplay.hpp" - - -/** - * - * - * See the [Rust documentation for `DisplayNamesOptions`](https://docs.rs/icu/latest/icu/displaynames/options/struct.DisplayNamesOptions.html) for more information. - */ -struct ICU4XDisplayNamesOptionsV1 { - public: - - /** - * The optional formatting style to use for display name. - */ - ICU4XDisplayNamesStyle style; - - /** - * The fallback return when the system does not have the - * requested display name, defaults to "code". - */ - ICU4XDisplayNamesFallback fallback; - - /** - * The language display kind, defaults to "dialect". - */ - ICU4XLanguageDisplay language_display; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesStyle.h b/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesStyle.h deleted file mode 100644 index 048da455daf4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesStyle.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XDisplayNamesStyle_H -#define ICU4XDisplayNamesStyle_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XDisplayNamesStyle { - ICU4XDisplayNamesStyle_Auto = 0, - ICU4XDisplayNamesStyle_Narrow = 1, - ICU4XDisplayNamesStyle_Short = 2, - ICU4XDisplayNamesStyle_Long = 3, - ICU4XDisplayNamesStyle_Menu = 4, -} ICU4XDisplayNamesStyle; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XDisplayNamesStyle_destroy(ICU4XDisplayNamesStyle* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesStyle.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesStyle.hpp deleted file mode 100644 index 8cc64081bdf5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XDisplayNamesStyle.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XDisplayNamesStyle_HPP -#define ICU4XDisplayNamesStyle_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XDisplayNamesStyle.h" - - - -/** - * - * - * See the [Rust documentation for `Style`](https://docs.rs/icu/latest/icu/displaynames/options/enum.Style.html) for more information. - */ -enum struct ICU4XDisplayNamesStyle { - Auto = 0, - Narrow = 1, - Short = 2, - Long = 3, - Menu = 4, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XError.h b/third_party/rust/icu_capi/cpp/include/ICU4XError.h deleted file mode 100644 index 65e1c04a25c2..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XError.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef ICU4XError_H -#define ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XError { - ICU4XError_UnknownError = 0, - ICU4XError_WriteableError = 1, - ICU4XError_OutOfBoundsError = 2, - ICU4XError_DataMissingDataKeyError = 256, - ICU4XError_DataMissingVariantError = 257, - ICU4XError_DataMissingLocaleError = 258, - ICU4XError_DataNeedsVariantError = 259, - ICU4XError_DataNeedsLocaleError = 260, - ICU4XError_DataExtraneousLocaleError = 261, - ICU4XError_DataFilteredResourceError = 262, - ICU4XError_DataMismatchedTypeError = 263, - ICU4XError_DataMissingPayloadError = 264, - ICU4XError_DataInvalidStateError = 265, - ICU4XError_DataCustomError = 266, - ICU4XError_DataIoError = 267, - ICU4XError_DataUnavailableBufferFormatError = 268, - ICU4XError_DataMismatchedAnyBufferError = 269, - ICU4XError_LocaleUndefinedSubtagError = 512, - ICU4XError_LocaleParserLanguageError = 513, - ICU4XError_LocaleParserSubtagError = 514, - ICU4XError_LocaleParserExtensionError = 515, - ICU4XError_DataStructValidityError = 768, - ICU4XError_PropertyUnknownScriptIdError = 1024, - ICU4XError_PropertyUnknownGeneralCategoryGroupError = 1025, - ICU4XError_PropertyUnexpectedPropertyNameError = 1026, - ICU4XError_FixedDecimalLimitError = 1280, - ICU4XError_FixedDecimalSyntaxError = 1281, - ICU4XError_PluralsParserError = 1536, - ICU4XError_CalendarParseError = 1792, - ICU4XError_CalendarOverflowError = 1793, - ICU4XError_CalendarUnderflowError = 1794, - ICU4XError_CalendarOutOfRangeError = 1795, - ICU4XError_CalendarUnknownEraError = 1796, - ICU4XError_CalendarUnknownMonthCodeError = 1797, - ICU4XError_CalendarMissingInputError = 1798, - ICU4XError_CalendarUnknownKindError = 1799, - ICU4XError_CalendarMissingError = 1800, - ICU4XError_DateTimePatternError = 2048, - ICU4XError_DateTimeMissingInputFieldError = 2049, - ICU4XError_DateTimeSkeletonError = 2050, - ICU4XError_DateTimeUnsupportedFieldError = 2051, - ICU4XError_DateTimeUnsupportedOptionsError = 2052, - ICU4XError_DateTimeMissingWeekdaySymbolError = 2053, - ICU4XError_DateTimeMissingMonthSymbolError = 2054, - ICU4XError_DateTimeFixedDecimalError = 2055, - ICU4XError_DateTimeMismatchedCalendarError = 2056, - ICU4XError_TinyStrTooLargeError = 2304, - ICU4XError_TinyStrContainsNullError = 2305, - ICU4XError_TinyStrNonAsciiError = 2306, - ICU4XError_TimeZoneOffsetOutOfBoundsError = 2560, - ICU4XError_TimeZoneInvalidOffsetError = 2561, - ICU4XError_TimeZoneMissingInputError = 2562, - ICU4XError_NormalizerFutureExtensionError = 2816, - ICU4XError_NormalizerValidationError = 2817, -} ICU4XError; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XError_destroy(ICU4XError* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XError.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XError.hpp deleted file mode 100644 index 74f4ac9b9571..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XError.hpp +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef ICU4XError_HPP -#define ICU4XError_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XError.h" - - - -/** - * A common enum for errors that ICU4X may return, organized by API - * - * The error names are stable and can be checked against as strings in the JS API - * - * Additional information: [1](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.Error.html), [2](https://docs.rs/icu/latest/icu/calendar/enum.CalendarError.html), [3](https://docs.rs/icu/latest/icu/collator/enum.CollatorError.html), [4](https://docs.rs/icu/latest/icu/datetime/enum.DateTimeError.html), [5](https://docs.rs/icu/latest/icu/decimal/enum.DecimalError.html), [6](https://docs.rs/icu/latest/icu/list/enum.ListError.html), [7](https://docs.rs/icu/latest/icu/locid/enum.ParserError.html), [8](https://docs.rs/icu/latest/icu/locid_transform/enum.LocaleTransformError.html), [9](https://docs.rs/icu/latest/icu/normalizer/enum.NormalizerError.html), [10](https://docs.rs/icu/latest/icu/plurals/enum.PluralsError.html), [11](https://docs.rs/icu/latest/icu/properties/enum.PropertiesError.html), [12](https://docs.rs/icu/latest/icu/provider/struct.DataError.html), [13](https://docs.rs/icu/latest/icu/provider/enum.DataErrorKind.html), [14](https://docs.rs/icu/latest/icu/segmenter/enum.SegmenterError.html), [15](https://docs.rs/icu/latest/icu/timezone/enum.TimeZoneError.html) - */ -enum struct ICU4XError { - - /** - * The error is not currently categorized as ICU4XError. - * Please file a bug - */ - UnknownError = 0, - - /** - * An error arising from writing to a string - * Typically found when not enough space is allocated - * Most APIs that return a string may return this error - */ - WriteableError = 1, - OutOfBoundsError = 2, - DataMissingDataKeyError = 256, - DataMissingVariantError = 257, - DataMissingLocaleError = 258, - DataNeedsVariantError = 259, - DataNeedsLocaleError = 260, - DataExtraneousLocaleError = 261, - DataFilteredResourceError = 262, - DataMismatchedTypeError = 263, - DataMissingPayloadError = 264, - DataInvalidStateError = 265, - DataCustomError = 266, - DataIoError = 267, - DataUnavailableBufferFormatError = 268, - DataMismatchedAnyBufferError = 269, - - /** - * The subtag being requested was not set - */ - LocaleUndefinedSubtagError = 512, - - /** - * The locale or subtag string failed to parse - */ - LocaleParserLanguageError = 513, - LocaleParserSubtagError = 514, - LocaleParserExtensionError = 515, - - /** - * Attempted to construct an invalid data struct - */ - DataStructValidityError = 768, - PropertyUnknownScriptIdError = 1024, - PropertyUnknownGeneralCategoryGroupError = 1025, - PropertyUnexpectedPropertyNameError = 1026, - FixedDecimalLimitError = 1280, - FixedDecimalSyntaxError = 1281, - PluralsParserError = 1536, - CalendarParseError = 1792, - CalendarOverflowError = 1793, - CalendarUnderflowError = 1794, - CalendarOutOfRangeError = 1795, - CalendarUnknownEraError = 1796, - CalendarUnknownMonthCodeError = 1797, - CalendarMissingInputError = 1798, - CalendarUnknownKindError = 1799, - CalendarMissingError = 1800, - DateTimePatternError = 2048, - DateTimeMissingInputFieldError = 2049, - DateTimeSkeletonError = 2050, - DateTimeUnsupportedFieldError = 2051, - DateTimeUnsupportedOptionsError = 2052, - DateTimeMissingWeekdaySymbolError = 2053, - DateTimeMissingMonthSymbolError = 2054, - DateTimeFixedDecimalError = 2055, - DateTimeMismatchedCalendarError = 2056, - TinyStrTooLargeError = 2304, - TinyStrContainsNullError = 2305, - TinyStrNonAsciiError = 2306, - TimeZoneOffsetOutOfBoundsError = 2560, - TimeZoneInvalidOffsetError = 2561, - TimeZoneMissingInputError = 2562, - NormalizerFutureExtensionError = 2816, - NormalizerValidationError = 2817, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimal.h b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimal.h deleted file mode 100644 index 361294b68748..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimal.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef ICU4XFixedDecimal_H -#define ICU4XFixedDecimal_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XFixedDecimal ICU4XFixedDecimal; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h" -#include "ICU4XFixedDecimalSign.h" -#include "ICU4XFixedDecimalSignDisplay.h" -#include "diplomat_result_void_void.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_i32(int32_t v); - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_u32(uint32_t v); - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_i64(int64_t v); - -ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_u64(uint64_t v); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_integer_precision(double f); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(double f, int16_t magnitude); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_significant_digits(double f, uint8_t digits); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_floating_precision(double f); - -diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_string(const char* v_data, size_t v_len); - -uint8_t ICU4XFixedDecimal_digit_at(const ICU4XFixedDecimal* self, int16_t magnitude); - -int16_t ICU4XFixedDecimal_magnitude_start(const ICU4XFixedDecimal* self); - -int16_t ICU4XFixedDecimal_magnitude_end(const ICU4XFixedDecimal* self); - -int16_t ICU4XFixedDecimal_nonzero_magnitude_start(const ICU4XFixedDecimal* self); - -int16_t ICU4XFixedDecimal_nonzero_magnitude_end(const ICU4XFixedDecimal* self); - -bool ICU4XFixedDecimal_is_zero(const ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal* self, int16_t power); - -ICU4XFixedDecimalSign ICU4XFixedDecimal_sign(const ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_set_sign(ICU4XFixedDecimal* self, ICU4XFixedDecimalSign sign); - -void ICU4XFixedDecimal_apply_sign_display(ICU4XFixedDecimal* self, ICU4XFixedDecimalSignDisplay sign_display); - -void ICU4XFixedDecimal_trim_start(ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_trim_end(ICU4XFixedDecimal* self); - -void ICU4XFixedDecimal_pad_start(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_pad_end(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_set_max_position(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_trunc(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_trunc(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_expand(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_expand(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_ceil(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_ceil(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_floor(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_floor(ICU4XFixedDecimal* self, int16_t position); - -void ICU4XFixedDecimal_half_even(ICU4XFixedDecimal* self, int16_t position); - -diplomat_result_void_void ICU4XFixedDecimal_concatenate_end(ICU4XFixedDecimal* self, ICU4XFixedDecimal* other); - -void ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal* self, DiplomatWriteable* to); -void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimal.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimal.hpp deleted file mode 100644 index b9d1a041d6b7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimal.hpp +++ /dev/null @@ -1,466 +0,0 @@ -#ifndef ICU4XFixedDecimal_HPP -#define ICU4XFixedDecimal_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XFixedDecimal.h" - -class ICU4XFixedDecimal; -#include "ICU4XError.hpp" -#include "ICU4XFixedDecimalSign.hpp" -#include "ICU4XFixedDecimalSignDisplay.hpp" - -/** - * A destruction policy for using ICU4XFixedDecimal with std::unique_ptr. - */ -struct ICU4XFixedDecimalDeleter { - void operator()(capi::ICU4XFixedDecimal* l) const noexcept { - capi::ICU4XFixedDecimal_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. - */ -class ICU4XFixedDecimal { - public: - - /** - * Construct an [`ICU4XFixedDecimal`] from an integer. - * - * See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. - */ - static ICU4XFixedDecimal create_from_i32(int32_t v); - - /** - * Construct an [`ICU4XFixedDecimal`] from an integer. - * - * See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. - */ - static ICU4XFixedDecimal create_from_u32(uint32_t v); - - /** - * Construct an [`ICU4XFixedDecimal`] from an integer. - * - * See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. - */ - static ICU4XFixedDecimal create_from_i64(int64_t v); - - /** - * Construct an [`ICU4XFixedDecimal`] from an integer. - * - * See the [Rust documentation for `FixedDecimal`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html) for more information. - */ - static ICU4XFixedDecimal create_from_u64(uint64_t v); - - /** - * Construct an [`ICU4XFixedDecimal`] from an integer-valued float - * - * See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information. - * - * See the [Rust documentation for `DoublePrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html) for more information. - */ - static diplomat::result create_from_f64_with_integer_precision(double f); - - /** - * Construct an [`ICU4XFixedDecimal`] from an float, with a given power of 10 for the lower magnitude - * - * See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information. - * - * See the [Rust documentation for `DoublePrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html) for more information. - */ - static diplomat::result create_from_f64_with_lower_magnitude(double f, int16_t magnitude); - - /** - * Construct an [`ICU4XFixedDecimal`] from an float, for a given number of significant digits - * - * See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information. - * - * See the [Rust documentation for `DoublePrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html) for more information. - */ - static diplomat::result create_from_f64_with_significant_digits(double f, uint8_t digits); - - /** - * Construct an [`ICU4XFixedDecimal`] from an float, with enough digits to recover - * the original floating point in IEEE 754 without needing trailing zeros - * - * See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information. - * - * See the [Rust documentation for `DoublePrecision`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html) for more information. - */ - static diplomat::result create_from_f64_with_floating_precision(double f); - - /** - * Construct an [`ICU4XFixedDecimal`] from a string. - * - * See the [Rust documentation for `from_str`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.from_str) for more information. - */ - static diplomat::result create_from_string(const std::string_view v); - - /** - * - * - * See the [Rust documentation for `digit_at`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.digit_at) for more information. - */ - uint8_t digit_at(int16_t magnitude) const; - - /** - * - * - * See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range) for more information. - */ - int16_t magnitude_start() const; - - /** - * - * - * See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range) for more information. - */ - int16_t magnitude_end() const; - - /** - * - * - * See the [Rust documentation for `nonzero_magnitude_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_start) for more information. - */ - int16_t nonzero_magnitude_start() const; - - /** - * - * - * See the [Rust documentation for `nonzero_magnitude_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_end) for more information. - */ - int16_t nonzero_magnitude_end() const; - - /** - * - * - * See the [Rust documentation for `is_zero`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.is_zero) for more information. - */ - bool is_zero() const; - - /** - * Multiply the [`ICU4XFixedDecimal`] by a given power of ten. - * - * See the [Rust documentation for `multiply_pow10`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.multiply_pow10) for more information. - */ - void multiply_pow10(int16_t power); - - /** - * - * - * See the [Rust documentation for `sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.sign) for more information. - */ - ICU4XFixedDecimalSign sign() const; - - /** - * Set the sign of the [`ICU4XFixedDecimal`]. - * - * See the [Rust documentation for `set_sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_sign) for more information. - */ - void set_sign(ICU4XFixedDecimalSign sign); - - /** - * - * - * See the [Rust documentation for `apply_sign_display`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.apply_sign_display) for more information. - */ - void apply_sign_display(ICU4XFixedDecimalSignDisplay sign_display); - - /** - * - * - * See the [Rust documentation for `trim_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_start) for more information. - */ - void trim_start(); - - /** - * - * - * See the [Rust documentation for `trim_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_end) for more information. - */ - void trim_end(); - - /** - * Zero-pad the [`ICU4XFixedDecimal`] on the left to a particular position - * - * See the [Rust documentation for `pad_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_start) for more information. - */ - void pad_start(int16_t position); - - /** - * Zero-pad the [`ICU4XFixedDecimal`] on the right to a particular position - * - * See the [Rust documentation for `pad_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_end) for more information. - */ - void pad_end(int16_t position); - - /** - * Truncate the [`ICU4XFixedDecimal`] on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years - * ("2022" -> "22") - * - * See the [Rust documentation for `set_max_position`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_max_position) for more information. - */ - void set_max_position(int16_t position); - - /** - * - * - * See the [Rust documentation for `trunc`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trunc) for more information. - */ - void trunc(int16_t position); - - /** - * - * - * See the [Rust documentation for `half_trunc`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_trunc) for more information. - */ - void half_trunc(int16_t position); - - /** - * - * - * See the [Rust documentation for `expand`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.expand) for more information. - */ - void expand(int16_t position); - - /** - * - * - * See the [Rust documentation for `half_expand`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_expand) for more information. - */ - void half_expand(int16_t position); - - /** - * - * - * See the [Rust documentation for `ceil`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.ceil) for more information. - */ - void ceil(int16_t position); - - /** - * - * - * See the [Rust documentation for `half_ceil`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_ceil) for more information. - */ - void half_ceil(int16_t position); - - /** - * - * - * See the [Rust documentation for `floor`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.floor) for more information. - */ - void floor(int16_t position); - - /** - * - * - * See the [Rust documentation for `half_floor`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_floor) for more information. - */ - void half_floor(int16_t position); - - /** - * - * - * See the [Rust documentation for `half_even`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_even) for more information. - */ - void half_even(int16_t position); - - /** - * Concatenates `other` to the end of `self`. - * - * If successful, `other` will be set to 0 and a successful status is returned. - * - * If not successful, `other` will be unchanged and an error is returned. - * - * See the [Rust documentation for `concatenate_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.concatenate_end) for more information. - */ - diplomat::result concatenate_end(ICU4XFixedDecimal& other); - - /** - * Format the [`ICU4XFixedDecimal`] as a string. - * - * See the [Rust documentation for `write_to`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.write_to) for more information. - */ - template void to_string_to_writeable(W& to) const; - - /** - * Format the [`ICU4XFixedDecimal`] as a string. - * - * See the [Rust documentation for `write_to`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.write_to) for more information. - */ - std::string to_string() const; - inline const capi::ICU4XFixedDecimal* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XFixedDecimal* AsFFIMut() { return this->inner.get(); } - inline ICU4XFixedDecimal(capi::ICU4XFixedDecimal* i) : inner(i) {} - ICU4XFixedDecimal() = default; - ICU4XFixedDecimal(ICU4XFixedDecimal&&) noexcept = default; - ICU4XFixedDecimal& operator=(ICU4XFixedDecimal&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline ICU4XFixedDecimal ICU4XFixedDecimal::create_from_i32(int32_t v) { - return ICU4XFixedDecimal(capi::ICU4XFixedDecimal_create_from_i32(v)); -} -inline ICU4XFixedDecimal ICU4XFixedDecimal::create_from_u32(uint32_t v) { - return ICU4XFixedDecimal(capi::ICU4XFixedDecimal_create_from_u32(v)); -} -inline ICU4XFixedDecimal ICU4XFixedDecimal::create_from_i64(int64_t v) { - return ICU4XFixedDecimal(capi::ICU4XFixedDecimal_create_from_i64(v)); -} -inline ICU4XFixedDecimal ICU4XFixedDecimal::create_from_u64(uint64_t v) { - return ICU4XFixedDecimal(capi::ICU4XFixedDecimal_create_from_u64(v)); -} -inline diplomat::result ICU4XFixedDecimal::create_from_f64_with_integer_precision(double f) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimal_create_from_f64_with_integer_precision(f); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimal(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XFixedDecimal::create_from_f64_with_lower_magnitude(double f, int16_t magnitude) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(f, magnitude); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimal(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XFixedDecimal::create_from_f64_with_significant_digits(double f, uint8_t digits) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimal_create_from_f64_with_significant_digits(f, digits); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimal(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XFixedDecimal::create_from_f64_with_floating_precision(double f) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimal_create_from_f64_with_floating_precision(f); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimal(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XFixedDecimal::create_from_string(const std::string_view v) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimal_create_from_string(v.data(), v.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimal(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint8_t ICU4XFixedDecimal::digit_at(int16_t magnitude) const { - return capi::ICU4XFixedDecimal_digit_at(this->inner.get(), magnitude); -} -inline int16_t ICU4XFixedDecimal::magnitude_start() const { - return capi::ICU4XFixedDecimal_magnitude_start(this->inner.get()); -} -inline int16_t ICU4XFixedDecimal::magnitude_end() const { - return capi::ICU4XFixedDecimal_magnitude_end(this->inner.get()); -} -inline int16_t ICU4XFixedDecimal::nonzero_magnitude_start() const { - return capi::ICU4XFixedDecimal_nonzero_magnitude_start(this->inner.get()); -} -inline int16_t ICU4XFixedDecimal::nonzero_magnitude_end() const { - return capi::ICU4XFixedDecimal_nonzero_magnitude_end(this->inner.get()); -} -inline bool ICU4XFixedDecimal::is_zero() const { - return capi::ICU4XFixedDecimal_is_zero(this->inner.get()); -} -inline void ICU4XFixedDecimal::multiply_pow10(int16_t power) { - capi::ICU4XFixedDecimal_multiply_pow10(this->inner.get(), power); -} -inline ICU4XFixedDecimalSign ICU4XFixedDecimal::sign() const { - return static_cast(capi::ICU4XFixedDecimal_sign(this->inner.get())); -} -inline void ICU4XFixedDecimal::set_sign(ICU4XFixedDecimalSign sign) { - capi::ICU4XFixedDecimal_set_sign(this->inner.get(), static_cast(sign)); -} -inline void ICU4XFixedDecimal::apply_sign_display(ICU4XFixedDecimalSignDisplay sign_display) { - capi::ICU4XFixedDecimal_apply_sign_display(this->inner.get(), static_cast(sign_display)); -} -inline void ICU4XFixedDecimal::trim_start() { - capi::ICU4XFixedDecimal_trim_start(this->inner.get()); -} -inline void ICU4XFixedDecimal::trim_end() { - capi::ICU4XFixedDecimal_trim_end(this->inner.get()); -} -inline void ICU4XFixedDecimal::pad_start(int16_t position) { - capi::ICU4XFixedDecimal_pad_start(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::pad_end(int16_t position) { - capi::ICU4XFixedDecimal_pad_end(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::set_max_position(int16_t position) { - capi::ICU4XFixedDecimal_set_max_position(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::trunc(int16_t position) { - capi::ICU4XFixedDecimal_trunc(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::half_trunc(int16_t position) { - capi::ICU4XFixedDecimal_half_trunc(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::expand(int16_t position) { - capi::ICU4XFixedDecimal_expand(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::half_expand(int16_t position) { - capi::ICU4XFixedDecimal_half_expand(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::ceil(int16_t position) { - capi::ICU4XFixedDecimal_ceil(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::half_ceil(int16_t position) { - capi::ICU4XFixedDecimal_half_ceil(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::floor(int16_t position) { - capi::ICU4XFixedDecimal_floor(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::half_floor(int16_t position) { - capi::ICU4XFixedDecimal_half_floor(this->inner.get(), position); -} -inline void ICU4XFixedDecimal::half_even(int16_t position) { - capi::ICU4XFixedDecimal_half_even(this->inner.get(), position); -} -inline diplomat::result ICU4XFixedDecimal::concatenate_end(ICU4XFixedDecimal& other) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimal_concatenate_end(this->inner.get(), other.AsFFIMut()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::monostate()); - } - return diplomat_result_out_value; -} -template inline void ICU4XFixedDecimal::to_string_to_writeable(W& to) const { - capi::DiplomatWriteable to_writer = diplomat::WriteableTrait::Construct(to); - capi::ICU4XFixedDecimal_to_string(this->inner.get(), &to_writer); -} -inline std::string ICU4XFixedDecimal::to_string() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - capi::ICU4XFixedDecimal_to_string(this->inner.get(), &diplomat_writeable_out); - return diplomat_writeable_string; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalFormatter.h deleted file mode 100644 index aa1cfd6a48c5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalFormatter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XFixedDecimalFormatter_H -#define ICU4XFixedDecimalFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XFixedDecimalFormatter ICU4XFixedDecimalFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XFixedDecimalGroupingStrategy.h" -#include "diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h" -#include "ICU4XDataStruct.h" -#include "ICU4XFixedDecimal.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError ICU4XFixedDecimalFormatter_create_with_grouping_strategy(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XFixedDecimalGroupingStrategy grouping_strategy); - -diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError ICU4XFixedDecimalFormatter_create_with_decimal_symbols_v1(const ICU4XDataStruct* data_struct, ICU4XFixedDecimalGroupingStrategy grouping_strategy); - -diplomat_result_void_ICU4XError ICU4XFixedDecimalFormatter_format(const ICU4XFixedDecimalFormatter* self, const ICU4XFixedDecimal* value, DiplomatWriteable* write); -void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalFormatter.hpp deleted file mode 100644 index 1b011cd9b773..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalFormatter.hpp +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef ICU4XFixedDecimalFormatter_HPP -#define ICU4XFixedDecimalFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XFixedDecimalFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XFixedDecimalGroupingStrategy.hpp" -class ICU4XFixedDecimalFormatter; -#include "ICU4XError.hpp" -class ICU4XDataStruct; -class ICU4XFixedDecimal; - -/** - * A destruction policy for using ICU4XFixedDecimalFormatter with std::unique_ptr. - */ -struct ICU4XFixedDecimalFormatterDeleter { - void operator()(capi::ICU4XFixedDecimalFormatter* l) const noexcept { - capi::ICU4XFixedDecimalFormatter_destroy(l); - } -}; - -/** - * An ICU4X Fixed Decimal Format object, capable of formatting a [`ICU4XFixedDecimal`] as a string. - * - * See the [Rust documentation for `FixedDecimalFormatter`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html) for more information. - */ -class ICU4XFixedDecimalFormatter { - public: - - /** - * Creates a new [`ICU4XFixedDecimalFormatter`] from locale data. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_grouping_strategy(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XFixedDecimalGroupingStrategy grouping_strategy); - - /** - * Creates a new [`ICU4XFixedDecimalFormatter`] from preconstructed locale data in the form of an [`ICU4XDataStruct`] - * constructed from `ICU4XDataStruct::create_decimal_symbols()`. - * - * The contents of the data struct will be consumed: if you wish to use the struct again it will have to be reconstructed. - * Passing a consumed struct to this method will return an error. - */ - static diplomat::result create_with_decimal_symbols_v1(const ICU4XDataStruct& data_struct, ICU4XFixedDecimalGroupingStrategy grouping_strategy); - - /** - * Formats a [`ICU4XFixedDecimal`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.format) for more information. - */ - template diplomat::result format_to_writeable(const ICU4XFixedDecimal& value, W& write) const; - - /** - * Formats a [`ICU4XFixedDecimal`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.format) for more information. - */ - diplomat::result format(const ICU4XFixedDecimal& value) const; - inline const capi::ICU4XFixedDecimalFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XFixedDecimalFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XFixedDecimalFormatter(capi::ICU4XFixedDecimalFormatter* i) : inner(i) {} - ICU4XFixedDecimalFormatter() = default; - ICU4XFixedDecimalFormatter(ICU4XFixedDecimalFormatter&&) noexcept = default; - ICU4XFixedDecimalFormatter& operator=(ICU4XFixedDecimalFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XDataStruct.hpp" -#include "ICU4XFixedDecimal.hpp" - -inline diplomat::result ICU4XFixedDecimalFormatter::create_with_grouping_strategy(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XFixedDecimalGroupingStrategy grouping_strategy) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimalFormatter_create_with_grouping_strategy(provider.AsFFI(), locale.AsFFI(), static_cast(grouping_strategy)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimalFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XFixedDecimalFormatter::create_with_decimal_symbols_v1(const ICU4XDataStruct& data_struct, ICU4XFixedDecimalGroupingStrategy grouping_strategy) { - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimalFormatter_create_with_decimal_symbols_v1(data_struct.AsFFI(), static_cast(grouping_strategy)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XFixedDecimalFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XFixedDecimalFormatter::format_to_writeable(const ICU4XFixedDecimal& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimalFormatter_format(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XFixedDecimalFormatter::format(const ICU4XFixedDecimal& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XFixedDecimalFormatter_format(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalGroupingStrategy.h b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalGroupingStrategy.h deleted file mode 100644 index 7648892cc5bb..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalGroupingStrategy.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XFixedDecimalGroupingStrategy_H -#define ICU4XFixedDecimalGroupingStrategy_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XFixedDecimalGroupingStrategy { - ICU4XFixedDecimalGroupingStrategy_Auto = 0, - ICU4XFixedDecimalGroupingStrategy_Never = 1, - ICU4XFixedDecimalGroupingStrategy_Always = 2, - ICU4XFixedDecimalGroupingStrategy_Min2 = 3, -} ICU4XFixedDecimalGroupingStrategy; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XFixedDecimalGroupingStrategy_destroy(ICU4XFixedDecimalGroupingStrategy* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalGroupingStrategy.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalGroupingStrategy.hpp deleted file mode 100644 index 8132871e5ab3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalGroupingStrategy.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ICU4XFixedDecimalGroupingStrategy_HPP -#define ICU4XFixedDecimalGroupingStrategy_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XFixedDecimalGroupingStrategy.h" - - - -/** - * - * - * See the [Rust documentation for `GroupingStrategy`](https://docs.rs/icu/latest/icu/decimal/options/enum.GroupingStrategy.html) for more information. - */ -enum struct ICU4XFixedDecimalGroupingStrategy { - Auto = 0, - Never = 1, - Always = 2, - Min2 = 3, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSign.h b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSign.h deleted file mode 100644 index 12fff3cf1cee..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSign.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XFixedDecimalSign_H -#define ICU4XFixedDecimalSign_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XFixedDecimalSign { - ICU4XFixedDecimalSign_None = 0, - ICU4XFixedDecimalSign_Negative = 1, - ICU4XFixedDecimalSign_Positive = 2, -} ICU4XFixedDecimalSign; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XFixedDecimalSign_destroy(ICU4XFixedDecimalSign* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSign.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSign.hpp deleted file mode 100644 index b56cdfc4b692..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSign.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef ICU4XFixedDecimalSign_HPP -#define ICU4XFixedDecimalSign_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XFixedDecimalSign.h" - - - -/** - * The sign of a FixedDecimal, as shown in formatting. - * - * See the [Rust documentation for `Sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.Sign.html) for more information. - */ -enum struct ICU4XFixedDecimalSign { - - /** - * No sign (implicitly positive, e.g., 1729). - */ - None = 0, - - /** - * A negative sign, e.g., -1729. - */ - Negative = 1, - - /** - * An explicit positive sign, e.g., +1729. - */ - Positive = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSignDisplay.h b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSignDisplay.h deleted file mode 100644 index 8c2612e51628..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSignDisplay.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XFixedDecimalSignDisplay_H -#define ICU4XFixedDecimalSignDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XFixedDecimalSignDisplay { - ICU4XFixedDecimalSignDisplay_Auto = 0, - ICU4XFixedDecimalSignDisplay_Never = 1, - ICU4XFixedDecimalSignDisplay_Always = 2, - ICU4XFixedDecimalSignDisplay_ExceptZero = 3, - ICU4XFixedDecimalSignDisplay_Negative = 4, -} ICU4XFixedDecimalSignDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XFixedDecimalSignDisplay_destroy(ICU4XFixedDecimalSignDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSignDisplay.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSignDisplay.hpp deleted file mode 100644 index 6261edacea6b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XFixedDecimalSignDisplay.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XFixedDecimalSignDisplay_HPP -#define ICU4XFixedDecimalSignDisplay_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XFixedDecimalSignDisplay.h" - - - -/** - * ECMA-402 compatible sign display preference. - * - * See the [Rust documentation for `SignDisplay`](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.SignDisplay.html) for more information. - */ -enum struct ICU4XFixedDecimalSignDisplay { - Auto = 0, - Never = 1, - Always = 2, - ExceptZero = 3, - Negative = 4, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGeneralCategoryNameToMaskMapper.h b/third_party/rust/icu_capi/cpp/include/ICU4XGeneralCategoryNameToMaskMapper.h deleted file mode 100644 index 3a4e2d4d13aa..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGeneralCategoryNameToMaskMapper.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XGeneralCategoryNameToMaskMapper_H -#define ICU4XGeneralCategoryNameToMaskMapper_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGeneralCategoryNameToMaskMapper ICU4XGeneralCategoryNameToMaskMapper; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint32_t ICU4XGeneralCategoryNameToMaskMapper_get_strict(const ICU4XGeneralCategoryNameToMaskMapper* self, const char* name_data, size_t name_len); - -uint32_t ICU4XGeneralCategoryNameToMaskMapper_get_loose(const ICU4XGeneralCategoryNameToMaskMapper* self, const char* name_data, size_t name_len); - -diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError ICU4XGeneralCategoryNameToMaskMapper_load(const ICU4XDataProvider* provider); -void ICU4XGeneralCategoryNameToMaskMapper_destroy(ICU4XGeneralCategoryNameToMaskMapper* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGeneralCategoryNameToMaskMapper.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGeneralCategoryNameToMaskMapper.hpp deleted file mode 100644 index c2462bf41752..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGeneralCategoryNameToMaskMapper.hpp +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef ICU4XGeneralCategoryNameToMaskMapper_HPP -#define ICU4XGeneralCategoryNameToMaskMapper_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGeneralCategoryNameToMaskMapper.h" - -class ICU4XDataProvider; -class ICU4XGeneralCategoryNameToMaskMapper; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XGeneralCategoryNameToMaskMapper with std::unique_ptr. - */ -struct ICU4XGeneralCategoryNameToMaskMapperDeleter { - void operator()(capi::ICU4XGeneralCategoryNameToMaskMapper* l) const noexcept { - capi::ICU4XGeneralCategoryNameToMaskMapper_destroy(l); - } -}; - -/** - * A type capable of looking up General Category mask values from a string name. - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.get_name_to_enum_mapper) for more information. - * - * See the [Rust documentation for `PropertyValueNameToEnumMapper`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapper.html) for more information. - */ -class ICU4XGeneralCategoryNameToMaskMapper { - public: - - /** - * Get the mask value matching the given name, using strict matching - * - * Returns 0 if the name is unknown for this property - */ - uint32_t get_strict(const std::string_view name) const; - - /** - * Get the mask value matching the given name, using loose matching - * - * Returns 0 if the name is unknown for this property - */ - uint32_t get_loose(const std::string_view name) const; - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load(const ICU4XDataProvider& provider); - inline const capi::ICU4XGeneralCategoryNameToMaskMapper* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGeneralCategoryNameToMaskMapper* AsFFIMut() { return this->inner.get(); } - inline ICU4XGeneralCategoryNameToMaskMapper(capi::ICU4XGeneralCategoryNameToMaskMapper* i) : inner(i) {} - ICU4XGeneralCategoryNameToMaskMapper() = default; - ICU4XGeneralCategoryNameToMaskMapper(ICU4XGeneralCategoryNameToMaskMapper&&) noexcept = default; - ICU4XGeneralCategoryNameToMaskMapper& operator=(ICU4XGeneralCategoryNameToMaskMapper&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline uint32_t ICU4XGeneralCategoryNameToMaskMapper::get_strict(const std::string_view name) const { - return capi::ICU4XGeneralCategoryNameToMaskMapper_get_strict(this->inner.get(), name.data(), name.size()); -} -inline uint32_t ICU4XGeneralCategoryNameToMaskMapper::get_loose(const std::string_view name) const { - return capi::ICU4XGeneralCategoryNameToMaskMapper_get_loose(this->inner.get(), name.data(), name.size()); -} -inline diplomat::result ICU4XGeneralCategoryNameToMaskMapper::load(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XGeneralCategoryNameToMaskMapper_load(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XGeneralCategoryNameToMaskMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.h b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.h deleted file mode 100644 index 9e23489fd3dd..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorLatin1_H -#define ICU4XGraphemeClusterBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterBreakIteratorLatin1 ICU4XGraphemeClusterBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XGraphemeClusterBreakIteratorLatin1_next(ICU4XGraphemeClusterBreakIteratorLatin1* self); -void ICU4XGraphemeClusterBreakIteratorLatin1_destroy(ICU4XGraphemeClusterBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.hpp deleted file mode 100644 index a690af053930..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorLatin1.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorLatin1_HPP -#define ICU4XGraphemeClusterBreakIteratorLatin1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGraphemeClusterBreakIteratorLatin1.h" - - -/** - * A destruction policy for using ICU4XGraphemeClusterBreakIteratorLatin1 with std::unique_ptr. - */ -struct ICU4XGraphemeClusterBreakIteratorLatin1Deleter { - void operator()(capi::ICU4XGraphemeClusterBreakIteratorLatin1* l) const noexcept { - capi::ICU4XGraphemeClusterBreakIteratorLatin1_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html) for more information. - */ -class ICU4XGraphemeClusterBreakIteratorLatin1 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XGraphemeClusterBreakIteratorLatin1* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGraphemeClusterBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); } - inline ICU4XGraphemeClusterBreakIteratorLatin1(capi::ICU4XGraphemeClusterBreakIteratorLatin1* i) : inner(i) {} - ICU4XGraphemeClusterBreakIteratorLatin1() = default; - ICU4XGraphemeClusterBreakIteratorLatin1(ICU4XGraphemeClusterBreakIteratorLatin1&&) noexcept = default; - ICU4XGraphemeClusterBreakIteratorLatin1& operator=(ICU4XGraphemeClusterBreakIteratorLatin1&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XGraphemeClusterBreakIteratorLatin1::next() { - return capi::ICU4XGraphemeClusterBreakIteratorLatin1_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.h b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.h deleted file mode 100644 index f0de4c0214d6..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorUtf16_H -#define ICU4XGraphemeClusterBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterBreakIteratorUtf16 ICU4XGraphemeClusterBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XGraphemeClusterBreakIteratorUtf16_next(ICU4XGraphemeClusterBreakIteratorUtf16* self); -void ICU4XGraphemeClusterBreakIteratorUtf16_destroy(ICU4XGraphemeClusterBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.hpp deleted file mode 100644 index 930e38aebf3f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf16.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorUtf16_HPP -#define ICU4XGraphemeClusterBreakIteratorUtf16_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGraphemeClusterBreakIteratorUtf16.h" - - -/** - * A destruction policy for using ICU4XGraphemeClusterBreakIteratorUtf16 with std::unique_ptr. - */ -struct ICU4XGraphemeClusterBreakIteratorUtf16Deleter { - void operator()(capi::ICU4XGraphemeClusterBreakIteratorUtf16* l) const noexcept { - capi::ICU4XGraphemeClusterBreakIteratorUtf16_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html) for more information. - */ -class ICU4XGraphemeClusterBreakIteratorUtf16 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XGraphemeClusterBreakIteratorUtf16* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGraphemeClusterBreakIteratorUtf16* AsFFIMut() { return this->inner.get(); } - inline ICU4XGraphemeClusterBreakIteratorUtf16(capi::ICU4XGraphemeClusterBreakIteratorUtf16* i) : inner(i) {} - ICU4XGraphemeClusterBreakIteratorUtf16() = default; - ICU4XGraphemeClusterBreakIteratorUtf16(ICU4XGraphemeClusterBreakIteratorUtf16&&) noexcept = default; - ICU4XGraphemeClusterBreakIteratorUtf16& operator=(ICU4XGraphemeClusterBreakIteratorUtf16&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XGraphemeClusterBreakIteratorUtf16::next() { - return capi::ICU4XGraphemeClusterBreakIteratorUtf16_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.h b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.h deleted file mode 100644 index 331b17eac783..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorUtf8_H -#define ICU4XGraphemeClusterBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterBreakIteratorUtf8 ICU4XGraphemeClusterBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XGraphemeClusterBreakIteratorUtf8_next(ICU4XGraphemeClusterBreakIteratorUtf8* self); -void ICU4XGraphemeClusterBreakIteratorUtf8_destroy(ICU4XGraphemeClusterBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.hpp deleted file mode 100644 index 7a61a2884011..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterBreakIteratorUtf8.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XGraphemeClusterBreakIteratorUtf8_HPP -#define ICU4XGraphemeClusterBreakIteratorUtf8_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGraphemeClusterBreakIteratorUtf8.h" - - -/** - * A destruction policy for using ICU4XGraphemeClusterBreakIteratorUtf8 with std::unique_ptr. - */ -struct ICU4XGraphemeClusterBreakIteratorUtf8Deleter { - void operator()(capi::ICU4XGraphemeClusterBreakIteratorUtf8* l) const noexcept { - capi::ICU4XGraphemeClusterBreakIteratorUtf8_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `GraphemeClusterBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html) for more information. - */ -class ICU4XGraphemeClusterBreakIteratorUtf8 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XGraphemeClusterBreakIteratorUtf8* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGraphemeClusterBreakIteratorUtf8* AsFFIMut() { return this->inner.get(); } - inline ICU4XGraphemeClusterBreakIteratorUtf8(capi::ICU4XGraphemeClusterBreakIteratorUtf8* i) : inner(i) {} - ICU4XGraphemeClusterBreakIteratorUtf8() = default; - ICU4XGraphemeClusterBreakIteratorUtf8(ICU4XGraphemeClusterBreakIteratorUtf8&&) noexcept = default; - ICU4XGraphemeClusterBreakIteratorUtf8& operator=(ICU4XGraphemeClusterBreakIteratorUtf8&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XGraphemeClusterBreakIteratorUtf8::next() { - return capi::ICU4XGraphemeClusterBreakIteratorUtf8_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterSegmenter.h b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterSegmenter.h deleted file mode 100644 index 1805090bfbdc..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterSegmenter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XGraphemeClusterSegmenter_H -#define ICU4XGraphemeClusterSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGraphemeClusterSegmenter ICU4XGraphemeClusterSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h" -#include "ICU4XGraphemeClusterBreakIteratorUtf8.h" -#include "ICU4XGraphemeClusterBreakIteratorUtf16.h" -#include "ICU4XGraphemeClusterBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError ICU4XGraphemeClusterSegmenter_create(const ICU4XDataProvider* provider); - -ICU4XGraphemeClusterBreakIteratorUtf8* ICU4XGraphemeClusterSegmenter_segment_utf8(const ICU4XGraphemeClusterSegmenter* self, const char* input_data, size_t input_len); - -ICU4XGraphemeClusterBreakIteratorUtf16* ICU4XGraphemeClusterSegmenter_segment_utf16(const ICU4XGraphemeClusterSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XGraphemeClusterBreakIteratorLatin1* ICU4XGraphemeClusterSegmenter_segment_latin1(const ICU4XGraphemeClusterSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XGraphemeClusterSegmenter_destroy(ICU4XGraphemeClusterSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterSegmenter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterSegmenter.hpp deleted file mode 100644 index c42f4e801070..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGraphemeClusterSegmenter.hpp +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ICU4XGraphemeClusterSegmenter_HPP -#define ICU4XGraphemeClusterSegmenter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGraphemeClusterSegmenter.h" - -class ICU4XDataProvider; -class ICU4XGraphemeClusterSegmenter; -#include "ICU4XError.hpp" -class ICU4XGraphemeClusterBreakIteratorUtf8; -class ICU4XGraphemeClusterBreakIteratorUtf16; -class ICU4XGraphemeClusterBreakIteratorLatin1; - -/** - * A destruction policy for using ICU4XGraphemeClusterSegmenter with std::unique_ptr. - */ -struct ICU4XGraphemeClusterSegmenterDeleter { - void operator()(capi::ICU4XGraphemeClusterSegmenter* l) const noexcept { - capi::ICU4XGraphemeClusterSegmenter_destroy(l); - } -}; - -/** - * An ICU4X grapheme-cluster-break segmenter, capable of finding grapheme cluster breakpoints - * in strings. - * - * See the [Rust documentation for `GraphemeClusterSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html) for more information. - */ -class ICU4XGraphemeClusterSegmenter { - public: - - /** - * Construct an [`ICU4XGraphemeClusterSegmenter`]. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Segments a (potentially ill-formed) UTF-8 string. - * - * See the [Rust documentation for `segment_utf8`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_utf8) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XGraphemeClusterBreakIteratorUtf8 segment_utf8(const std::string_view input) const; - - /** - * Segments a UTF-16 string. - * - * See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_utf16) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XGraphemeClusterBreakIteratorUtf16 segment_utf16(const diplomat::span input) const; - - /** - * Segments a Latin-1 string. - * - * See the [Rust documentation for `segment_latin1`](https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_latin1) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XGraphemeClusterBreakIteratorLatin1 segment_latin1(const diplomat::span input) const; - inline const capi::ICU4XGraphemeClusterSegmenter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGraphemeClusterSegmenter* AsFFIMut() { return this->inner.get(); } - inline ICU4XGraphemeClusterSegmenter(capi::ICU4XGraphemeClusterSegmenter* i) : inner(i) {} - ICU4XGraphemeClusterSegmenter() = default; - ICU4XGraphemeClusterSegmenter(ICU4XGraphemeClusterSegmenter&&) noexcept = default; - ICU4XGraphemeClusterSegmenter& operator=(ICU4XGraphemeClusterSegmenter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XGraphemeClusterBreakIteratorUtf8.hpp" -#include "ICU4XGraphemeClusterBreakIteratorUtf16.hpp" -#include "ICU4XGraphemeClusterBreakIteratorLatin1.hpp" - -inline diplomat::result ICU4XGraphemeClusterSegmenter::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XGraphemeClusterSegmenter_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XGraphemeClusterSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XGraphemeClusterBreakIteratorUtf8 ICU4XGraphemeClusterSegmenter::segment_utf8(const std::string_view input) const { - return ICU4XGraphemeClusterBreakIteratorUtf8(capi::ICU4XGraphemeClusterSegmenter_segment_utf8(this->inner.get(), input.data(), input.size())); -} -inline ICU4XGraphemeClusterBreakIteratorUtf16 ICU4XGraphemeClusterSegmenter::segment_utf16(const diplomat::span input) const { - return ICU4XGraphemeClusterBreakIteratorUtf16(capi::ICU4XGraphemeClusterSegmenter_segment_utf16(this->inner.get(), input.data(), input.size())); -} -inline ICU4XGraphemeClusterBreakIteratorLatin1 ICU4XGraphemeClusterSegmenter::segment_latin1(const diplomat::span input) const { - return ICU4XGraphemeClusterBreakIteratorLatin1(capi::ICU4XGraphemeClusterSegmenter_segment_latin1(this->inner.get(), input.data(), input.size())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateFormatter.h deleted file mode 100644 index cf3ad9e9f4ae..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateFormatter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XGregorianDateFormatter_H -#define ICU4XGregorianDateFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGregorianDateFormatter ICU4XGregorianDateFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError ICU4XGregorianDateFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength length); - -diplomat_result_void_ICU4XError ICU4XGregorianDateFormatter_format_iso_date(const ICU4XGregorianDateFormatter* self, const ICU4XIsoDate* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XGregorianDateFormatter_format_iso_datetime(const ICU4XGregorianDateFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XGregorianDateFormatter_destroy(ICU4XGregorianDateFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateFormatter.hpp deleted file mode 100644 index 802e39bfe20b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateFormatter.hpp +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef ICU4XGregorianDateFormatter_HPP -#define ICU4XGregorianDateFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGregorianDateFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XDateLength.hpp" -class ICU4XGregorianDateFormatter; -#include "ICU4XError.hpp" -class ICU4XIsoDate; -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XGregorianDateFormatter with std::unique_ptr. - */ -struct ICU4XGregorianDateFormatterDeleter { - void operator()(capi::ICU4XGregorianDateFormatter* l) const noexcept { - capi::ICU4XGregorianDateFormatter_destroy(l); - } -}; - -/** - * An ICU4X TypedDateFormatter object capable of formatting a [`ICU4XIsoDateTime`] as a string, - * using the Gregorian Calendar. - * - * See the [Rust documentation for `TypedDateFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html) for more information. - */ -class ICU4XGregorianDateFormatter { - public: - - /** - * Creates a new [`ICU4XGregorianDateFormatter`] from locale data. - * - * See the [Rust documentation for `try_new_with_length_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.try_new_with_length_unstable) for more information. - */ - static diplomat::result create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength length); - - /** - * Formats a [`ICU4XIsoDate`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_date_to_writeable(const ICU4XIsoDate& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDate`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_date(const ICU4XIsoDate& value) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime(const ICU4XIsoDateTime& value) const; - inline const capi::ICU4XGregorianDateFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGregorianDateFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XGregorianDateFormatter(capi::ICU4XGregorianDateFormatter* i) : inner(i) {} - ICU4XGregorianDateFormatter() = default; - ICU4XGregorianDateFormatter(ICU4XGregorianDateFormatter&&) noexcept = default; - ICU4XGregorianDateFormatter& operator=(ICU4XGregorianDateFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XIsoDate.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XGregorianDateFormatter::create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength length) { - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateFormatter_create_with_length(provider.AsFFI(), locale.AsFFI(), static_cast(length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XGregorianDateFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XGregorianDateFormatter::format_iso_date_to_writeable(const ICU4XIsoDate& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateFormatter_format_iso_date(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XGregorianDateFormatter::format_iso_date(const ICU4XIsoDate& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateFormatter_format_iso_date(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XGregorianDateFormatter::format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XGregorianDateFormatter::format_iso_datetime(const ICU4XIsoDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateTimeFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateTimeFormatter.h deleted file mode 100644 index 0b56ddc3934b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateTimeFormatter.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XGregorianDateTimeFormatter_H -#define ICU4XGregorianDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGregorianDateTimeFormatter ICU4XGregorianDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError ICU4XGregorianDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_void_ICU4XError ICU4XGregorianDateTimeFormatter_format_iso_datetime(const ICU4XGregorianDateTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XGregorianDateTimeFormatter_destroy(ICU4XGregorianDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateTimeFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateTimeFormatter.hpp deleted file mode 100644 index f9b50f4d9629..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianDateTimeFormatter.hpp +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef ICU4XGregorianDateTimeFormatter_HPP -#define ICU4XGregorianDateTimeFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGregorianDateTimeFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XDateLength.hpp" -#include "ICU4XTimeLength.hpp" -class ICU4XGregorianDateTimeFormatter; -#include "ICU4XError.hpp" -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XGregorianDateTimeFormatter with std::unique_ptr. - */ -struct ICU4XGregorianDateTimeFormatterDeleter { - void operator()(capi::ICU4XGregorianDateTimeFormatter* l) const noexcept { - capi::ICU4XGregorianDateTimeFormatter_destroy(l); - } -}; - -/** - * An ICU4X TypedDateTimeFormatter object capable of formatting a [`ICU4XIsoDateTime`] as a string, - * using the Gregorian Calendar. - * - * See the [Rust documentation for `TypedDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html) for more information. - */ -class ICU4XGregorianDateTimeFormatter { - public: - - /** - * Creates a new [`ICU4XGregorianDateFormatter`] from locale data. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime(const ICU4XIsoDateTime& value) const; - inline const capi::ICU4XGregorianDateTimeFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGregorianDateTimeFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XGregorianDateTimeFormatter(capi::ICU4XGregorianDateTimeFormatter* i) : inner(i) {} - ICU4XGregorianDateTimeFormatter() = default; - ICU4XGregorianDateTimeFormatter(ICU4XGregorianDateTimeFormatter&&) noexcept = default; - ICU4XGregorianDateTimeFormatter& operator=(ICU4XGregorianDateTimeFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XGregorianDateTimeFormatter::create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length) { - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateTimeFormatter_create_with_lengths(provider.AsFFI(), locale.AsFFI(), static_cast(date_length), static_cast(time_length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XGregorianDateTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XGregorianDateTimeFormatter::format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateTimeFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XGregorianDateTimeFormatter::format_iso_datetime(const ICU4XIsoDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianDateTimeFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianZonedDateTimeFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XGregorianZonedDateTimeFormatter.h deleted file mode 100644 index 4be60c2b0b27..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianZonedDateTimeFormatter.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef ICU4XGregorianZonedDateTimeFormatter_H -#define ICU4XGregorianZonedDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XGregorianZonedDateTimeFormatter ICU4XGregorianZonedDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h" -#include "ICU4XIsoTimeZoneOptions.h" -#include "ICU4XIsoDateTime.h" -#include "ICU4XCustomTimeZone.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options); - -diplomat_result_void_ICU4XError ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(const ICU4XGregorianZonedDateTimeFormatter* self, const ICU4XIsoDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write); -void ICU4XGregorianZonedDateTimeFormatter_destroy(ICU4XGregorianZonedDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianZonedDateTimeFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XGregorianZonedDateTimeFormatter.hpp deleted file mode 100644 index fbc41f9885d7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XGregorianZonedDateTimeFormatter.hpp +++ /dev/null @@ -1,134 +0,0 @@ -#ifndef ICU4XGregorianZonedDateTimeFormatter_HPP -#define ICU4XGregorianZonedDateTimeFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XGregorianZonedDateTimeFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XDateLength.hpp" -#include "ICU4XTimeLength.hpp" -class ICU4XGregorianZonedDateTimeFormatter; -#include "ICU4XError.hpp" -struct ICU4XIsoTimeZoneOptions; -class ICU4XIsoDateTime; -class ICU4XCustomTimeZone; - -/** - * A destruction policy for using ICU4XGregorianZonedDateTimeFormatter with std::unique_ptr. - */ -struct ICU4XGregorianZonedDateTimeFormatterDeleter { - void operator()(capi::ICU4XGregorianZonedDateTimeFormatter* l) const noexcept { - capi::ICU4XGregorianZonedDateTimeFormatter_destroy(l); - } -}; - -/** - * An object capable of formatting a date time with time zone to a string. - * - * See the [Rust documentation for `TypedZonedDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html) for more information. - */ -class ICU4XGregorianZonedDateTimeFormatter { - public: - - /** - * Creates a new [`ICU4XGregorianZonedDateTimeFormatter`] from locale data. - * - * This function has `date_length` and `time_length` arguments and uses default options - * for the time zone. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - - /** - * Creates a new [`ICU4XGregorianZonedDateTimeFormatter`] from locale data. - * - * This function has `date_length` and `time_length` arguments and uses an ISO-8601 style - * fallback for the time zone with the given configurations. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options); - - /** - * Formats a [`ICU4XIsoDateTime`] and [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_with_custom_time_zone_to_writeable(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] and [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime_with_custom_time_zone(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone) const; - inline const capi::ICU4XGregorianZonedDateTimeFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XGregorianZonedDateTimeFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XGregorianZonedDateTimeFormatter(capi::ICU4XGregorianZonedDateTimeFormatter* i) : inner(i) {} - ICU4XGregorianZonedDateTimeFormatter() = default; - ICU4XGregorianZonedDateTimeFormatter(ICU4XGregorianZonedDateTimeFormatter&&) noexcept = default; - ICU4XGregorianZonedDateTimeFormatter& operator=(ICU4XGregorianZonedDateTimeFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XIsoTimeZoneOptions.hpp" -#include "ICU4XIsoDateTime.hpp" -#include "ICU4XCustomTimeZone.hpp" - -inline diplomat::result ICU4XGregorianZonedDateTimeFormatter::create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length) { - auto diplomat_result_raw_out_value = capi::ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(provider.AsFFI(), locale.AsFFI(), static_cast(date_length), static_cast(time_length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XGregorianZonedDateTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XGregorianZonedDateTimeFormatter::create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options) { - ICU4XIsoTimeZoneOptions diplomat_wrapped_struct_zone_options = zone_options; - auto diplomat_result_raw_out_value = capi::ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(provider.AsFFI(), locale.AsFFI(), static_cast(date_length), static_cast(time_length), capi::ICU4XIsoTimeZoneOptions{ .format = static_cast(diplomat_wrapped_struct_zone_options.format), .minutes = static_cast(diplomat_wrapped_struct_zone_options.minutes), .seconds = static_cast(diplomat_wrapped_struct_zone_options.seconds) }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XGregorianZonedDateTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XGregorianZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone_to_writeable(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(this->inner.get(), datetime.AsFFI(), time_zone.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XGregorianZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(this->inner.get(), datetime.AsFFI(), time_zone.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDate.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoDate.h deleted file mode 100644 index aadc7590bad9..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDate.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef ICU4XIsoDate_H -#define ICU4XIsoDate_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XIsoDate ICU4XIsoDate; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XIsoDate_ICU4XError.h" -#include "ICU4XCalendar.h" -#include "ICU4XDate.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XIsoDate_ICU4XError ICU4XIsoDate_create(int32_t year, uint8_t month, uint8_t day); - -ICU4XDate* ICU4XIsoDate_to_calendar(const ICU4XIsoDate* self, const ICU4XCalendar* calendar); - -ICU4XDate* ICU4XIsoDate_to_any(const ICU4XIsoDate* self); - -uint32_t ICU4XIsoDate_day_of_month(const ICU4XIsoDate* self); - -ICU4XIsoWeekday ICU4XIsoDate_day_of_week(const ICU4XIsoDate* self); - -uint32_t ICU4XIsoDate_week_of_month(const ICU4XIsoDate* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XIsoDate_week_of_year(const ICU4XIsoDate* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XIsoDate_month(const ICU4XIsoDate* self); - -int32_t ICU4XIsoDate_year(const ICU4XIsoDate* self); - -uint8_t ICU4XIsoDate_months_in_year(const ICU4XIsoDate* self); - -uint8_t ICU4XIsoDate_days_in_month(const ICU4XIsoDate* self); - -uint32_t ICU4XIsoDate_days_in_year(const ICU4XIsoDate* self); -void ICU4XIsoDate_destroy(ICU4XIsoDate* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDate.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoDate.hpp deleted file mode 100644 index 83db48655a8f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDate.hpp +++ /dev/null @@ -1,191 +0,0 @@ -#ifndef ICU4XIsoDate_HPP -#define ICU4XIsoDate_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoDate.h" - -class ICU4XIsoDate; -#include "ICU4XError.hpp" -class ICU4XCalendar; -class ICU4XDate; -#include "ICU4XIsoWeekday.hpp" -class ICU4XWeekCalculator; -struct ICU4XWeekOf; - -/** - * A destruction policy for using ICU4XIsoDate with std::unique_ptr. - */ -struct ICU4XIsoDateDeleter { - void operator()(capi::ICU4XIsoDate* l) const noexcept { - capi::ICU4XIsoDate_destroy(l); - } -}; - -/** - * An ICU4X Date object capable of containing a ISO-8601 date - * - * See the [Rust documentation for `Date`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html) for more information. - */ -class ICU4XIsoDate { - public: - - /** - * Creates a new [`ICU4XIsoDate`] from the specified date and time. - * - * See the [Rust documentation for `try_new_iso_date`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_iso_date) for more information. - */ - static diplomat::result create(int32_t year, uint8_t month, uint8_t day); - - /** - * Convert this date to one in a different calendar - * - * See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar) for more information. - */ - ICU4XDate to_calendar(const ICU4XCalendar& calendar) const; - - /** - * - * - * See the [Rust documentation for `to_any`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_any) for more information. - */ - ICU4XDate to_any() const; - - /** - * Returns the 1-indexed day in the month for this date - * - * See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. - */ - uint32_t day_of_month() const; - - /** - * Returns the day in the week for this day - * - * See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. - */ - ICU4XIsoWeekday day_of_week() const; - - /** - * Returns the week number in this month, 1-indexed, based on what - * is considered the first day of the week (often a locale preference). - * - * `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - * - * See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information. - */ - uint32_t week_of_month(ICU4XIsoWeekday first_weekday) const; - - /** - * Returns the week number in this year, using week data - * - * See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. - */ - diplomat::result week_of_year(const ICU4XWeekCalculator& calculator) const; - - /** - * Returns 1-indexed number of the month of this date in its year - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - uint32_t month() const; - - /** - * Returns the year number for this date - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. - */ - int32_t year() const; - - /** - * Returns the number of months in the year represented by this date - * - * See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. - */ - uint8_t months_in_year() const; - - /** - * Returns the number of days in the month represented by this date - * - * See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. - */ - uint8_t days_in_month() const; - - /** - * Returns the number of days in the year represented by this date - * - * See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. - */ - uint32_t days_in_year() const; - inline const capi::ICU4XIsoDate* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XIsoDate* AsFFIMut() { return this->inner.get(); } - inline ICU4XIsoDate(capi::ICU4XIsoDate* i) : inner(i) {} - ICU4XIsoDate() = default; - ICU4XIsoDate(ICU4XIsoDate&&) noexcept = default; - ICU4XIsoDate& operator=(ICU4XIsoDate&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XCalendar.hpp" -#include "ICU4XDate.hpp" -#include "ICU4XWeekCalculator.hpp" -#include "ICU4XWeekOf.hpp" - -inline diplomat::result ICU4XIsoDate::create(int32_t year, uint8_t month, uint8_t day) { - auto diplomat_result_raw_out_value = capi::ICU4XIsoDate_create(year, month, day); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XIsoDate(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XDate ICU4XIsoDate::to_calendar(const ICU4XCalendar& calendar) const { - return ICU4XDate(capi::ICU4XIsoDate_to_calendar(this->inner.get(), calendar.AsFFI())); -} -inline ICU4XDate ICU4XIsoDate::to_any() const { - return ICU4XDate(capi::ICU4XIsoDate_to_any(this->inner.get())); -} -inline uint32_t ICU4XIsoDate::day_of_month() const { - return capi::ICU4XIsoDate_day_of_month(this->inner.get()); -} -inline ICU4XIsoWeekday ICU4XIsoDate::day_of_week() const { - return static_cast(capi::ICU4XIsoDate_day_of_week(this->inner.get())); -} -inline uint32_t ICU4XIsoDate::week_of_month(ICU4XIsoWeekday first_weekday) const { - return capi::ICU4XIsoDate_week_of_month(this->inner.get(), static_cast(first_weekday)); -} -inline diplomat::result ICU4XIsoDate::week_of_year(const ICU4XWeekCalculator& calculator) const { - auto diplomat_result_raw_out_value = capi::ICU4XIsoDate_week_of_year(this->inner.get(), calculator.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - capi::ICU4XWeekOf diplomat_raw_struct_out_value = diplomat_result_raw_out_value.ok; - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWeekOf{ .week = std::move(diplomat_raw_struct_out_value.week), .unit = std::move(static_cast(diplomat_raw_struct_out_value.unit)) })); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint32_t ICU4XIsoDate::month() const { - return capi::ICU4XIsoDate_month(this->inner.get()); -} -inline int32_t ICU4XIsoDate::year() const { - return capi::ICU4XIsoDate_year(this->inner.get()); -} -inline uint8_t ICU4XIsoDate::months_in_year() const { - return capi::ICU4XIsoDate_months_in_year(this->inner.get()); -} -inline uint8_t ICU4XIsoDate::days_in_month() const { - return capi::ICU4XIsoDate_days_in_month(this->inner.get()); -} -inline uint32_t ICU4XIsoDate::days_in_year() const { - return capi::ICU4XIsoDate_days_in_year(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDateTime.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoDateTime.h deleted file mode 100644 index 6f1a2acbe2d6..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDateTime.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef ICU4XIsoDateTime_H -#define ICU4XIsoDateTime_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XIsoDateTime ICU4XIsoDateTime; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h" -#include "ICU4XIsoDate.h" -#include "ICU4XTime.h" -#include "ICU4XDateTime.h" -#include "ICU4XCalendar.h" -#include "ICU4XIsoWeekday.h" -#include "ICU4XWeekCalculator.h" -#include "diplomat_result_ICU4XWeekOf_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XIsoDateTime_ICU4XError ICU4XIsoDateTime_create(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond); - -ICU4XIsoDateTime* ICU4XIsoDateTime_crate_from_date_and_time(const ICU4XIsoDate* date, const ICU4XTime* time); - -ICU4XIsoDateTime* ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(int32_t minutes); - -ICU4XIsoDate* ICU4XIsoDateTime_date(const ICU4XIsoDateTime* self); - -ICU4XTime* ICU4XIsoDateTime_time(const ICU4XIsoDateTime* self); - -ICU4XDateTime* ICU4XIsoDateTime_to_any(const ICU4XIsoDateTime* self); - -int32_t ICU4XIsoDateTime_minutes_since_local_unix_epoch(const ICU4XIsoDateTime* self); - -ICU4XDateTime* ICU4XIsoDateTime_to_calendar(const ICU4XIsoDateTime* self, const ICU4XCalendar* calendar); - -uint8_t ICU4XIsoDateTime_hour(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_minute(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_second(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_nanosecond(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_day_of_month(const ICU4XIsoDateTime* self); - -ICU4XIsoWeekday ICU4XIsoDateTime_day_of_week(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_week_of_month(const ICU4XIsoDateTime* self, ICU4XIsoWeekday first_weekday); - -diplomat_result_ICU4XWeekOf_ICU4XError ICU4XIsoDateTime_week_of_year(const ICU4XIsoDateTime* self, const ICU4XWeekCalculator* calculator); - -uint32_t ICU4XIsoDateTime_month(const ICU4XIsoDateTime* self); - -int32_t ICU4XIsoDateTime_year(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_months_in_year(const ICU4XIsoDateTime* self); - -uint8_t ICU4XIsoDateTime_days_in_month(const ICU4XIsoDateTime* self); - -uint32_t ICU4XIsoDateTime_days_in_year(const ICU4XIsoDateTime* self); -void ICU4XIsoDateTime_destroy(ICU4XIsoDateTime* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDateTime.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoDateTime.hpp deleted file mode 100644 index 0d744f69a1e8..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoDateTime.hpp +++ /dev/null @@ -1,286 +0,0 @@ -#ifndef ICU4XIsoDateTime_HPP -#define ICU4XIsoDateTime_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoDateTime.h" - -class ICU4XIsoDateTime; -#include "ICU4XError.hpp" -class ICU4XIsoDate; -class ICU4XTime; -class ICU4XDateTime; -class ICU4XCalendar; -#include "ICU4XIsoWeekday.hpp" -class ICU4XWeekCalculator; -struct ICU4XWeekOf; - -/** - * A destruction policy for using ICU4XIsoDateTime with std::unique_ptr. - */ -struct ICU4XIsoDateTimeDeleter { - void operator()(capi::ICU4XIsoDateTime* l) const noexcept { - capi::ICU4XIsoDateTime_destroy(l); - } -}; - -/** - * An ICU4X DateTime object capable of containing a ISO-8601 date and time. - * - * See the [Rust documentation for `DateTime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html) for more information. - */ -class ICU4XIsoDateTime { - public: - - /** - * Creates a new [`ICU4XIsoDateTime`] from the specified date and time. - * - * See the [Rust documentation for `try_new_iso_datetime`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_iso_datetime) for more information. - */ - static diplomat::result create(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond); - - /** - * Creates a new [`ICU4XIsoDateTime`] from an [`ICU4XIsoDate`] and [`ICU4XTime`] object - * - * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information. - */ - static ICU4XIsoDateTime crate_from_date_and_time(const ICU4XIsoDate& date, const ICU4XTime& time); - - /** - * Construct from the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) - * - * See the [Rust documentation for `from_minutes_since_local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.from_minutes_since_local_unix_epoch) for more information. - */ - static ICU4XIsoDateTime create_from_minutes_since_local_unix_epoch(int32_t minutes); - - /** - * Gets the date contained in this object - * - * See the [Rust documentation for `date`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date) for more information. - */ - ICU4XIsoDate date() const; - - /** - * Gets the time contained in this object - * - * See the [Rust documentation for `time`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time) for more information. - */ - ICU4XTime time() const; - - /** - * Converts this to an [`ICU4XDateTime`] capable of being mixed with dates of - * other calendars - * - * See the [Rust documentation for `to_any`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_any) for more information. - */ - ICU4XDateTime to_any() const; - - /** - * Gets the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) - * - * See the [Rust documentation for `minutes_since_local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.minutes_since_local_unix_epoch) for more information. - */ - int32_t minutes_since_local_unix_epoch() const; - - /** - * Convert this datetime to one in a different calendar - * - * See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar) for more information. - */ - ICU4XDateTime to_calendar(const ICU4XCalendar& calendar) const; - - /** - * Returns the hour in this time - * - * See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour) for more information. - */ - uint8_t hour() const; - - /** - * Returns the minute in this time - * - * See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute) for more information. - */ - uint8_t minute() const; - - /** - * Returns the second in this time - * - * See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second) for more information. - */ - uint8_t second() const; - - /** - * Returns the nanosecond in this time - * - * See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond) for more information. - */ - uint32_t nanosecond() const; - - /** - * Returns the 1-indexed day in the month for this date - * - * See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. - */ - uint32_t day_of_month() const; - - /** - * Returns the day in the week for this day - * - * See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. - */ - ICU4XIsoWeekday day_of_week() const; - - /** - * Returns the week number in this month, 1-indexed, based on what - * is considered the first day of the week (often a locale preference). - * - * `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - * - * See the [Rust documentation for `week_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month) for more information. - */ - uint32_t week_of_month(ICU4XIsoWeekday first_weekday) const; - - /** - * Returns the week number in this year, using week data - * - * See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. - */ - diplomat::result week_of_year(const ICU4XWeekCalculator& calculator) const; - - /** - * Returns 1-indexed number of the month of this date in its year - * - * See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. - */ - uint32_t month() const; - - /** - * Returns the year number for this date - * - * See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. - */ - int32_t year() const; - - /** - * Returns the number of months in the year represented by this date - * - * See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. - */ - uint8_t months_in_year() const; - - /** - * Returns the number of days in the month represented by this date - * - * See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. - */ - uint8_t days_in_month() const; - - /** - * Returns the number of days in the year represented by this date - * - * See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. - */ - uint32_t days_in_year() const; - inline const capi::ICU4XIsoDateTime* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XIsoDateTime* AsFFIMut() { return this->inner.get(); } - inline ICU4XIsoDateTime(capi::ICU4XIsoDateTime* i) : inner(i) {} - ICU4XIsoDateTime() = default; - ICU4XIsoDateTime(ICU4XIsoDateTime&&) noexcept = default; - ICU4XIsoDateTime& operator=(ICU4XIsoDateTime&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XIsoDate.hpp" -#include "ICU4XTime.hpp" -#include "ICU4XDateTime.hpp" -#include "ICU4XCalendar.hpp" -#include "ICU4XWeekCalculator.hpp" -#include "ICU4XWeekOf.hpp" - -inline diplomat::result ICU4XIsoDateTime::create(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond) { - auto diplomat_result_raw_out_value = capi::ICU4XIsoDateTime_create(year, month, day, hour, minute, second, nanosecond); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XIsoDateTime(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XIsoDateTime ICU4XIsoDateTime::crate_from_date_and_time(const ICU4XIsoDate& date, const ICU4XTime& time) { - return ICU4XIsoDateTime(capi::ICU4XIsoDateTime_crate_from_date_and_time(date.AsFFI(), time.AsFFI())); -} -inline ICU4XIsoDateTime ICU4XIsoDateTime::create_from_minutes_since_local_unix_epoch(int32_t minutes) { - return ICU4XIsoDateTime(capi::ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(minutes)); -} -inline ICU4XIsoDate ICU4XIsoDateTime::date() const { - return ICU4XIsoDate(capi::ICU4XIsoDateTime_date(this->inner.get())); -} -inline ICU4XTime ICU4XIsoDateTime::time() const { - return ICU4XTime(capi::ICU4XIsoDateTime_time(this->inner.get())); -} -inline ICU4XDateTime ICU4XIsoDateTime::to_any() const { - return ICU4XDateTime(capi::ICU4XIsoDateTime_to_any(this->inner.get())); -} -inline int32_t ICU4XIsoDateTime::minutes_since_local_unix_epoch() const { - return capi::ICU4XIsoDateTime_minutes_since_local_unix_epoch(this->inner.get()); -} -inline ICU4XDateTime ICU4XIsoDateTime::to_calendar(const ICU4XCalendar& calendar) const { - return ICU4XDateTime(capi::ICU4XIsoDateTime_to_calendar(this->inner.get(), calendar.AsFFI())); -} -inline uint8_t ICU4XIsoDateTime::hour() const { - return capi::ICU4XIsoDateTime_hour(this->inner.get()); -} -inline uint8_t ICU4XIsoDateTime::minute() const { - return capi::ICU4XIsoDateTime_minute(this->inner.get()); -} -inline uint8_t ICU4XIsoDateTime::second() const { - return capi::ICU4XIsoDateTime_second(this->inner.get()); -} -inline uint32_t ICU4XIsoDateTime::nanosecond() const { - return capi::ICU4XIsoDateTime_nanosecond(this->inner.get()); -} -inline uint32_t ICU4XIsoDateTime::day_of_month() const { - return capi::ICU4XIsoDateTime_day_of_month(this->inner.get()); -} -inline ICU4XIsoWeekday ICU4XIsoDateTime::day_of_week() const { - return static_cast(capi::ICU4XIsoDateTime_day_of_week(this->inner.get())); -} -inline uint32_t ICU4XIsoDateTime::week_of_month(ICU4XIsoWeekday first_weekday) const { - return capi::ICU4XIsoDateTime_week_of_month(this->inner.get(), static_cast(first_weekday)); -} -inline diplomat::result ICU4XIsoDateTime::week_of_year(const ICU4XWeekCalculator& calculator) const { - auto diplomat_result_raw_out_value = capi::ICU4XIsoDateTime_week_of_year(this->inner.get(), calculator.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - capi::ICU4XWeekOf diplomat_raw_struct_out_value = diplomat_result_raw_out_value.ok; - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWeekOf{ .week = std::move(diplomat_raw_struct_out_value.week), .unit = std::move(static_cast(diplomat_raw_struct_out_value.unit)) })); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint32_t ICU4XIsoDateTime::month() const { - return capi::ICU4XIsoDateTime_month(this->inner.get()); -} -inline int32_t ICU4XIsoDateTime::year() const { - return capi::ICU4XIsoDateTime_year(this->inner.get()); -} -inline uint8_t ICU4XIsoDateTime::months_in_year() const { - return capi::ICU4XIsoDateTime_months_in_year(this->inner.get()); -} -inline uint8_t ICU4XIsoDateTime::days_in_month() const { - return capi::ICU4XIsoDateTime_days_in_month(this->inner.get()); -} -inline uint32_t ICU4XIsoDateTime::days_in_year() const { - return capi::ICU4XIsoDateTime_days_in_year(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneFormat.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneFormat.h deleted file mode 100644 index e48a1142f213..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneFormat.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XIsoTimeZoneFormat_H -#define ICU4XIsoTimeZoneFormat_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoTimeZoneFormat { - ICU4XIsoTimeZoneFormat_Basic = 0, - ICU4XIsoTimeZoneFormat_Extended = 1, - ICU4XIsoTimeZoneFormat_UtcBasic = 2, - ICU4XIsoTimeZoneFormat_UtcExtended = 3, -} ICU4XIsoTimeZoneFormat; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneFormat_destroy(ICU4XIsoTimeZoneFormat* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneFormat.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneFormat.hpp deleted file mode 100644 index 700806d92942..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneFormat.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ICU4XIsoTimeZoneFormat_HPP -#define ICU4XIsoTimeZoneFormat_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoTimeZoneFormat.h" - - - -/** - * - * - * See the [Rust documentation for `IsoFormat`](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoFormat.html) for more information. - */ -enum struct ICU4XIsoTimeZoneFormat { - Basic = 0, - Extended = 1, - UtcBasic = 2, - UtcExtended = 3, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneMinuteDisplay.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneMinuteDisplay.h deleted file mode 100644 index edeee9701913..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneMinuteDisplay.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XIsoTimeZoneMinuteDisplay_H -#define ICU4XIsoTimeZoneMinuteDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoTimeZoneMinuteDisplay { - ICU4XIsoTimeZoneMinuteDisplay_Required = 0, - ICU4XIsoTimeZoneMinuteDisplay_Optional = 1, -} ICU4XIsoTimeZoneMinuteDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneMinuteDisplay_destroy(ICU4XIsoTimeZoneMinuteDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneMinuteDisplay.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneMinuteDisplay.hpp deleted file mode 100644 index f395f823f3e0..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneMinuteDisplay.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ICU4XIsoTimeZoneMinuteDisplay_HPP -#define ICU4XIsoTimeZoneMinuteDisplay_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoTimeZoneMinuteDisplay.h" - - - -/** - * - * - * See the [Rust documentation for `IsoMinutes`](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoMinutes.html) for more information. - */ -enum struct ICU4XIsoTimeZoneMinuteDisplay { - Required = 0, - Optional = 1, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneOptions.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneOptions.h deleted file mode 100644 index 7ba051c3e617..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneOptions.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XIsoTimeZoneOptions_H -#define ICU4XIsoTimeZoneOptions_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XIsoTimeZoneFormat.h" -#include "ICU4XIsoTimeZoneMinuteDisplay.h" -#include "ICU4XIsoTimeZoneSecondDisplay.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XIsoTimeZoneOptions { - ICU4XIsoTimeZoneFormat format; - ICU4XIsoTimeZoneMinuteDisplay minutes; - ICU4XIsoTimeZoneSecondDisplay seconds; -} ICU4XIsoTimeZoneOptions; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XIsoTimeZoneFormat.h" -#include "ICU4XIsoTimeZoneMinuteDisplay.h" -#include "ICU4XIsoTimeZoneSecondDisplay.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneOptions_destroy(ICU4XIsoTimeZoneOptions* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneOptions.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneOptions.hpp deleted file mode 100644 index 50826833290d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneOptions.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ICU4XIsoTimeZoneOptions_HPP -#define ICU4XIsoTimeZoneOptions_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoTimeZoneOptions.h" - -#include "ICU4XIsoTimeZoneFormat.hpp" -#include "ICU4XIsoTimeZoneMinuteDisplay.hpp" -#include "ICU4XIsoTimeZoneSecondDisplay.hpp" - -struct ICU4XIsoTimeZoneOptions { - public: - ICU4XIsoTimeZoneFormat format; - ICU4XIsoTimeZoneMinuteDisplay minutes; - ICU4XIsoTimeZoneSecondDisplay seconds; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneSecondDisplay.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneSecondDisplay.h deleted file mode 100644 index 487a248f958a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneSecondDisplay.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XIsoTimeZoneSecondDisplay_H -#define ICU4XIsoTimeZoneSecondDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoTimeZoneSecondDisplay { - ICU4XIsoTimeZoneSecondDisplay_Optional = 0, - ICU4XIsoTimeZoneSecondDisplay_Never = 1, -} ICU4XIsoTimeZoneSecondDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoTimeZoneSecondDisplay_destroy(ICU4XIsoTimeZoneSecondDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneSecondDisplay.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneSecondDisplay.hpp deleted file mode 100644 index 68f571211f50..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoTimeZoneSecondDisplay.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ICU4XIsoTimeZoneSecondDisplay_HPP -#define ICU4XIsoTimeZoneSecondDisplay_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoTimeZoneSecondDisplay.h" - - - -/** - * - * - * See the [Rust documentation for `IsoSeconds`](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoSeconds.html) for more information. - */ -enum struct ICU4XIsoTimeZoneSecondDisplay { - Optional = 0, - Never = 1, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoWeekday.h b/third_party/rust/icu_capi/cpp/include/ICU4XIsoWeekday.h deleted file mode 100644 index a23d0a3b9e92..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoWeekday.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XIsoWeekday_H -#define ICU4XIsoWeekday_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XIsoWeekday { - ICU4XIsoWeekday_Monday = 1, - ICU4XIsoWeekday_Tuesday = 2, - ICU4XIsoWeekday_Wednesday = 3, - ICU4XIsoWeekday_Thursday = 4, - ICU4XIsoWeekday_Friday = 5, - ICU4XIsoWeekday_Saturday = 6, - ICU4XIsoWeekday_Sunday = 7, -} ICU4XIsoWeekday; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XIsoWeekday_destroy(ICU4XIsoWeekday* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XIsoWeekday.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XIsoWeekday.hpp deleted file mode 100644 index ec33e4a80ec0..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XIsoWeekday.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef ICU4XIsoWeekday_HPP -#define ICU4XIsoWeekday_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XIsoWeekday.h" - - -enum struct ICU4XIsoWeekday { - Monday = 1, - Tuesday = 2, - Wednesday = 3, - Thursday = 4, - Friday = 5, - Saturday = 6, - Sunday = 7, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLanguageDisplay.h b/third_party/rust/icu_capi/cpp/include/ICU4XLanguageDisplay.h deleted file mode 100644 index 0b921351fefa..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLanguageDisplay.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XLanguageDisplay_H -#define ICU4XLanguageDisplay_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLanguageDisplay { - ICU4XLanguageDisplay_Dialect = 0, - ICU4XLanguageDisplay_Standard = 1, -} ICU4XLanguageDisplay; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLanguageDisplay_destroy(ICU4XLanguageDisplay* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLanguageDisplay.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLanguageDisplay.hpp deleted file mode 100644 index 52d9a78ec039..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLanguageDisplay.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ICU4XLanguageDisplay_HPP -#define ICU4XLanguageDisplay_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLanguageDisplay.h" - - - -/** - * - * - * See the [Rust documentation for `LanguageDisplay`](https://docs.rs/icu/latest/icu/displaynames/options/enum.LanguageDisplay.html) for more information. - */ -enum struct ICU4XLanguageDisplay { - Dialect = 0, - Standard = 1, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.h deleted file mode 100644 index c1a4c391318f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLineBreakIteratorLatin1_H -#define ICU4XLineBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakIteratorLatin1 ICU4XLineBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XLineBreakIteratorLatin1_next(ICU4XLineBreakIteratorLatin1* self); -void ICU4XLineBreakIteratorLatin1_destroy(ICU4XLineBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp deleted file mode 100644 index 40ff1426a058..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorLatin1.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef ICU4XLineBreakIteratorLatin1_HPP -#define ICU4XLineBreakIteratorLatin1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineBreakIteratorLatin1.h" - - -/** - * A destruction policy for using ICU4XLineBreakIteratorLatin1 with std::unique_ptr. - */ -struct ICU4XLineBreakIteratorLatin1Deleter { - void operator()(capi::ICU4XLineBreakIteratorLatin1* l) const noexcept { - capi::ICU4XLineBreakIteratorLatin1_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorLatin1.html) - */ -class ICU4XLineBreakIteratorLatin1 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XLineBreakIteratorLatin1* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLineBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); } - inline ICU4XLineBreakIteratorLatin1(capi::ICU4XLineBreakIteratorLatin1* i) : inner(i) {} - ICU4XLineBreakIteratorLatin1() = default; - ICU4XLineBreakIteratorLatin1(ICU4XLineBreakIteratorLatin1&&) noexcept = default; - ICU4XLineBreakIteratorLatin1& operator=(ICU4XLineBreakIteratorLatin1&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XLineBreakIteratorLatin1::next() { - return capi::ICU4XLineBreakIteratorLatin1_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.h deleted file mode 100644 index 78ae12c7e4b4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLineBreakIteratorUtf16_H -#define ICU4XLineBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakIteratorUtf16 ICU4XLineBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XLineBreakIteratorUtf16_next(ICU4XLineBreakIteratorUtf16* self); -void ICU4XLineBreakIteratorUtf16_destroy(ICU4XLineBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp deleted file mode 100644 index 4ec04307445e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf16.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef ICU4XLineBreakIteratorUtf16_HPP -#define ICU4XLineBreakIteratorUtf16_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineBreakIteratorUtf16.h" - - -/** - * A destruction policy for using ICU4XLineBreakIteratorUtf16 with std::unique_ptr. - */ -struct ICU4XLineBreakIteratorUtf16Deleter { - void operator()(capi::ICU4XLineBreakIteratorUtf16* l) const noexcept { - capi::ICU4XLineBreakIteratorUtf16_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorUtf16.html) - */ -class ICU4XLineBreakIteratorUtf16 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XLineBreakIteratorUtf16* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLineBreakIteratorUtf16* AsFFIMut() { return this->inner.get(); } - inline ICU4XLineBreakIteratorUtf16(capi::ICU4XLineBreakIteratorUtf16* i) : inner(i) {} - ICU4XLineBreakIteratorUtf16() = default; - ICU4XLineBreakIteratorUtf16(ICU4XLineBreakIteratorUtf16&&) noexcept = default; - ICU4XLineBreakIteratorUtf16& operator=(ICU4XLineBreakIteratorUtf16&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XLineBreakIteratorUtf16::next() { - return capi::ICU4XLineBreakIteratorUtf16_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf8.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf8.h deleted file mode 100644 index 3a08c5ad232b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf8.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLineBreakIteratorUtf8_H -#define ICU4XLineBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakIteratorUtf8 ICU4XLineBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XLineBreakIteratorUtf8_next(ICU4XLineBreakIteratorUtf8* self); -void ICU4XLineBreakIteratorUtf8_destroy(ICU4XLineBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf8.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf8.hpp deleted file mode 100644 index a11467441824..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakIteratorUtf8.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef ICU4XLineBreakIteratorUtf8_HPP -#define ICU4XLineBreakIteratorUtf8_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineBreakIteratorUtf8.h" - - -/** - * A destruction policy for using ICU4XLineBreakIteratorUtf8 with std::unique_ptr. - */ -struct ICU4XLineBreakIteratorUtf8Deleter { - void operator()(capi::ICU4XLineBreakIteratorUtf8* l) const noexcept { - capi::ICU4XLineBreakIteratorUtf8_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `LineBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorPotentiallyIllFormedUtf8.html) - */ -class ICU4XLineBreakIteratorUtf8 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XLineBreakIteratorUtf8* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLineBreakIteratorUtf8* AsFFIMut() { return this->inner.get(); } - inline ICU4XLineBreakIteratorUtf8(capi::ICU4XLineBreakIteratorUtf8* i) : inner(i) {} - ICU4XLineBreakIteratorUtf8() = default; - ICU4XLineBreakIteratorUtf8(ICU4XLineBreakIteratorUtf8&&) noexcept = default; - ICU4XLineBreakIteratorUtf8& operator=(ICU4XLineBreakIteratorUtf8&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XLineBreakIteratorUtf8::next() { - return capi::ICU4XLineBreakIteratorUtf8_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakOptionsV1.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakOptionsV1.h deleted file mode 100644 index 5fbf4b581426..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakOptionsV1.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XLineBreakOptionsV1_H -#define ICU4XLineBreakOptionsV1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XLineBreakStrictness.h" -#include "ICU4XLineBreakWordOption.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineBreakOptionsV1 { - ICU4XLineBreakStrictness strictness; - ICU4XLineBreakWordOption word_option; - bool ja_zh; -} ICU4XLineBreakOptionsV1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLineBreakStrictness.h" -#include "ICU4XLineBreakWordOption.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLineBreakOptionsV1_destroy(ICU4XLineBreakOptionsV1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakOptionsV1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakOptionsV1.hpp deleted file mode 100644 index 345b2380d351..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakOptionsV1.hpp +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XLineBreakOptionsV1_HPP -#define ICU4XLineBreakOptionsV1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineBreakOptionsV1.h" - -#include "ICU4XLineBreakStrictness.hpp" -#include "ICU4XLineBreakWordOption.hpp" - - -/** - * - * - * See the [Rust documentation for `LineBreakOptions`](https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakOptions.html) for more information. - */ -struct ICU4XLineBreakOptionsV1 { - public: - ICU4XLineBreakStrictness strictness; - ICU4XLineBreakWordOption word_option; - bool ja_zh; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakStrictness.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakStrictness.h deleted file mode 100644 index e3534b7ec733..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakStrictness.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XLineBreakStrictness_H -#define ICU4XLineBreakStrictness_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLineBreakStrictness { - ICU4XLineBreakStrictness_Loose = 0, - ICU4XLineBreakStrictness_Normal = 1, - ICU4XLineBreakStrictness_Strict = 2, - ICU4XLineBreakStrictness_Anywhere = 3, -} ICU4XLineBreakStrictness; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLineBreakStrictness_destroy(ICU4XLineBreakStrictness* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakStrictness.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakStrictness.hpp deleted file mode 100644 index 63f169beab3b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakStrictness.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ICU4XLineBreakStrictness_HPP -#define ICU4XLineBreakStrictness_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineBreakStrictness.h" - - - -/** - * - * - * See the [Rust documentation for `LineBreakStrictness`](https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakStrictness.html) for more information. - */ -enum struct ICU4XLineBreakStrictness { - Loose = 0, - Normal = 1, - Strict = 2, - Anywhere = 3, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakWordOption.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakWordOption.h deleted file mode 100644 index 02a6ca6f2d41..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakWordOption.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XLineBreakWordOption_H -#define ICU4XLineBreakWordOption_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLineBreakWordOption { - ICU4XLineBreakWordOption_Normal = 0, - ICU4XLineBreakWordOption_BreakAll = 1, - ICU4XLineBreakWordOption_KeepAll = 2, -} ICU4XLineBreakWordOption; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLineBreakWordOption_destroy(ICU4XLineBreakWordOption* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakWordOption.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakWordOption.hpp deleted file mode 100644 index 8cefca8797b4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineBreakWordOption.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XLineBreakWordOption_HPP -#define ICU4XLineBreakWordOption_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineBreakWordOption.h" - - - -/** - * - * - * See the [Rust documentation for `LineBreakWordOption`](https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakWordOption.html) for more information. - */ -enum struct ICU4XLineBreakWordOption { - Normal = 0, - BreakAll = 1, - KeepAll = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineSegmenter.h b/third_party/rust/icu_capi/cpp/include/ICU4XLineSegmenter.h deleted file mode 100644 index f734ec78f827..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineSegmenter.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef ICU4XLineSegmenter_H -#define ICU4XLineSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLineSegmenter ICU4XLineSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h" -#include "ICU4XLineBreakOptionsV1.h" -#include "ICU4XLineBreakIteratorUtf8.h" -#include "ICU4XLineBreakIteratorUtf16.h" -#include "ICU4XLineBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_auto(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_lstm(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_dictionary(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_auto_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_lstm_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options); - -diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_dictionary_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options); - -ICU4XLineBreakIteratorUtf8* ICU4XLineSegmenter_segment_utf8(const ICU4XLineSegmenter* self, const char* input_data, size_t input_len); - -ICU4XLineBreakIteratorUtf16* ICU4XLineSegmenter_segment_utf16(const ICU4XLineSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XLineBreakIteratorLatin1* ICU4XLineSegmenter_segment_latin1(const ICU4XLineSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XLineSegmenter_destroy(ICU4XLineSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLineSegmenter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLineSegmenter.hpp deleted file mode 100644 index 262aa69a793d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLineSegmenter.hpp +++ /dev/null @@ -1,201 +0,0 @@ -#ifndef ICU4XLineSegmenter_HPP -#define ICU4XLineSegmenter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLineSegmenter.h" - -class ICU4XDataProvider; -class ICU4XLineSegmenter; -#include "ICU4XError.hpp" -struct ICU4XLineBreakOptionsV1; -class ICU4XLineBreakIteratorUtf8; -class ICU4XLineBreakIteratorUtf16; -class ICU4XLineBreakIteratorLatin1; - -/** - * A destruction policy for using ICU4XLineSegmenter with std::unique_ptr. - */ -struct ICU4XLineSegmenterDeleter { - void operator()(capi::ICU4XLineSegmenter* l) const noexcept { - capi::ICU4XLineSegmenter_destroy(l); - } -}; - -/** - * An ICU4X line-break segmenter, capable of finding breakpoints in strings. - * - * See the [Rust documentation for `LineSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html) for more information. - */ -class ICU4XLineSegmenter { - public: - - /** - * Construct a [`ICU4XLineSegmenter`] with default options. It automatically loads the best - * available payload data for Burmese, Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_auto_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_auto_unstable) for more information. - */ - static diplomat::result create_auto(const ICU4XDataProvider& provider); - - /** - * Construct a [`ICU4XLineSegmenter`] with default options and LSTM payload data for - * Burmese, Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_lstm_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_lstm_unstable) for more information. - */ - static diplomat::result create_lstm(const ICU4XDataProvider& provider); - - /** - * Construct a [`ICU4XLineSegmenter`] with default options and dictionary payload data for - * Burmese, Khmer, Lao, and Thai.. - * - * See the [Rust documentation for `try_new_dictionary_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_dictionary_unstable) for more information. - */ - static diplomat::result create_dictionary(const ICU4XDataProvider& provider); - - /** - * Construct a [`ICU4XLineSegmenter`] with custom options. It automatically loads the best - * available payload data for Burmese, Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_auto_with_options_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_auto_with_options_unstable) for more information. - */ - static diplomat::result create_auto_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options); - - /** - * Construct a [`ICU4XLineSegmenter`] with custom options and LSTM payload data for - * Burmese, Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_lstm_with_options_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_lstm_with_options_unstable) for more information. - */ - static diplomat::result create_lstm_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options); - - /** - * Construct a [`ICU4XLineSegmenter`] with custom options and dictionary payload data for - * Burmese, Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_dictionary_with_options_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_dictionary_with_options_unstable) for more information. - */ - static diplomat::result create_dictionary_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options); - - /** - * Segments a (potentially ill-formed) UTF-8 string. - * - * See the [Rust documentation for `segment_utf8`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf8) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XLineBreakIteratorUtf8 segment_utf8(const std::string_view input) const; - - /** - * Segments a UTF-16 string. - * - * See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf16) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XLineBreakIteratorUtf16 segment_utf16(const diplomat::span input) const; - - /** - * Segments a Latin-1 string. - * - * See the [Rust documentation for `segment_latin1`](https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_latin1) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XLineBreakIteratorLatin1 segment_latin1(const diplomat::span input) const; - inline const capi::ICU4XLineSegmenter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLineSegmenter* AsFFIMut() { return this->inner.get(); } - inline ICU4XLineSegmenter(capi::ICU4XLineSegmenter* i) : inner(i) {} - ICU4XLineSegmenter() = default; - ICU4XLineSegmenter(ICU4XLineSegmenter&&) noexcept = default; - ICU4XLineSegmenter& operator=(ICU4XLineSegmenter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLineBreakOptionsV1.hpp" -#include "ICU4XLineBreakIteratorUtf8.hpp" -#include "ICU4XLineBreakIteratorUtf16.hpp" -#include "ICU4XLineBreakIteratorLatin1.hpp" - -inline diplomat::result ICU4XLineSegmenter::create_auto(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_auto(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLineSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLineSegmenter::create_lstm(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_lstm(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLineSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLineSegmenter::create_dictionary(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_dictionary(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLineSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLineSegmenter::create_auto_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options) { - ICU4XLineBreakOptionsV1 diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_auto_with_options_v1(provider.AsFFI(), capi::ICU4XLineBreakOptionsV1{ .strictness = static_cast(diplomat_wrapped_struct_options.strictness), .word_option = static_cast(diplomat_wrapped_struct_options.word_option), .ja_zh = diplomat_wrapped_struct_options.ja_zh }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLineSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLineSegmenter::create_lstm_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options) { - ICU4XLineBreakOptionsV1 diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_lstm_with_options_v1(provider.AsFFI(), capi::ICU4XLineBreakOptionsV1{ .strictness = static_cast(diplomat_wrapped_struct_options.strictness), .word_option = static_cast(diplomat_wrapped_struct_options.word_option), .ja_zh = diplomat_wrapped_struct_options.ja_zh }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLineSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLineSegmenter::create_dictionary_with_options_v1(const ICU4XDataProvider& provider, ICU4XLineBreakOptionsV1 options) { - ICU4XLineBreakOptionsV1 diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XLineSegmenter_create_dictionary_with_options_v1(provider.AsFFI(), capi::ICU4XLineBreakOptionsV1{ .strictness = static_cast(diplomat_wrapped_struct_options.strictness), .word_option = static_cast(diplomat_wrapped_struct_options.word_option), .ja_zh = diplomat_wrapped_struct_options.ja_zh }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLineSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XLineBreakIteratorUtf8 ICU4XLineSegmenter::segment_utf8(const std::string_view input) const { - return ICU4XLineBreakIteratorUtf8(capi::ICU4XLineSegmenter_segment_utf8(this->inner.get(), input.data(), input.size())); -} -inline ICU4XLineBreakIteratorUtf16 ICU4XLineSegmenter::segment_utf16(const diplomat::span input) const { - return ICU4XLineBreakIteratorUtf16(capi::ICU4XLineSegmenter_segment_utf16(this->inner.get(), input.data(), input.size())); -} -inline ICU4XLineBreakIteratorLatin1 ICU4XLineSegmenter::segment_latin1(const diplomat::span input) const { - return ICU4XLineBreakIteratorLatin1(capi::ICU4XLineSegmenter_segment_latin1(this->inner.get(), input.data(), input.size())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XList.h b/third_party/rust/icu_capi/cpp/include/ICU4XList.h deleted file mode 100644 index 6549561c37ba..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XList.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XList_H -#define ICU4XList_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XList ICU4XList; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XList* ICU4XList_create(); - -ICU4XList* ICU4XList_create_with_capacity(size_t capacity); - -void ICU4XList_push(ICU4XList* self, const char* val_data, size_t val_len); - -size_t ICU4XList_len(const ICU4XList* self); -void ICU4XList_destroy(ICU4XList* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XList.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XList.hpp deleted file mode 100644 index e2212c021ad9..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XList.hpp +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef ICU4XList_HPP -#define ICU4XList_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XList.h" - -class ICU4XList; - -/** - * A destruction policy for using ICU4XList with std::unique_ptr. - */ -struct ICU4XListDeleter { - void operator()(capi::ICU4XList* l) const noexcept { - capi::ICU4XList_destroy(l); - } -}; - -/** - * A list of strings - */ -class ICU4XList { - public: - - /** - * Create a new list of strings - */ - static ICU4XList create(); - - /** - * Create a new list of strings with preallocated space to hold - * at least `capacity` elements - */ - static ICU4XList create_with_capacity(size_t capacity); - - /** - * Push a string to the list - * - * For C++ users, potentially invalid UTF8 will be handled via - * REPLACEMENT CHARACTERs - */ - void push(const std::string_view val); - - /** - * The number of elements in this list - */ - size_t len() const; - inline const capi::ICU4XList* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XList* AsFFIMut() { return this->inner.get(); } - inline ICU4XList(capi::ICU4XList* i) : inner(i) {} - ICU4XList() = default; - ICU4XList(ICU4XList&&) noexcept = default; - ICU4XList& operator=(ICU4XList&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline ICU4XList ICU4XList::create() { - return ICU4XList(capi::ICU4XList_create()); -} -inline ICU4XList ICU4XList::create_with_capacity(size_t capacity) { - return ICU4XList(capi::ICU4XList_create_with_capacity(capacity)); -} -inline void ICU4XList::push(const std::string_view val) { - capi::ICU4XList_push(this->inner.get(), val.data(), val.size()); -} -inline size_t ICU4XList::len() const { - return capi::ICU4XList_len(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XListFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XListFormatter.h deleted file mode 100644 index ee358dc254cc..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XListFormatter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XListFormatter_H -#define ICU4XListFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XListFormatter ICU4XListFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XListLength.h" -#include "diplomat_result_box_ICU4XListFormatter_ICU4XError.h" -#include "ICU4XList.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_and_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length); - -diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_or_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length); - -diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_unit_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length); - -diplomat_result_void_ICU4XError ICU4XListFormatter_format(const ICU4XListFormatter* self, const ICU4XList* list, DiplomatWriteable* write); -void ICU4XListFormatter_destroy(ICU4XListFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XListFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XListFormatter.hpp deleted file mode 100644 index 463f7d14d34c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XListFormatter.hpp +++ /dev/null @@ -1,139 +0,0 @@ -#ifndef ICU4XListFormatter_HPP -#define ICU4XListFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XListFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XListLength.hpp" -class ICU4XListFormatter; -#include "ICU4XError.hpp" -class ICU4XList; - -/** - * A destruction policy for using ICU4XListFormatter with std::unique_ptr. - */ -struct ICU4XListFormatterDeleter { - void operator()(capi::ICU4XListFormatter* l) const noexcept { - capi::ICU4XListFormatter_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `ListFormatter`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html) for more information. - */ -class ICU4XListFormatter { - public: - - /** - * Construct a new ICU4XListFormatter instance for And patterns - * - * See the [Rust documentation for `try_new_and_with_length_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.try_new_and_with_length_unstable) for more information. - */ - static diplomat::result create_and_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XListLength length); - - /** - * Construct a new ICU4XListFormatter instance for And patterns - * - * See the [Rust documentation for `try_new_or_with_length_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.try_new_or_with_length_unstable) for more information. - */ - static diplomat::result create_or_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XListLength length); - - /** - * Construct a new ICU4XListFormatter instance for And patterns - * - * See the [Rust documentation for `try_new_unit_with_length_unstable`](https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.try_new_unit_with_length_unstable) for more information. - */ - static diplomat::result create_unit_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XListLength length); - - /** - * - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.format) for more information. - */ - template diplomat::result format_to_writeable(const ICU4XList& list, W& write) const; - - /** - * - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.format) for more information. - */ - diplomat::result format(const ICU4XList& list) const; - inline const capi::ICU4XListFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XListFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XListFormatter(capi::ICU4XListFormatter* i) : inner(i) {} - ICU4XListFormatter() = default; - ICU4XListFormatter(ICU4XListFormatter&&) noexcept = default; - ICU4XListFormatter& operator=(ICU4XListFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XList.hpp" - -inline diplomat::result ICU4XListFormatter::create_and_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XListLength length) { - auto diplomat_result_raw_out_value = capi::ICU4XListFormatter_create_and_with_length(provider.AsFFI(), locale.AsFFI(), static_cast(length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XListFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XListFormatter::create_or_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XListLength length) { - auto diplomat_result_raw_out_value = capi::ICU4XListFormatter_create_or_with_length(provider.AsFFI(), locale.AsFFI(), static_cast(length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XListFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XListFormatter::create_unit_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XListLength length) { - auto diplomat_result_raw_out_value = capi::ICU4XListFormatter_create_unit_with_length(provider.AsFFI(), locale.AsFFI(), static_cast(length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XListFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XListFormatter::format_to_writeable(const ICU4XList& list, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XListFormatter_format(this->inner.get(), list.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XListFormatter::format(const ICU4XList& list) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XListFormatter_format(this->inner.get(), list.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XListLength.h b/third_party/rust/icu_capi/cpp/include/ICU4XListLength.h deleted file mode 100644 index 7092f6d9dfd7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XListLength.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XListLength_H -#define ICU4XListLength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XListLength { - ICU4XListLength_Wide = 0, - ICU4XListLength_Short = 1, - ICU4XListLength_Narrow = 2, -} ICU4XListLength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XListLength_destroy(ICU4XListLength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XListLength.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XListLength.hpp deleted file mode 100644 index 19fcc5d64c29..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XListLength.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XListLength_HPP -#define ICU4XListLength_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XListLength.h" - - - -/** - * - * - * See the [Rust documentation for `ListLength`](https://docs.rs/icu/latest/icu/list/enum.ListLength.html) for more information. - */ -enum struct ICU4XListLength { - Wide = 0, - Short = 1, - Narrow = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocale.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocale.h deleted file mode 100644 index dea8d196b5cd..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocale.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef ICU4XLocale_H -#define ICU4XLocale_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocale ICU4XLocale; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XLocale_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XOrdering.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocale_ICU4XError ICU4XLocale_create_from_string(const char* name_data, size_t name_len); - -ICU4XLocale* ICU4XLocale_create_und(); - -ICU4XLocale* ICU4XLocale_clone(const ICU4XLocale* self); - -diplomat_result_void_ICU4XError ICU4XLocale_basename(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_get_unicode_extension(const ICU4XLocale* self, const char* bytes_data, size_t bytes_len, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_language(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_set_language(ICU4XLocale* self, const char* bytes_data, size_t bytes_len); - -diplomat_result_void_ICU4XError ICU4XLocale_region(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_set_region(ICU4XLocale* self, const char* bytes_data, size_t bytes_len); - -diplomat_result_void_ICU4XError ICU4XLocale_script(const ICU4XLocale* self, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_set_script(ICU4XLocale* self, const char* bytes_data, size_t bytes_len); - -diplomat_result_void_ICU4XError ICU4XLocale_canonicalize(const char* bytes_data, size_t bytes_len, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XLocale_to_string(const ICU4XLocale* self, DiplomatWriteable* write); - -bool ICU4XLocale_normalizing_eq(const ICU4XLocale* self, const char* other_data, size_t other_len); - -ICU4XOrdering ICU4XLocale_strict_cmp(const ICU4XLocale* self, const char* other_data, size_t other_len); - -ICU4XLocale* ICU4XLocale_create_en(); - -ICU4XLocale* ICU4XLocale_create_bn(); -void ICU4XLocale_destroy(ICU4XLocale* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocale.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocale.hpp deleted file mode 100644 index cae7cc2dfe84..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocale.hpp +++ /dev/null @@ -1,444 +0,0 @@ -#ifndef ICU4XLocale_HPP -#define ICU4XLocale_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocale.h" - -class ICU4XLocale; -#include "ICU4XError.hpp" -#include "ICU4XOrdering.hpp" - -/** - * A destruction policy for using ICU4XLocale with std::unique_ptr. - */ -struct ICU4XLocaleDeleter { - void operator()(capi::ICU4XLocale* l) const noexcept { - capi::ICU4XLocale_destroy(l); - } -}; - -/** - * An ICU4X Locale, capable of representing strings like `"en-US"`. - * - * See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information. - */ -class ICU4XLocale { - public: - - /** - * Construct an [`ICU4XLocale`] from an locale identifier. - * - * This will run the complete locale parsing algorithm. If code size and - * performance are critical and the locale is of a known shape (such as - * `aa-BB`) use `create_und`, `set_language`, `set_script`, and `set_region`. - * - * See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. - */ - static diplomat::result create_from_string(const std::string_view name); - - /** - * Construct a default undefined [`ICU4XLocale`] "und". - * - * See the [Rust documentation for `UND`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#associatedconstant.UND) for more information. - */ - static ICU4XLocale create_und(); - - /** - * Clones the [`ICU4XLocale`]. - * - * See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information. - */ - ICU4XLocale clone() const; - - /** - * Write a string representation of the `LanguageIdentifier` part of - * [`ICU4XLocale`] to `write`. - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - template diplomat::result basename_to_writeable(W& write) const; - - /** - * Write a string representation of the `LanguageIdentifier` part of - * [`ICU4XLocale`] to `write`. - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - diplomat::result basename() const; - - /** - * Write a string representation of the unicode extension to `write` - * - * See the [Rust documentation for `extensions`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.extensions) for more information. - */ - template diplomat::result get_unicode_extension_to_writeable(const std::string_view bytes, W& write) const; - - /** - * Write a string representation of the unicode extension to `write` - * - * See the [Rust documentation for `extensions`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.extensions) for more information. - */ - diplomat::result get_unicode_extension(const std::string_view bytes) const; - - /** - * Write a string representation of [`ICU4XLocale`] language to `write` - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - template diplomat::result language_to_writeable(W& write) const; - - /** - * Write a string representation of [`ICU4XLocale`] language to `write` - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - diplomat::result language() const; - - /** - * Set the language part of the [`ICU4XLocale`]. - * - * See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. - */ - diplomat::result set_language(const std::string_view bytes); - - /** - * Write a string representation of [`ICU4XLocale`] region to `write` - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - template diplomat::result region_to_writeable(W& write) const; - - /** - * Write a string representation of [`ICU4XLocale`] region to `write` - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - diplomat::result region() const; - - /** - * Set the region part of the [`ICU4XLocale`]. - * - * See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. - */ - diplomat::result set_region(const std::string_view bytes); - - /** - * Write a string representation of [`ICU4XLocale`] script to `write` - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - template diplomat::result script_to_writeable(W& write) const; - - /** - * Write a string representation of [`ICU4XLocale`] script to `write` - * - * See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. - */ - diplomat::result script() const; - - /** - * Set the script part of the [`ICU4XLocale`]. Pass an empty string to remove the script. - * - * See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. - */ - diplomat::result set_script(const std::string_view bytes); - - /** - * Best effort locale canonicalizer that doesn't need any data - * - * Use ICU4XLocaleCanonicalizer for better control and functionality - * - * See the [Rust documentation for `canonicalize`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.canonicalize) for more information. - */ - template static diplomat::result canonicalize_to_writeable(const std::string_view bytes, W& write); - - /** - * Best effort locale canonicalizer that doesn't need any data - * - * Use ICU4XLocaleCanonicalizer for better control and functionality - * - * See the [Rust documentation for `canonicalize`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.canonicalize) for more information. - */ - static diplomat::result canonicalize(const std::string_view bytes); - - /** - * Write a string representation of [`ICU4XLocale`] to `write` - * - * See the [Rust documentation for `write_to`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.write_to) for more information. - */ - template diplomat::result to_string_to_writeable(W& write) const; - - /** - * Write a string representation of [`ICU4XLocale`] to `write` - * - * See the [Rust documentation for `write_to`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.write_to) for more information. - */ - diplomat::result to_string() const; - - /** - * - * - * See the [Rust documentation for `normalizing_eq`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.normalizing_eq) for more information. - */ - bool normalizing_eq(const std::string_view other) const; - - /** - * - * - * See the [Rust documentation for `strict_cmp`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.strict_cmp) for more information. - */ - ICU4XOrdering strict_cmp(const std::string_view other) const; - - /** - * Construct an [`ICU4XLocale`] for the English language. - * - * This convenience constructor is intended for testing only - * and requires the `provider_test` feature. - */ - static ICU4XLocale create_en(); - - /** - * Construct an [`ICU4XLocale`] for the Bangla language. - * - * This convenience constructor is intended for testing only - * and requires the `provider_test` feature. - */ - static ICU4XLocale create_bn(); - inline const capi::ICU4XLocale* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocale* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocale(capi::ICU4XLocale* i) : inner(i) {} - ICU4XLocale() = default; - ICU4XLocale(ICU4XLocale&&) noexcept = default; - ICU4XLocale& operator=(ICU4XLocale&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline diplomat::result ICU4XLocale::create_from_string(const std::string_view name) { - auto diplomat_result_raw_out_value = capi::ICU4XLocale_create_from_string(name.data(), name.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocale(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XLocale ICU4XLocale::create_und() { - return ICU4XLocale(capi::ICU4XLocale_create_und()); -} -inline ICU4XLocale ICU4XLocale::clone() const { - return ICU4XLocale(capi::ICU4XLocale_clone(this->inner.get())); -} -template inline diplomat::result ICU4XLocale::basename_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_basename(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::basename() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_basename(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XLocale::get_unicode_extension_to_writeable(const std::string_view bytes, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_get_unicode_extension(this->inner.get(), bytes.data(), bytes.size(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::get_unicode_extension(const std::string_view bytes) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_get_unicode_extension(this->inner.get(), bytes.data(), bytes.size(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XLocale::language_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_language(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::language() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_language(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline diplomat::result ICU4XLocale::set_language(const std::string_view bytes) { - auto diplomat_result_raw_out_value = capi::ICU4XLocale_set_language(this->inner.get(), bytes.data(), bytes.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XLocale::region_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_region(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::region() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_region(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline diplomat::result ICU4XLocale::set_region(const std::string_view bytes) { - auto diplomat_result_raw_out_value = capi::ICU4XLocale_set_region(this->inner.get(), bytes.data(), bytes.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XLocale::script_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_script(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::script() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_script(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline diplomat::result ICU4XLocale::set_script(const std::string_view bytes) { - auto diplomat_result_raw_out_value = capi::ICU4XLocale_set_script(this->inner.get(), bytes.data(), bytes.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XLocale::canonicalize_to_writeable(const std::string_view bytes, W& write) { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_canonicalize(bytes.data(), bytes.size(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::canonicalize(const std::string_view bytes) { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_canonicalize(bytes.data(), bytes.size(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XLocale::to_string_to_writeable(W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_to_string(this->inner.get(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocale::to_string() const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocale_to_string(this->inner.get(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -inline bool ICU4XLocale::normalizing_eq(const std::string_view other) const { - return capi::ICU4XLocale_normalizing_eq(this->inner.get(), other.data(), other.size()); -} -inline ICU4XOrdering ICU4XLocale::strict_cmp(const std::string_view other) const { - return static_cast(capi::ICU4XLocale_strict_cmp(this->inner.get(), other.data(), other.size())); -} -inline ICU4XLocale ICU4XLocale::create_en() { - return ICU4XLocale(capi::ICU4XLocale_create_en()); -} -inline ICU4XLocale ICU4XLocale::create_bn() { - return ICU4XLocale(capi::ICU4XLocale_create_bn()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleCanonicalizer.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleCanonicalizer.h deleted file mode 100644 index 8b48ad8bb602..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleCanonicalizer.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XLocaleCanonicalizer_H -#define ICU4XLocaleCanonicalizer_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleCanonicalizer ICU4XLocaleCanonicalizer; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h" -#include "ICU4XLocale.h" -#include "ICU4XTransformResult.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError ICU4XLocaleCanonicalizer_create(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError ICU4XLocaleCanonicalizer_create_extended(const ICU4XDataProvider* provider); - -ICU4XTransformResult ICU4XLocaleCanonicalizer_canonicalize(const ICU4XLocaleCanonicalizer* self, ICU4XLocale* locale); -void ICU4XLocaleCanonicalizer_destroy(ICU4XLocaleCanonicalizer* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleCanonicalizer.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleCanonicalizer.hpp deleted file mode 100644 index 2508a9219a93..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleCanonicalizer.hpp +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef ICU4XLocaleCanonicalizer_HPP -#define ICU4XLocaleCanonicalizer_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleCanonicalizer.h" - -class ICU4XDataProvider; -class ICU4XLocaleCanonicalizer; -#include "ICU4XError.hpp" -class ICU4XLocale; -#include "ICU4XTransformResult.hpp" - -/** - * A destruction policy for using ICU4XLocaleCanonicalizer with std::unique_ptr. - */ -struct ICU4XLocaleCanonicalizerDeleter { - void operator()(capi::ICU4XLocaleCanonicalizer* l) const noexcept { - capi::ICU4XLocaleCanonicalizer_destroy(l); - } -}; - -/** - * A locale canonicalizer. - * - * See the [Rust documentation for `LocaleCanonicalizer`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html) for more information. - */ -class ICU4XLocaleCanonicalizer { - public: - - /** - * Create a new [`ICU4XLocaleCanonicalizer`]. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Create a new [`ICU4XLocaleCanonicalizer`] with extended data. - * - * See the [Rust documentation for `try_new_with_expander_unstable`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.try_new_with_expander_unstable) for more information. - */ - static diplomat::result create_extended(const ICU4XDataProvider& provider); - - /** - * FFI version of `LocaleCanonicalizer::canonicalize()`. - * - * See the [Rust documentation for `canonicalize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.canonicalize) for more information. - */ - ICU4XTransformResult canonicalize(ICU4XLocale& locale) const; - inline const capi::ICU4XLocaleCanonicalizer* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocaleCanonicalizer* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocaleCanonicalizer(capi::ICU4XLocaleCanonicalizer* i) : inner(i) {} - ICU4XLocaleCanonicalizer() = default; - ICU4XLocaleCanonicalizer(ICU4XLocaleCanonicalizer&&) noexcept = default; - ICU4XLocaleCanonicalizer& operator=(ICU4XLocaleCanonicalizer&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" - -inline diplomat::result ICU4XLocaleCanonicalizer::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLocaleCanonicalizer_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleCanonicalizer(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocaleCanonicalizer::create_extended(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLocaleCanonicalizer_create_extended(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleCanonicalizer(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XTransformResult ICU4XLocaleCanonicalizer::canonicalize(ICU4XLocale& locale) const { - return static_cast(capi::ICU4XLocaleCanonicalizer_canonicalize(this->inner.get(), locale.AsFFIMut())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleDisplayNamesFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleDisplayNamesFormatter.h deleted file mode 100644 index 0e164017f485..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleDisplayNamesFormatter.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ICU4XLocaleDisplayNamesFormatter_H -#define ICU4XLocaleDisplayNamesFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleDisplayNamesFormatter ICU4XLocaleDisplayNamesFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDisplayNamesOptionsV1.h" -#include "diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError ICU4XLocaleDisplayNamesFormatter_try_new_unstable(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDisplayNamesOptionsV1 options); - -diplomat_result_void_ICU4XError ICU4XLocaleDisplayNamesFormatter_of(const ICU4XLocaleDisplayNamesFormatter* self, const ICU4XLocale* locale, DiplomatWriteable* write); -void ICU4XLocaleDisplayNamesFormatter_destroy(ICU4XLocaleDisplayNamesFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleDisplayNamesFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleDisplayNamesFormatter.hpp deleted file mode 100644 index b57493da212c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleDisplayNamesFormatter.hpp +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef ICU4XLocaleDisplayNamesFormatter_HPP -#define ICU4XLocaleDisplayNamesFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleDisplayNamesFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -struct ICU4XDisplayNamesOptionsV1; -class ICU4XLocaleDisplayNamesFormatter; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XLocaleDisplayNamesFormatter with std::unique_ptr. - */ -struct ICU4XLocaleDisplayNamesFormatterDeleter { - void operator()(capi::ICU4XLocaleDisplayNamesFormatter* l) const noexcept { - capi::ICU4XLocaleDisplayNamesFormatter_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `LocaleDisplayNamesFormatter`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html) for more information. - */ -class ICU4XLocaleDisplayNamesFormatter { - public: - - /** - * Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result try_new_unstable(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDisplayNamesOptionsV1 options); - - /** - * Returns the locale-specific display name of a locale. - * - * See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.of) for more information. - */ - template diplomat::result of_to_writeable(const ICU4XLocale& locale, W& write) const; - - /** - * Returns the locale-specific display name of a locale. - * - * See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.of) for more information. - */ - diplomat::result of(const ICU4XLocale& locale) const; - inline const capi::ICU4XLocaleDisplayNamesFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocaleDisplayNamesFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocaleDisplayNamesFormatter(capi::ICU4XLocaleDisplayNamesFormatter* i) : inner(i) {} - ICU4XLocaleDisplayNamesFormatter() = default; - ICU4XLocaleDisplayNamesFormatter(ICU4XLocaleDisplayNamesFormatter&&) noexcept = default; - ICU4XLocaleDisplayNamesFormatter& operator=(ICU4XLocaleDisplayNamesFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XDisplayNamesOptionsV1.hpp" - -inline diplomat::result ICU4XLocaleDisplayNamesFormatter::try_new_unstable(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDisplayNamesOptionsV1 options) { - ICU4XDisplayNamesOptionsV1 diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XLocaleDisplayNamesFormatter_try_new_unstable(provider.AsFFI(), locale.AsFFI(), capi::ICU4XDisplayNamesOptionsV1{ .style = static_cast(diplomat_wrapped_struct_options.style), .fallback = static_cast(diplomat_wrapped_struct_options.fallback), .language_display = static_cast(diplomat_wrapped_struct_options.language_display) }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleDisplayNamesFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XLocaleDisplayNamesFormatter::of_to_writeable(const ICU4XLocale& locale, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XLocaleDisplayNamesFormatter_of(this->inner.get(), locale.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocaleDisplayNamesFormatter::of(const ICU4XLocale& locale) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XLocaleDisplayNamesFormatter_of(this->inner.get(), locale.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleExpander.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleExpander.h deleted file mode 100644 index a7de7be16b91..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleExpander.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef ICU4XLocaleExpander_H -#define ICU4XLocaleExpander_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleExpander ICU4XLocaleExpander; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h" -#include "ICU4XLocale.h" -#include "ICU4XTransformResult.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleExpander_ICU4XError ICU4XLocaleExpander_create(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XLocaleExpander_ICU4XError ICU4XLocaleExpander_create_extended(const ICU4XDataProvider* provider); - -ICU4XTransformResult ICU4XLocaleExpander_maximize(const ICU4XLocaleExpander* self, ICU4XLocale* locale); - -ICU4XTransformResult ICU4XLocaleExpander_minimize(const ICU4XLocaleExpander* self, ICU4XLocale* locale); -void ICU4XLocaleExpander_destroy(ICU4XLocaleExpander* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleExpander.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleExpander.hpp deleted file mode 100644 index 37b6fce71ab9..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleExpander.hpp +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef ICU4XLocaleExpander_HPP -#define ICU4XLocaleExpander_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleExpander.h" - -class ICU4XDataProvider; -class ICU4XLocaleExpander; -#include "ICU4XError.hpp" -class ICU4XLocale; -#include "ICU4XTransformResult.hpp" - -/** - * A destruction policy for using ICU4XLocaleExpander with std::unique_ptr. - */ -struct ICU4XLocaleExpanderDeleter { - void operator()(capi::ICU4XLocaleExpander* l) const noexcept { - capi::ICU4XLocaleExpander_destroy(l); - } -}; - -/** - * A locale expander. - * - * See the [Rust documentation for `LocaleExpander`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html) for more information. - */ -class ICU4XLocaleExpander { - public: - - /** - * Create a new [`ICU4XLocaleExpander`]. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Create a new [`ICU4XLocaleExpander`] with extended data. - * - * See the [Rust documentation for `try_new_extended_unstable`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.try_new_extended_unstable) for more information. - */ - static diplomat::result create_extended(const ICU4XDataProvider& provider); - - /** - * FFI version of `LocaleExpander::maximize()`. - * - * See the [Rust documentation for `maximize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.maximize) for more information. - */ - ICU4XTransformResult maximize(ICU4XLocale& locale) const; - - /** - * FFI version of `LocaleExpander::minimize()`. - * - * See the [Rust documentation for `minimize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.minimize) for more information. - */ - ICU4XTransformResult minimize(ICU4XLocale& locale) const; - inline const capi::ICU4XLocaleExpander* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocaleExpander* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocaleExpander(capi::ICU4XLocaleExpander* i) : inner(i) {} - ICU4XLocaleExpander() = default; - ICU4XLocaleExpander(ICU4XLocaleExpander&&) noexcept = default; - ICU4XLocaleExpander& operator=(ICU4XLocaleExpander&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" - -inline diplomat::result ICU4XLocaleExpander::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLocaleExpander_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleExpander(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XLocaleExpander::create_extended(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLocaleExpander_create_extended(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleExpander(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XTransformResult ICU4XLocaleExpander::maximize(ICU4XLocale& locale) const { - return static_cast(capi::ICU4XLocaleExpander_maximize(this->inner.get(), locale.AsFFIMut())); -} -inline ICU4XTransformResult ICU4XLocaleExpander::minimize(ICU4XLocale& locale) const { - return static_cast(capi::ICU4XLocaleExpander_minimize(this->inner.get(), locale.AsFFIMut())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackConfig.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackConfig.h deleted file mode 100644 index b3741e6bf0f5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackConfig.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XLocaleFallbackConfig_H -#define ICU4XLocaleFallbackConfig_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XLocaleFallbackPriority.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbackConfig { - ICU4XLocaleFallbackPriority priority; - DiplomatStringView extension_key; -} ICU4XLocaleFallbackConfig; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocaleFallbackPriority.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLocaleFallbackConfig_destroy(ICU4XLocaleFallbackConfig* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackConfig.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackConfig.hpp deleted file mode 100644 index fc137c1335e3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackConfig.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XLocaleFallbackConfig_HPP -#define ICU4XLocaleFallbackConfig_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleFallbackConfig.h" - -#include "ICU4XLocaleFallbackPriority.hpp" - - -/** - * Collection of configurations for the ICU4X fallback algorithm. - * - * See the [Rust documentation for `LocaleFallbackConfig`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackConfig.html) for more information. - */ -struct ICU4XLocaleFallbackConfig { - public: - - /** - * Choice of priority mode. - */ - ICU4XLocaleFallbackPriority priority; - - /** - * An empty string is considered `None`. - */ - std::string_view extension_key; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.h deleted file mode 100644 index e2dd7a1a3bab..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XLocaleFallbackIterator_H -#define ICU4XLocaleFallbackIterator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbackIterator ICU4XLocaleFallbackIterator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocale.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XLocale* ICU4XLocaleFallbackIterator_get(const ICU4XLocaleFallbackIterator* self); - -void ICU4XLocaleFallbackIterator_step(ICU4XLocaleFallbackIterator* self); -void ICU4XLocaleFallbackIterator_destroy(ICU4XLocaleFallbackIterator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp deleted file mode 100644 index bd44d40a94db..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackIterator.hpp +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef ICU4XLocaleFallbackIterator_HPP -#define ICU4XLocaleFallbackIterator_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleFallbackIterator.h" - -class ICU4XLocale; - -/** - * A destruction policy for using ICU4XLocaleFallbackIterator with std::unique_ptr. - */ -struct ICU4XLocaleFallbackIteratorDeleter { - void operator()(capi::ICU4XLocaleFallbackIterator* l) const noexcept { - capi::ICU4XLocaleFallbackIterator_destroy(l); - } -}; - -/** - * An iterator over the locale under fallback. - * - * See the [Rust documentation for `LocaleFallbackIterator`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackIterator.html) for more information. - */ -class ICU4XLocaleFallbackIterator { - public: - - /** - * Gets a snapshot of the current state of the locale. - * - * See the [Rust documentation for `get`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackIterator.html#method.get) for more information. - */ - ICU4XLocale get() const; - - /** - * Performs one step of the fallback algorithm, mutating the locale. - * - * See the [Rust documentation for `step`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackIterator.html#method.step) for more information. - */ - void step(); - inline const capi::ICU4XLocaleFallbackIterator* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocaleFallbackIterator* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocaleFallbackIterator(capi::ICU4XLocaleFallbackIterator* i) : inner(i) {} - ICU4XLocaleFallbackIterator() = default; - ICU4XLocaleFallbackIterator(ICU4XLocaleFallbackIterator&&) noexcept = default; - ICU4XLocaleFallbackIterator& operator=(ICU4XLocaleFallbackIterator&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XLocale.hpp" - -inline ICU4XLocale ICU4XLocaleFallbackIterator::get() const { - return ICU4XLocale(capi::ICU4XLocaleFallbackIterator_get(this->inner.get())); -} -inline void ICU4XLocaleFallbackIterator::step() { - capi::ICU4XLocaleFallbackIterator_step(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackPriority.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackPriority.h deleted file mode 100644 index e4ab748065c8..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackPriority.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XLocaleFallbackPriority_H -#define ICU4XLocaleFallbackPriority_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XLocaleFallbackPriority { - ICU4XLocaleFallbackPriority_Language = 0, - ICU4XLocaleFallbackPriority_Region = 1, - ICU4XLocaleFallbackPriority_Collation = 2, -} ICU4XLocaleFallbackPriority; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XLocaleFallbackPriority_destroy(ICU4XLocaleFallbackPriority* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackPriority.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackPriority.hpp deleted file mode 100644 index 5350a6697345..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackPriority.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XLocaleFallbackPriority_HPP -#define ICU4XLocaleFallbackPriority_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleFallbackPriority.h" - - - -/** - * Priority mode for the ICU4X fallback algorithm. - * - * See the [Rust documentation for `FallbackPriority`](https://docs.rs/icu_provider/latest/icu_provider/enum.FallbackPriority.html) for more information. - */ -enum struct ICU4XLocaleFallbackPriority { - Language = 0, - Region = 1, - Collation = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbacker.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbacker.h deleted file mode 100644 index 24efb0602f66..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbacker.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XLocaleFallbacker_H -#define ICU4XLocaleFallbacker_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbacker ICU4XLocaleFallbacker; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h" -#include "ICU4XLocaleFallbackConfig.h" -#include "diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError ICU4XLocaleFallbacker_create(const ICU4XDataProvider* provider); - -ICU4XLocaleFallbacker* ICU4XLocaleFallbacker_create_without_data(); - -diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError ICU4XLocaleFallbacker_for_config(const ICU4XLocaleFallbacker* self, ICU4XLocaleFallbackConfig config); -void ICU4XLocaleFallbacker_destroy(ICU4XLocaleFallbacker* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp deleted file mode 100644 index 1338622fc3d9..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbacker.hpp +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef ICU4XLocaleFallbacker_HPP -#define ICU4XLocaleFallbacker_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleFallbacker.h" - -class ICU4XDataProvider; -class ICU4XLocaleFallbacker; -#include "ICU4XError.hpp" -struct ICU4XLocaleFallbackConfig; -class ICU4XLocaleFallbackerWithConfig; - -/** - * A destruction policy for using ICU4XLocaleFallbacker with std::unique_ptr. - */ -struct ICU4XLocaleFallbackerDeleter { - void operator()(capi::ICU4XLocaleFallbacker* l) const noexcept { - capi::ICU4XLocaleFallbacker_destroy(l); - } -}; - -/** - * An object that runs the ICU4X locale fallback algorithm. - * - * See the [Rust documentation for `LocaleFallbacker`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html) for more information. - */ -class ICU4XLocaleFallbacker { - public: - - /** - * Creates a new `ICU4XLocaleFallbacker` from a data provider. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Creates a new `ICU4XLocaleFallbacker` without data for limited functionality. - * - * See the [Rust documentation for `new_without_data`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html#method.new_without_data) for more information. - */ - static ICU4XLocaleFallbacker create_without_data(); - - /** - * Associates this `ICU4XLocaleFallbacker` with configuration options. - * - * See the [Rust documentation for `for_config`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html#method.for_config) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - diplomat::result for_config(ICU4XLocaleFallbackConfig config) const; - inline const capi::ICU4XLocaleFallbacker* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocaleFallbacker* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocaleFallbacker(capi::ICU4XLocaleFallbacker* i) : inner(i) {} - ICU4XLocaleFallbacker() = default; - ICU4XLocaleFallbacker(ICU4XLocaleFallbacker&&) noexcept = default; - ICU4XLocaleFallbacker& operator=(ICU4XLocaleFallbacker&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocaleFallbackConfig.hpp" -#include "ICU4XLocaleFallbackerWithConfig.hpp" - -inline diplomat::result ICU4XLocaleFallbacker::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XLocaleFallbacker_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleFallbacker(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XLocaleFallbacker ICU4XLocaleFallbacker::create_without_data() { - return ICU4XLocaleFallbacker(capi::ICU4XLocaleFallbacker_create_without_data()); -} -inline diplomat::result ICU4XLocaleFallbacker::for_config(ICU4XLocaleFallbackConfig config) const { - ICU4XLocaleFallbackConfig diplomat_wrapped_struct_config = config; - auto diplomat_result_raw_out_value = capi::ICU4XLocaleFallbacker_for_config(this->inner.get(), capi::ICU4XLocaleFallbackConfig{ .priority = static_cast(diplomat_wrapped_struct_config.priority), .extension_key = { diplomat_wrapped_struct_config.extension_key.data(), diplomat_wrapped_struct_config.extension_key.size() } }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XLocaleFallbackerWithConfig(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.h b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.h deleted file mode 100644 index e8baa9563e86..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XLocaleFallbackerWithConfig_H -#define ICU4XLocaleFallbackerWithConfig_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLocaleFallbackerWithConfig ICU4XLocaleFallbackerWithConfig; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XLocale.h" -#include "ICU4XLocaleFallbackIterator.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -ICU4XLocaleFallbackIterator* ICU4XLocaleFallbackerWithConfig_fallback_for_locale(const ICU4XLocaleFallbackerWithConfig* self, const ICU4XLocale* locale); -void ICU4XLocaleFallbackerWithConfig_destroy(ICU4XLocaleFallbackerWithConfig* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp deleted file mode 100644 index e885a806bb9b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLocaleFallbackerWithConfig.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef ICU4XLocaleFallbackerWithConfig_HPP -#define ICU4XLocaleFallbackerWithConfig_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLocaleFallbackerWithConfig.h" - -class ICU4XLocale; -class ICU4XLocaleFallbackIterator; - -/** - * A destruction policy for using ICU4XLocaleFallbackerWithConfig with std::unique_ptr. - */ -struct ICU4XLocaleFallbackerWithConfigDeleter { - void operator()(capi::ICU4XLocaleFallbackerWithConfig* l) const noexcept { - capi::ICU4XLocaleFallbackerWithConfig_destroy(l); - } -}; - -/** - * An object that runs the ICU4X locale fallback algorithm with specific configurations. - * - * See the [Rust documentation for `LocaleFallbackerWithConfig`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackerWithConfig.html) for more information. - */ -class ICU4XLocaleFallbackerWithConfig { - public: - - /** - * Creates an iterator from a locale with each step of fallback. - * - * See the [Rust documentation for `fallback_for`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackerWithConfig.html#method.fallback_for) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - ICU4XLocaleFallbackIterator fallback_for_locale(const ICU4XLocale& locale) const; - inline const capi::ICU4XLocaleFallbackerWithConfig* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLocaleFallbackerWithConfig* AsFFIMut() { return this->inner.get(); } - inline ICU4XLocaleFallbackerWithConfig(capi::ICU4XLocaleFallbackerWithConfig* i) : inner(i) {} - ICU4XLocaleFallbackerWithConfig() = default; - ICU4XLocaleFallbackerWithConfig(ICU4XLocaleFallbackerWithConfig&&) noexcept = default; - ICU4XLocaleFallbackerWithConfig& operator=(ICU4XLocaleFallbackerWithConfig&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XLocale.hpp" -#include "ICU4XLocaleFallbackIterator.hpp" - -inline ICU4XLocaleFallbackIterator ICU4XLocaleFallbackerWithConfig::fallback_for_locale(const ICU4XLocale& locale) const { - return ICU4XLocaleFallbackIterator(capi::ICU4XLocaleFallbackerWithConfig_fallback_for_locale(this->inner.get(), locale.AsFFI())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLogger.h b/third_party/rust/icu_capi/cpp/include/ICU4XLogger.h deleted file mode 100644 index 3c3a1b8fa321..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLogger.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XLogger_H -#define ICU4XLogger_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XLogger ICU4XLogger; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XLogger_init_simple_logger(); -void ICU4XLogger_destroy(ICU4XLogger* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XLogger.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XLogger.hpp deleted file mode 100644 index 0b894059c215..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XLogger.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ICU4XLogger_HPP -#define ICU4XLogger_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XLogger.h" - - -/** - * A destruction policy for using ICU4XLogger with std::unique_ptr. - */ -struct ICU4XLoggerDeleter { - void operator()(capi::ICU4XLogger* l) const noexcept { - capi::ICU4XLogger_destroy(l); - } -}; - -/** - * An object allowing control over the logging used - */ -class ICU4XLogger { - public: - - /** - * Initialize the logger from the `simple_logger` crate, which simply logs to - * stdout. Returns `false` if there was already a logger set, or if logging has not been - * compiled into the platform - */ - static bool init_simple_logger(); - inline const capi::ICU4XLogger* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XLogger* AsFFIMut() { return this->inner.get(); } - inline ICU4XLogger(capi::ICU4XLogger* i) : inner(i) {} - ICU4XLogger() = default; - ICU4XLogger(ICU4XLogger&&) noexcept = default; - ICU4XLogger& operator=(ICU4XLogger&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline bool ICU4XLogger::init_simple_logger() { - return capi::ICU4XLogger_init_simple_logger(); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XMetazoneCalculator.h b/third_party/rust/icu_capi/cpp/include/ICU4XMetazoneCalculator.h deleted file mode 100644 index 9c66754e90eb..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XMetazoneCalculator.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XMetazoneCalculator_H -#define ICU4XMetazoneCalculator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XMetazoneCalculator ICU4XMetazoneCalculator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError ICU4XMetazoneCalculator_create(const ICU4XDataProvider* provider); -void ICU4XMetazoneCalculator_destroy(ICU4XMetazoneCalculator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XMetazoneCalculator.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XMetazoneCalculator.hpp deleted file mode 100644 index c652bf876338..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XMetazoneCalculator.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef ICU4XMetazoneCalculator_HPP -#define ICU4XMetazoneCalculator_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XMetazoneCalculator.h" - -class ICU4XDataProvider; -class ICU4XMetazoneCalculator; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XMetazoneCalculator with std::unique_ptr. - */ -struct ICU4XMetazoneCalculatorDeleter { - void operator()(capi::ICU4XMetazoneCalculator* l) const noexcept { - capi::ICU4XMetazoneCalculator_destroy(l); - } -}; - -/** - * An object capable of computing the metazone from a timezone. - * - * This can be used via `maybe_calculate_metazone()` on [`ICU4XCustomTimeZone`]. - * - * [`ICU4XCustomTimeZone`]: crate::timezone::ffi::ICU4XCustomTimeZone; - * - * See the [Rust documentation for `MetazoneCalculator`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html) for more information. - */ -class ICU4XMetazoneCalculator { - public: - - /** - * - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - inline const capi::ICU4XMetazoneCalculator* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XMetazoneCalculator* AsFFIMut() { return this->inner.get(); } - inline ICU4XMetazoneCalculator(capi::ICU4XMetazoneCalculator* i) : inner(i) {} - ICU4XMetazoneCalculator() = default; - ICU4XMetazoneCalculator(ICU4XMetazoneCalculator&&) noexcept = default; - ICU4XMetazoneCalculator& operator=(ICU4XMetazoneCalculator&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline diplomat::result ICU4XMetazoneCalculator::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XMetazoneCalculator_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XMetazoneCalculator(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XOrdering.h b/third_party/rust/icu_capi/cpp/include/ICU4XOrdering.h deleted file mode 100644 index 2c1885f43e2b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XOrdering.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XOrdering_H -#define ICU4XOrdering_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XOrdering { - ICU4XOrdering_Less = -1, - ICU4XOrdering_Equal = 0, - ICU4XOrdering_Greater = 1, -} ICU4XOrdering; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XOrdering_destroy(ICU4XOrdering* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XOrdering.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XOrdering.hpp deleted file mode 100644 index 9ca362aa6f99..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XOrdering.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XOrdering_HPP -#define ICU4XOrdering_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XOrdering.h" - - - -/** - * - * - * See the [Rust documentation for `Ordering`](https://docs.rs/core/latest/core/cmp/enum.Ordering.html) for more information. - */ -enum struct ICU4XOrdering { - Less = -1, - Equal = 0, - Greater = 1, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategories.h b/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategories.h deleted file mode 100644 index 931ea2daa794..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategories.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XPluralCategories_H -#define ICU4XPluralCategories_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPluralCategories { - bool zero; - bool one; - bool two; - bool few; - bool many; - bool other; -} ICU4XPluralCategories; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XPluralCategories_destroy(ICU4XPluralCategories* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategories.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategories.hpp deleted file mode 100644 index c8b4a767a4e1..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategories.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XPluralCategories_HPP -#define ICU4XPluralCategories_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XPluralCategories.h" - - - -/** - * FFI version of `PluralRules::categories()` data. - */ -struct ICU4XPluralCategories { - public: - bool zero; - bool one; - bool two; - bool few; - bool many; - bool other; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategory.h b/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategory.h deleted file mode 100644 index 543681c74646..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategory.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef ICU4XPluralCategory_H -#define ICU4XPluralCategory_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XPluralCategory { - ICU4XPluralCategory_Zero = 0, - ICU4XPluralCategory_One = 1, - ICU4XPluralCategory_Two = 2, - ICU4XPluralCategory_Few = 3, - ICU4XPluralCategory_Many = 4, - ICU4XPluralCategory_Other = 5, -} ICU4XPluralCategory; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_ICU4XPluralCategory_void.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_ICU4XPluralCategory_void ICU4XPluralCategory_get_for_cldr_string(const char* s_data, size_t s_len); -void ICU4XPluralCategory_destroy(ICU4XPluralCategory* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategory.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategory.hpp deleted file mode 100644 index 24db42ec21bf..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralCategory.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XPluralCategory_HPP -#define ICU4XPluralCategory_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XPluralCategory.h" - - - -/** - * FFI version of `PluralCategory`. - * - * See the [Rust documentation for `PluralCategory`](https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html) for more information. - */ -enum struct ICU4XPluralCategory { - Zero = 0, - One = 1, - Two = 2, - Few = 3, - Many = 4, - Other = 5, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralOperands.h b/third_party/rust/icu_capi/cpp/include/ICU4XPluralOperands.h deleted file mode 100644 index 14d997555f78..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralOperands.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef ICU4XPluralOperands_H -#define ICU4XPluralOperands_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPluralOperands ICU4XPluralOperands; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XPluralOperands_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XPluralOperands_ICU4XError ICU4XPluralOperands_create_from_string(const char* s_data, size_t s_len); -void ICU4XPluralOperands_destroy(ICU4XPluralOperands* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralOperands.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XPluralOperands.hpp deleted file mode 100644 index 42fda2c94d00..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralOperands.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef ICU4XPluralOperands_HPP -#define ICU4XPluralOperands_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XPluralOperands.h" - -class ICU4XPluralOperands; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XPluralOperands with std::unique_ptr. - */ -struct ICU4XPluralOperandsDeleter { - void operator()(capi::ICU4XPluralOperands* l) const noexcept { - capi::ICU4XPluralOperands_destroy(l); - } -}; - -/** - * FFI version of `PluralOperands`. - * - * See the [Rust documentation for `PluralOperands`](https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html) for more information. - */ -class ICU4XPluralOperands { - public: - - /** - * Construct for a given string representing a number - * - * See the [Rust documentation for `from_str`](https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html#method.from_str) for more information. - */ - static diplomat::result create_from_string(const std::string_view s); - inline const capi::ICU4XPluralOperands* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XPluralOperands* AsFFIMut() { return this->inner.get(); } - inline ICU4XPluralOperands(capi::ICU4XPluralOperands* i) : inner(i) {} - ICU4XPluralOperands() = default; - ICU4XPluralOperands(ICU4XPluralOperands&&) noexcept = default; - ICU4XPluralOperands& operator=(ICU4XPluralOperands&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline diplomat::result ICU4XPluralOperands::create_from_string(const std::string_view s) { - auto diplomat_result_raw_out_value = capi::ICU4XPluralOperands_create_from_string(s.data(), s.size()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPluralOperands(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralRules.h b/third_party/rust/icu_capi/cpp/include/ICU4XPluralRules.h deleted file mode 100644 index 0794a7ac8ef3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralRules.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XPluralRules_H -#define ICU4XPluralRules_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPluralRules ICU4XPluralRules; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XPluralRules_ICU4XError.h" -#include "ICU4XPluralOperands.h" -#include "ICU4XPluralCategory.h" -#include "ICU4XPluralCategories.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XPluralRules_ICU4XError ICU4XPluralRules_create_cardinal(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XPluralRules_ICU4XError ICU4XPluralRules_create_ordinal(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -ICU4XPluralCategory ICU4XPluralRules_category_for(const ICU4XPluralRules* self, const ICU4XPluralOperands* op); - -ICU4XPluralCategories ICU4XPluralRules_categories(const ICU4XPluralRules* self); -void ICU4XPluralRules_destroy(ICU4XPluralRules* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPluralRules.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XPluralRules.hpp deleted file mode 100644 index 63929dc528fb..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPluralRules.hpp +++ /dev/null @@ -1,108 +0,0 @@ -#ifndef ICU4XPluralRules_HPP -#define ICU4XPluralRules_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XPluralRules.h" - -class ICU4XDataProvider; -class ICU4XLocale; -class ICU4XPluralRules; -#include "ICU4XError.hpp" -class ICU4XPluralOperands; -#include "ICU4XPluralCategory.hpp" -struct ICU4XPluralCategories; - -/** - * A destruction policy for using ICU4XPluralRules with std::unique_ptr. - */ -struct ICU4XPluralRulesDeleter { - void operator()(capi::ICU4XPluralRules* l) const noexcept { - capi::ICU4XPluralRules_destroy(l); - } -}; - -/** - * FFI version of `PluralRules`. - * - * See the [Rust documentation for `PluralRules`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html) for more information. - */ -class ICU4XPluralRules { - public: - - /** - * Construct an [`ICU4XPluralRules`] for the given locale, for cardinal numbers - * - * See the [Rust documentation for `try_new_cardinal_unstable`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal_unstable) for more information. - */ - static diplomat::result create_cardinal(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * Construct an [`ICU4XPluralRules`] for the given locale, for ordinal numbers - * - * See the [Rust documentation for `try_new_ordinal_unstable`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal_unstable) for more information. - */ - static diplomat::result create_ordinal(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * Get the category for a given number represented as operands - * - * See the [Rust documentation for `category_for`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for) for more information. - */ - ICU4XPluralCategory category_for(const ICU4XPluralOperands& op) const; - - /** - * Get all of the categories needed in the current locale - * - * See the [Rust documentation for `categories`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories) for more information. - */ - ICU4XPluralCategories categories() const; - inline const capi::ICU4XPluralRules* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XPluralRules* AsFFIMut() { return this->inner.get(); } - inline ICU4XPluralRules(capi::ICU4XPluralRules* i) : inner(i) {} - ICU4XPluralRules() = default; - ICU4XPluralRules(ICU4XPluralRules&&) noexcept = default; - ICU4XPluralRules& operator=(ICU4XPluralRules&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XPluralOperands.hpp" -#include "ICU4XPluralCategories.hpp" - -inline diplomat::result ICU4XPluralRules::create_cardinal(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XPluralRules_create_cardinal(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPluralRules(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPluralRules::create_ordinal(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XPluralRules_create_ordinal(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPluralRules(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XPluralCategory ICU4XPluralRules::category_for(const ICU4XPluralOperands& op) const { - return static_cast(capi::ICU4XPluralRules_category_for(this->inner.get(), op.AsFFI())); -} -inline ICU4XPluralCategories ICU4XPluralRules::categories() const { - capi::ICU4XPluralCategories diplomat_raw_struct_out_value = capi::ICU4XPluralRules_categories(this->inner.get()); - return ICU4XPluralCategories{ .zero = std::move(diplomat_raw_struct_out_value.zero), .one = std::move(diplomat_raw_struct_out_value.one), .two = std::move(diplomat_raw_struct_out_value.two), .few = std::move(diplomat_raw_struct_out_value.few), .many = std::move(diplomat_raw_struct_out_value.many), .other = std::move(diplomat_raw_struct_out_value.other) }; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPropertyValueNameToEnumMapper.h b/third_party/rust/icu_capi/cpp/include/ICU4XPropertyValueNameToEnumMapper.h deleted file mode 100644 index 7598c1837204..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPropertyValueNameToEnumMapper.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef ICU4XPropertyValueNameToEnumMapper_H -#define ICU4XPropertyValueNameToEnumMapper_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XPropertyValueNameToEnumMapper ICU4XPropertyValueNameToEnumMapper; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int16_t ICU4XPropertyValueNameToEnumMapper_get_strict(const ICU4XPropertyValueNameToEnumMapper* self, const char* name_data, size_t name_len); - -int16_t ICU4XPropertyValueNameToEnumMapper_get_loose(const ICU4XPropertyValueNameToEnumMapper* self, const char* name_data, size_t name_len); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_general_category(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_bidi_class(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_line_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_word_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_sentence_break(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError ICU4XPropertyValueNameToEnumMapper_load_script(const ICU4XDataProvider* provider); -void ICU4XPropertyValueNameToEnumMapper_destroy(ICU4XPropertyValueNameToEnumMapper* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XPropertyValueNameToEnumMapper.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XPropertyValueNameToEnumMapper.hpp deleted file mode 100644 index 407780c36734..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XPropertyValueNameToEnumMapper.hpp +++ /dev/null @@ -1,208 +0,0 @@ -#ifndef ICU4XPropertyValueNameToEnumMapper_HPP -#define ICU4XPropertyValueNameToEnumMapper_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XPropertyValueNameToEnumMapper.h" - -class ICU4XDataProvider; -class ICU4XPropertyValueNameToEnumMapper; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XPropertyValueNameToEnumMapper with std::unique_ptr. - */ -struct ICU4XPropertyValueNameToEnumMapperDeleter { - void operator()(capi::ICU4XPropertyValueNameToEnumMapper* l) const noexcept { - capi::ICU4XPropertyValueNameToEnumMapper_destroy(l); - } -}; - -/** - * A type capable of looking up a property value from a string name. - * - * See the [Rust documentation for `PropertyValueNameToEnumMapper`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapper.html) for more information. - * - * See the [Rust documentation for `PropertyValueNameToEnumMapperBorrowed`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html) for more information. - */ -class ICU4XPropertyValueNameToEnumMapper { - public: - - /** - * Get the property value matching the given name, using strict matching - * - * Returns -1 if the name is unknown for this property - * - * See the [Rust documentation for `get_strict`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html#method.get_strict) for more information. - */ - int16_t get_strict(const std::string_view name) const; - - /** - * Get the property value matching the given name, using loose matching - * - * Returns -1 if the name is unknown for this property - * - * See the [Rust documentation for `get_loose`](https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html#method.get_loose) for more information. - */ - int16_t get_loose(const std::string_view name) const; - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategory.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_general_category(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.BidiClass.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_bidi_class(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.EastAsianWidth.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_east_asian_width(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.LineBreak.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_line_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GraphemeClusterBreak.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_grapheme_cluster_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.WordBreak.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_word_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.SentenceBreak.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_sentence_break(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.Script.html#method.get_name_to_enum_mapper) for more information. - */ - static diplomat::result load_script(const ICU4XDataProvider& provider); - inline const capi::ICU4XPropertyValueNameToEnumMapper* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XPropertyValueNameToEnumMapper* AsFFIMut() { return this->inner.get(); } - inline ICU4XPropertyValueNameToEnumMapper(capi::ICU4XPropertyValueNameToEnumMapper* i) : inner(i) {} - ICU4XPropertyValueNameToEnumMapper() = default; - ICU4XPropertyValueNameToEnumMapper(ICU4XPropertyValueNameToEnumMapper&&) noexcept = default; - ICU4XPropertyValueNameToEnumMapper& operator=(ICU4XPropertyValueNameToEnumMapper&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" - -inline int16_t ICU4XPropertyValueNameToEnumMapper::get_strict(const std::string_view name) const { - return capi::ICU4XPropertyValueNameToEnumMapper_get_strict(this->inner.get(), name.data(), name.size()); -} -inline int16_t ICU4XPropertyValueNameToEnumMapper::get_loose(const std::string_view name) const { - return capi::ICU4XPropertyValueNameToEnumMapper_get_loose(this->inner.get(), name.data(), name.size()); -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_general_category(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_general_category(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_bidi_class(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_bidi_class(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_east_asian_width(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_line_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_line_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_grapheme_cluster_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_word_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_word_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_sentence_break(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_sentence_break(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XPropertyValueNameToEnumMapper::load_script(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XPropertyValueNameToEnumMapper_load_script(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XPropertyValueNameToEnumMapper(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XRegionDisplayNames.h b/third_party/rust/icu_capi/cpp/include/ICU4XRegionDisplayNames.h deleted file mode 100644 index aa8a65020395..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XRegionDisplayNames.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef ICU4XRegionDisplayNames_H -#define ICU4XRegionDisplayNames_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XRegionDisplayNames ICU4XRegionDisplayNames; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h" -#include "diplomat_result_void_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError ICU4XRegionDisplayNames_try_new_unstable(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_void_ICU4XError ICU4XRegionDisplayNames_of(const ICU4XRegionDisplayNames* self, const char* region_data, size_t region_len, DiplomatWriteable* write); -void ICU4XRegionDisplayNames_destroy(ICU4XRegionDisplayNames* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XRegionDisplayNames.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XRegionDisplayNames.hpp deleted file mode 100644 index 44cc8625a73b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XRegionDisplayNames.hpp +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ICU4XRegionDisplayNames_HPP -#define ICU4XRegionDisplayNames_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XRegionDisplayNames.h" - -class ICU4XDataProvider; -class ICU4XLocale; -class ICU4XRegionDisplayNames; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XRegionDisplayNames with std::unique_ptr. - */ -struct ICU4XRegionDisplayNamesDeleter { - void operator()(capi::ICU4XRegionDisplayNames* l) const noexcept { - capi::ICU4XRegionDisplayNames_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `RegionDisplayNames`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html) for more information. - */ -class ICU4XRegionDisplayNames { - public: - - /** - * Creates a new `RegionDisplayNames` from locale data and an options bag. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.try_new_unstable) for more information. - */ - static diplomat::result try_new_unstable(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * Returns the locale specific display name of a region. - * Note that the funtion returns an empty string in case the display name for a given - * region code is not found. - * - * See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.of) for more information. - */ - template diplomat::result of_to_writeable(const std::string_view region, W& write) const; - - /** - * Returns the locale specific display name of a region. - * Note that the funtion returns an empty string in case the display name for a given - * region code is not found. - * - * See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.of) for more information. - */ - diplomat::result of(const std::string_view region) const; - inline const capi::ICU4XRegionDisplayNames* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XRegionDisplayNames* AsFFIMut() { return this->inner.get(); } - inline ICU4XRegionDisplayNames(capi::ICU4XRegionDisplayNames* i) : inner(i) {} - ICU4XRegionDisplayNames() = default; - ICU4XRegionDisplayNames(ICU4XRegionDisplayNames&&) noexcept = default; - ICU4XRegionDisplayNames& operator=(ICU4XRegionDisplayNames&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" - -inline diplomat::result ICU4XRegionDisplayNames::try_new_unstable(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XRegionDisplayNames_try_new_unstable(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XRegionDisplayNames(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XRegionDisplayNames::of_to_writeable(const std::string_view region, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XRegionDisplayNames_of(this->inner.get(), region.data(), region.size(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XRegionDisplayNames::of(const std::string_view region) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XRegionDisplayNames_of(this->inner.get(), region.data(), region.size(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XReorderedIndexMap.h b/third_party/rust/icu_capi/cpp/include/ICU4XReorderedIndexMap.h deleted file mode 100644 index f5507a72178f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XReorderedIndexMap.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XReorderedIndexMap_H -#define ICU4XReorderedIndexMap_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XReorderedIndexMap ICU4XReorderedIndexMap; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -DiplomatUsizeView ICU4XReorderedIndexMap_as_slice(const ICU4XReorderedIndexMap* self); - -size_t ICU4XReorderedIndexMap_len(const ICU4XReorderedIndexMap* self); - -size_t ICU4XReorderedIndexMap_get(const ICU4XReorderedIndexMap* self, size_t index); -void ICU4XReorderedIndexMap_destroy(ICU4XReorderedIndexMap* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XReorderedIndexMap.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XReorderedIndexMap.hpp deleted file mode 100644 index 1fe4270baa8f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XReorderedIndexMap.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef ICU4XReorderedIndexMap_HPP -#define ICU4XReorderedIndexMap_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XReorderedIndexMap.h" - - -/** - * A destruction policy for using ICU4XReorderedIndexMap with std::unique_ptr. - */ -struct ICU4XReorderedIndexMapDeleter { - void operator()(capi::ICU4XReorderedIndexMap* l) const noexcept { - capi::ICU4XReorderedIndexMap_destroy(l); - } -}; - -/** - * Thin wrapper around a vector that maps visual indices to source indices - * - * `map[visualIndex] = sourceIndex` - * - * Produced by `reorder_visual()` on [`ICU4XBidi`]. - */ -class ICU4XReorderedIndexMap { - public: - - /** - * Get this as a slice/array of indices - * - * Lifetimes: `this` must live at least as long as the output. - */ - const diplomat::span as_slice() const; - - /** - * The length of this map - */ - size_t len() const; - - /** - * Get element at `index`. Returns 0 when out of bounds - * (note that 0 is also a valid in-bounds value, please use `len()` - * to avoid out-of-bounds) - */ - size_t get(size_t index) const; - inline const capi::ICU4XReorderedIndexMap* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XReorderedIndexMap* AsFFIMut() { return this->inner.get(); } - inline ICU4XReorderedIndexMap(capi::ICU4XReorderedIndexMap* i) : inner(i) {} - ICU4XReorderedIndexMap() = default; - ICU4XReorderedIndexMap(ICU4XReorderedIndexMap&&) noexcept = default; - ICU4XReorderedIndexMap& operator=(ICU4XReorderedIndexMap&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline const diplomat::span ICU4XReorderedIndexMap::as_slice() const { - capi::DiplomatUsizeView diplomat_slice_raw_out_value = capi::ICU4XReorderedIndexMap_as_slice(this->inner.get()); - diplomat::span slice(diplomat_slice_raw_out_value.data, diplomat_slice_raw_out_value.len); - return slice; -} -inline size_t ICU4XReorderedIndexMap::len() const { - return capi::ICU4XReorderedIndexMap_len(this->inner.get()); -} -inline size_t ICU4XReorderedIndexMap::get(size_t index) const { - return capi::ICU4XReorderedIndexMap_get(this->inner.get(), index); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XScriptExtensionsSet.h b/third_party/rust/icu_capi/cpp/include/ICU4XScriptExtensionsSet.h deleted file mode 100644 index b4982dc22c34..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XScriptExtensionsSet.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XScriptExtensionsSet_H -#define ICU4XScriptExtensionsSet_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XScriptExtensionsSet ICU4XScriptExtensionsSet; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_uint16_t_void.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XScriptExtensionsSet_contains(const ICU4XScriptExtensionsSet* self, uint16_t script); - -size_t ICU4XScriptExtensionsSet_count(const ICU4XScriptExtensionsSet* self); - -diplomat_result_uint16_t_void ICU4XScriptExtensionsSet_script_at(const ICU4XScriptExtensionsSet* self, size_t index); -void ICU4XScriptExtensionsSet_destroy(ICU4XScriptExtensionsSet* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XScriptExtensionsSet.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XScriptExtensionsSet.hpp deleted file mode 100644 index 6eff599705aa..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XScriptExtensionsSet.hpp +++ /dev/null @@ -1,79 +0,0 @@ -#ifndef ICU4XScriptExtensionsSet_HPP -#define ICU4XScriptExtensionsSet_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XScriptExtensionsSet.h" - - -/** - * A destruction policy for using ICU4XScriptExtensionsSet with std::unique_ptr. - */ -struct ICU4XScriptExtensionsSetDeleter { - void operator()(capi::ICU4XScriptExtensionsSet* l) const noexcept { - capi::ICU4XScriptExtensionsSet_destroy(l); - } -}; - -/** - * An object that represents the Script_Extensions property for a single character - * - * See the [Rust documentation for `ScriptExtensionsSet`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html) for more information. - */ -class ICU4XScriptExtensionsSet { - public: - - /** - * Check if the Script_Extensions property of the given code point covers the given script - * - * See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.contains) for more information. - */ - bool contains(uint16_t script) const; - - /** - * Get the number of scripts contained in here - * - * See the [Rust documentation for `iter`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information. - */ - size_t count() const; - - /** - * Get script at index, returning an error if out of bounds - * - * See the [Rust documentation for `iter`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information. - */ - diplomat::result script_at(size_t index) const; - inline const capi::ICU4XScriptExtensionsSet* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XScriptExtensionsSet* AsFFIMut() { return this->inner.get(); } - inline ICU4XScriptExtensionsSet(capi::ICU4XScriptExtensionsSet* i) : inner(i) {} - ICU4XScriptExtensionsSet() = default; - ICU4XScriptExtensionsSet(ICU4XScriptExtensionsSet&&) noexcept = default; - ICU4XScriptExtensionsSet& operator=(ICU4XScriptExtensionsSet&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline bool ICU4XScriptExtensionsSet::contains(uint16_t script) const { - return capi::ICU4XScriptExtensionsSet_contains(this->inner.get(), script); -} -inline size_t ICU4XScriptExtensionsSet::count() const { - return capi::ICU4XScriptExtensionsSet_count(this->inner.get()); -} -inline diplomat::result ICU4XScriptExtensionsSet::script_at(size_t index) const { - auto diplomat_result_raw_out_value = capi::ICU4XScriptExtensionsSet_script_at(this->inner.get(), index); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(diplomat_result_raw_out_value.ok)); - } else { - diplomat_result_out_value = diplomat::Err(std::monostate()); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensions.h b/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensions.h deleted file mode 100644 index df2dd5394649..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensions.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ICU4XScriptWithExtensions_H -#define ICU4XScriptWithExtensions_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XScriptWithExtensions ICU4XScriptWithExtensions; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h" -#include "ICU4XScriptWithExtensionsBorrowed.h" -#include "CodePointRangeIterator.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError ICU4XScriptWithExtensions_create(const ICU4XDataProvider* provider); - -uint16_t ICU4XScriptWithExtensions_get_script_val(const ICU4XScriptWithExtensions* self, uint32_t code_point); - -bool ICU4XScriptWithExtensions_has_script(const ICU4XScriptWithExtensions* self, uint32_t code_point, uint16_t script); - -ICU4XScriptWithExtensionsBorrowed* ICU4XScriptWithExtensions_as_borrowed(const ICU4XScriptWithExtensions* self); - -CodePointRangeIterator* ICU4XScriptWithExtensions_iter_ranges_for_script(const ICU4XScriptWithExtensions* self, uint16_t script); -void ICU4XScriptWithExtensions_destroy(ICU4XScriptWithExtensions* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensions.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensions.hpp deleted file mode 100644 index d548d197f0f7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensions.hpp +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef ICU4XScriptWithExtensions_HPP -#define ICU4XScriptWithExtensions_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XScriptWithExtensions.h" - -class ICU4XDataProvider; -class ICU4XScriptWithExtensions; -#include "ICU4XError.hpp" -class ICU4XScriptWithExtensionsBorrowed; -class CodePointRangeIterator; - -/** - * A destruction policy for using ICU4XScriptWithExtensions with std::unique_ptr. - */ -struct ICU4XScriptWithExtensionsDeleter { - void operator()(capi::ICU4XScriptWithExtensions* l) const noexcept { - capi::ICU4XScriptWithExtensions_destroy(l); - } -}; - -/** - * An ICU4X ScriptWithExtensions map object, capable of holding a map of codepoints to scriptextensions values - * - * See the [Rust documentation for `ScriptWithExtensions`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html) for more information. - */ -class ICU4XScriptWithExtensions { - public: - - /** - * - * - * See the [Rust documentation for `load_script_with_extensions_unstable`](https://docs.rs/icu/latest/icu/properties/script/fn.load_script_with_extensions_unstable.html) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Get the Script property value for a code point - * - * See the [Rust documentation for `get_script_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information. - */ - uint16_t get_script_val(uint32_t code_point) const; - - /** - * Check if the Script_Extensions property of the given code point covers the given script - * - * See the [Rust documentation for `has_script`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information. - */ - bool has_script(uint32_t code_point, uint16_t script) const; - - /** - * Borrow this object for a slightly faster variant with more operations - * - * See the [Rust documentation for `as_borrowed`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html#method.as_borrowed) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - ICU4XScriptWithExtensionsBorrowed as_borrowed() const; - - /** - * Get a list of ranges of code points that contain this script in their Script_Extensions values - * - * See the [Rust documentation for `get_script_extensions_ranges`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_ranges) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - CodePointRangeIterator iter_ranges_for_script(uint16_t script) const; - inline const capi::ICU4XScriptWithExtensions* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XScriptWithExtensions* AsFFIMut() { return this->inner.get(); } - inline ICU4XScriptWithExtensions(capi::ICU4XScriptWithExtensions* i) : inner(i) {} - ICU4XScriptWithExtensions() = default; - ICU4XScriptWithExtensions(ICU4XScriptWithExtensions&&) noexcept = default; - ICU4XScriptWithExtensions& operator=(ICU4XScriptWithExtensions&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XScriptWithExtensionsBorrowed.hpp" -#include "CodePointRangeIterator.hpp" - -inline diplomat::result ICU4XScriptWithExtensions::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XScriptWithExtensions_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XScriptWithExtensions(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint16_t ICU4XScriptWithExtensions::get_script_val(uint32_t code_point) const { - return capi::ICU4XScriptWithExtensions_get_script_val(this->inner.get(), code_point); -} -inline bool ICU4XScriptWithExtensions::has_script(uint32_t code_point, uint16_t script) const { - return capi::ICU4XScriptWithExtensions_has_script(this->inner.get(), code_point, script); -} -inline ICU4XScriptWithExtensionsBorrowed ICU4XScriptWithExtensions::as_borrowed() const { - return ICU4XScriptWithExtensionsBorrowed(capi::ICU4XScriptWithExtensions_as_borrowed(this->inner.get())); -} -inline CodePointRangeIterator ICU4XScriptWithExtensions::iter_ranges_for_script(uint16_t script) const { - return CodePointRangeIterator(capi::ICU4XScriptWithExtensions_iter_ranges_for_script(this->inner.get(), script)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensionsBorrowed.h b/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensionsBorrowed.h deleted file mode 100644 index 905b5ecc6bb0..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensionsBorrowed.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XScriptWithExtensionsBorrowed_H -#define ICU4XScriptWithExtensionsBorrowed_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XScriptWithExtensionsBorrowed ICU4XScriptWithExtensionsBorrowed; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XScriptExtensionsSet.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -uint16_t ICU4XScriptWithExtensionsBorrowed_get_script_val(const ICU4XScriptWithExtensionsBorrowed* self, uint32_t code_point); - -ICU4XScriptExtensionsSet* ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(const ICU4XScriptWithExtensionsBorrowed* self, uint32_t code_point); - -bool ICU4XScriptWithExtensionsBorrowed_has_script(const ICU4XScriptWithExtensionsBorrowed* self, uint32_t code_point, uint16_t script); -void ICU4XScriptWithExtensionsBorrowed_destroy(ICU4XScriptWithExtensionsBorrowed* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensionsBorrowed.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensionsBorrowed.hpp deleted file mode 100644 index dc889a2cd020..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XScriptWithExtensionsBorrowed.hpp +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef ICU4XScriptWithExtensionsBorrowed_HPP -#define ICU4XScriptWithExtensionsBorrowed_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XScriptWithExtensionsBorrowed.h" - -class ICU4XScriptExtensionsSet; - -/** - * A destruction policy for using ICU4XScriptWithExtensionsBorrowed with std::unique_ptr. - */ -struct ICU4XScriptWithExtensionsBorrowedDeleter { - void operator()(capi::ICU4XScriptWithExtensionsBorrowed* l) const noexcept { - capi::ICU4XScriptWithExtensionsBorrowed_destroy(l); - } -}; - -/** - * A slightly faster ICU4XScriptWithExtensions object - * - * See the [Rust documentation for `ScriptWithExtensionsBorrowed`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html) for more information. - */ -class ICU4XScriptWithExtensionsBorrowed { - public: - - /** - * Get the Script property value for a code point - * - * See the [Rust documentation for `get_script_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information. - */ - uint16_t get_script_val(uint32_t code_point) const; - - /** - * Get the Script property value for a code point - * - * See the [Rust documentation for `get_script_extensions_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_val) for more information. - * - * Lifetimes: `this` must live at least as long as the output. - */ - ICU4XScriptExtensionsSet get_script_extensions_val(uint32_t code_point) const; - - /** - * Check if the Script_Extensions property of the given code point covers the given script - * - * See the [Rust documentation for `has_script`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information. - */ - bool has_script(uint32_t code_point, uint16_t script) const; - inline const capi::ICU4XScriptWithExtensionsBorrowed* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XScriptWithExtensionsBorrowed* AsFFIMut() { return this->inner.get(); } - inline ICU4XScriptWithExtensionsBorrowed(capi::ICU4XScriptWithExtensionsBorrowed* i) : inner(i) {} - ICU4XScriptWithExtensionsBorrowed() = default; - ICU4XScriptWithExtensionsBorrowed(ICU4XScriptWithExtensionsBorrowed&&) noexcept = default; - ICU4XScriptWithExtensionsBorrowed& operator=(ICU4XScriptWithExtensionsBorrowed&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XScriptExtensionsSet.hpp" - -inline uint16_t ICU4XScriptWithExtensionsBorrowed::get_script_val(uint32_t code_point) const { - return capi::ICU4XScriptWithExtensionsBorrowed_get_script_val(this->inner.get(), code_point); -} -inline ICU4XScriptExtensionsSet ICU4XScriptWithExtensionsBorrowed::get_script_extensions_val(uint32_t code_point) const { - return ICU4XScriptExtensionsSet(capi::ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(this->inner.get(), code_point)); -} -inline bool ICU4XScriptWithExtensionsBorrowed::has_script(uint32_t code_point, uint16_t script) const { - return capi::ICU4XScriptWithExtensionsBorrowed_has_script(this->inner.get(), code_point, script); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSegmenterWordType.h b/third_party/rust/icu_capi/cpp/include/ICU4XSegmenterWordType.h deleted file mode 100644 index 9f4f81cf10ce..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSegmenterWordType.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XSegmenterWordType_H -#define ICU4XSegmenterWordType_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XSegmenterWordType { - ICU4XSegmenterWordType_None = 0, - ICU4XSegmenterWordType_Number = 1, - ICU4XSegmenterWordType_Letter = 2, -} ICU4XSegmenterWordType; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XSegmenterWordType_destroy(ICU4XSegmenterWordType* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSegmenterWordType.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XSegmenterWordType.hpp deleted file mode 100644 index f204f8a045d7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSegmenterWordType.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XSegmenterWordType_HPP -#define ICU4XSegmenterWordType_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XSegmenterWordType.h" - - - -/** - * - * - * See the [Rust documentation for `WordType`](https://docs.rs/icu/latest/icu/segmenter/enum.WordType.html) for more information. - */ -enum struct ICU4XSegmenterWordType { - None = 0, - Number = 1, - Letter = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorLatin1.h b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorLatin1.h deleted file mode 100644 index 6dd7b132dc37..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorLatin1.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorLatin1_H -#define ICU4XSentenceBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceBreakIteratorLatin1 ICU4XSentenceBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XSentenceBreakIteratorLatin1_next(ICU4XSentenceBreakIteratorLatin1* self); -void ICU4XSentenceBreakIteratorLatin1_destroy(ICU4XSentenceBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorLatin1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorLatin1.hpp deleted file mode 100644 index 013c4ce0e2f2..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorLatin1.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorLatin1_HPP -#define ICU4XSentenceBreakIteratorLatin1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XSentenceBreakIteratorLatin1.h" - - -/** - * A destruction policy for using ICU4XSentenceBreakIteratorLatin1 with std::unique_ptr. - */ -struct ICU4XSentenceBreakIteratorLatin1Deleter { - void operator()(capi::ICU4XSentenceBreakIteratorLatin1* l) const noexcept { - capi::ICU4XSentenceBreakIteratorLatin1_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html) for more information. - */ -class ICU4XSentenceBreakIteratorLatin1 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XSentenceBreakIteratorLatin1* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XSentenceBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); } - inline ICU4XSentenceBreakIteratorLatin1(capi::ICU4XSentenceBreakIteratorLatin1* i) : inner(i) {} - ICU4XSentenceBreakIteratorLatin1() = default; - ICU4XSentenceBreakIteratorLatin1(ICU4XSentenceBreakIteratorLatin1&&) noexcept = default; - ICU4XSentenceBreakIteratorLatin1& operator=(ICU4XSentenceBreakIteratorLatin1&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XSentenceBreakIteratorLatin1::next() { - return capi::ICU4XSentenceBreakIteratorLatin1_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf16.h b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf16.h deleted file mode 100644 index 3ed0dc18c34c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf16.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorUtf16_H -#define ICU4XSentenceBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceBreakIteratorUtf16 ICU4XSentenceBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XSentenceBreakIteratorUtf16_next(ICU4XSentenceBreakIteratorUtf16* self); -void ICU4XSentenceBreakIteratorUtf16_destroy(ICU4XSentenceBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf16.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf16.hpp deleted file mode 100644 index 4b90871fdd89..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf16.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorUtf16_HPP -#define ICU4XSentenceBreakIteratorUtf16_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XSentenceBreakIteratorUtf16.h" - - -/** - * A destruction policy for using ICU4XSentenceBreakIteratorUtf16 with std::unique_ptr. - */ -struct ICU4XSentenceBreakIteratorUtf16Deleter { - void operator()(capi::ICU4XSentenceBreakIteratorUtf16* l) const noexcept { - capi::ICU4XSentenceBreakIteratorUtf16_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html) for more information. - */ -class ICU4XSentenceBreakIteratorUtf16 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XSentenceBreakIteratorUtf16* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XSentenceBreakIteratorUtf16* AsFFIMut() { return this->inner.get(); } - inline ICU4XSentenceBreakIteratorUtf16(capi::ICU4XSentenceBreakIteratorUtf16* i) : inner(i) {} - ICU4XSentenceBreakIteratorUtf16() = default; - ICU4XSentenceBreakIteratorUtf16(ICU4XSentenceBreakIteratorUtf16&&) noexcept = default; - ICU4XSentenceBreakIteratorUtf16& operator=(ICU4XSentenceBreakIteratorUtf16&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XSentenceBreakIteratorUtf16::next() { - return capi::ICU4XSentenceBreakIteratorUtf16_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf8.h b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf8.h deleted file mode 100644 index 655cb67b6cd1..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf8.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorUtf8_H -#define ICU4XSentenceBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceBreakIteratorUtf8 ICU4XSentenceBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XSentenceBreakIteratorUtf8_next(ICU4XSentenceBreakIteratorUtf8* self); -void ICU4XSentenceBreakIteratorUtf8_destroy(ICU4XSentenceBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf8.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf8.hpp deleted file mode 100644 index df6f08b6c1ff..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceBreakIteratorUtf8.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XSentenceBreakIteratorUtf8_HPP -#define ICU4XSentenceBreakIteratorUtf8_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XSentenceBreakIteratorUtf8.h" - - -/** - * A destruction policy for using ICU4XSentenceBreakIteratorUtf8 with std::unique_ptr. - */ -struct ICU4XSentenceBreakIteratorUtf8Deleter { - void operator()(capi::ICU4XSentenceBreakIteratorUtf8* l) const noexcept { - capi::ICU4XSentenceBreakIteratorUtf8_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `SentenceBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html) for more information. - */ -class ICU4XSentenceBreakIteratorUtf8 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next) for more information. - */ - int32_t next(); - inline const capi::ICU4XSentenceBreakIteratorUtf8* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XSentenceBreakIteratorUtf8* AsFFIMut() { return this->inner.get(); } - inline ICU4XSentenceBreakIteratorUtf8(capi::ICU4XSentenceBreakIteratorUtf8* i) : inner(i) {} - ICU4XSentenceBreakIteratorUtf8() = default; - ICU4XSentenceBreakIteratorUtf8(ICU4XSentenceBreakIteratorUtf8&&) noexcept = default; - ICU4XSentenceBreakIteratorUtf8& operator=(ICU4XSentenceBreakIteratorUtf8&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XSentenceBreakIteratorUtf8::next() { - return capi::ICU4XSentenceBreakIteratorUtf8_next(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceSegmenter.h b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceSegmenter.h deleted file mode 100644 index 7701c9f04289..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceSegmenter.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef ICU4XSentenceSegmenter_H -#define ICU4XSentenceSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XSentenceSegmenter ICU4XSentenceSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h" -#include "ICU4XSentenceBreakIteratorUtf8.h" -#include "ICU4XSentenceBreakIteratorUtf16.h" -#include "ICU4XSentenceBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError ICU4XSentenceSegmenter_create(const ICU4XDataProvider* provider); - -ICU4XSentenceBreakIteratorUtf8* ICU4XSentenceSegmenter_segment_utf8(const ICU4XSentenceSegmenter* self, const char* input_data, size_t input_len); - -ICU4XSentenceBreakIteratorUtf16* ICU4XSentenceSegmenter_segment_utf16(const ICU4XSentenceSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XSentenceBreakIteratorLatin1* ICU4XSentenceSegmenter_segment_latin1(const ICU4XSentenceSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XSentenceSegmenter_destroy(ICU4XSentenceSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceSegmenter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XSentenceSegmenter.hpp deleted file mode 100644 index e8332bd68067..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XSentenceSegmenter.hpp +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef ICU4XSentenceSegmenter_HPP -#define ICU4XSentenceSegmenter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XSentenceSegmenter.h" - -class ICU4XDataProvider; -class ICU4XSentenceSegmenter; -#include "ICU4XError.hpp" -class ICU4XSentenceBreakIteratorUtf8; -class ICU4XSentenceBreakIteratorUtf16; -class ICU4XSentenceBreakIteratorLatin1; - -/** - * A destruction policy for using ICU4XSentenceSegmenter with std::unique_ptr. - */ -struct ICU4XSentenceSegmenterDeleter { - void operator()(capi::ICU4XSentenceSegmenter* l) const noexcept { - capi::ICU4XSentenceSegmenter_destroy(l); - } -}; - -/** - * An ICU4X sentence-break segmenter, capable of finding sentence breakpoints in strings. - * - * See the [Rust documentation for `SentenceSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html) for more information. - */ -class ICU4XSentenceSegmenter { - public: - - /** - * Construct an [`ICU4XSentenceSegmenter`]. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider); - - /** - * Segments a (potentially ill-formed) UTF-8 string. - * - * See the [Rust documentation for `segment_utf8`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_utf8) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XSentenceBreakIteratorUtf8 segment_utf8(const std::string_view input) const; - - /** - * Segments a UTF-16 string. - * - * See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_utf16) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XSentenceBreakIteratorUtf16 segment_utf16(const diplomat::span input) const; - - /** - * Segments a Latin-1 string. - * - * See the [Rust documentation for `segment_latin1`](https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_latin1) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XSentenceBreakIteratorLatin1 segment_latin1(const diplomat::span input) const; - inline const capi::ICU4XSentenceSegmenter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XSentenceSegmenter* AsFFIMut() { return this->inner.get(); } - inline ICU4XSentenceSegmenter(capi::ICU4XSentenceSegmenter* i) : inner(i) {} - ICU4XSentenceSegmenter() = default; - ICU4XSentenceSegmenter(ICU4XSentenceSegmenter&&) noexcept = default; - ICU4XSentenceSegmenter& operator=(ICU4XSentenceSegmenter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XSentenceBreakIteratorUtf8.hpp" -#include "ICU4XSentenceBreakIteratorUtf16.hpp" -#include "ICU4XSentenceBreakIteratorLatin1.hpp" - -inline diplomat::result ICU4XSentenceSegmenter::create(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XSentenceSegmenter_create(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XSentenceSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XSentenceBreakIteratorUtf8 ICU4XSentenceSegmenter::segment_utf8(const std::string_view input) const { - return ICU4XSentenceBreakIteratorUtf8(capi::ICU4XSentenceSegmenter_segment_utf8(this->inner.get(), input.data(), input.size())); -} -inline ICU4XSentenceBreakIteratorUtf16 ICU4XSentenceSegmenter::segment_utf16(const diplomat::span input) const { - return ICU4XSentenceBreakIteratorUtf16(capi::ICU4XSentenceSegmenter_segment_utf16(this->inner.get(), input.data(), input.size())); -} -inline ICU4XSentenceBreakIteratorLatin1 ICU4XSentenceSegmenter::segment_latin1(const diplomat::span input) const { - return ICU4XSentenceBreakIteratorLatin1(capi::ICU4XSentenceSegmenter_segment_latin1(this->inner.get(), input.data(), input.size())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTime.h b/third_party/rust/icu_capi/cpp/include/ICU4XTime.h deleted file mode 100644 index d92fef92e4b8..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTime.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ICU4XTime_H -#define ICU4XTime_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XTime ICU4XTime; -#ifdef __cplusplus -} // namespace capi -#endif -#include "diplomat_result_box_ICU4XTime_ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XTime_ICU4XError ICU4XTime_create(uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond); - -uint8_t ICU4XTime_hour(const ICU4XTime* self); - -uint8_t ICU4XTime_minute(const ICU4XTime* self); - -uint8_t ICU4XTime_second(const ICU4XTime* self); - -uint32_t ICU4XTime_nanosecond(const ICU4XTime* self); -void ICU4XTime_destroy(ICU4XTime* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTime.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XTime.hpp deleted file mode 100644 index 424ceedfbfef..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTime.hpp +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef ICU4XTime_HPP -#define ICU4XTime_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XTime.h" - -class ICU4XTime; -#include "ICU4XError.hpp" - -/** - * A destruction policy for using ICU4XTime with std::unique_ptr. - */ -struct ICU4XTimeDeleter { - void operator()(capi::ICU4XTime* l) const noexcept { - capi::ICU4XTime_destroy(l); - } -}; - -/** - * An ICU4X Time object representing a time in terms of hour, minute, second, nanosecond - * - * See the [Rust documentation for `Time`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html) for more information. - */ -class ICU4XTime { - public: - - /** - * Creates a new [`ICU4XTime`] given field values - * - * See the [Rust documentation for `Time`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html) for more information. - */ - static diplomat::result create(uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond); - - /** - * Returns the hour in this time - * - * See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour) for more information. - */ - uint8_t hour() const; - - /** - * Returns the minute in this time - * - * See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute) for more information. - */ - uint8_t minute() const; - - /** - * Returns the second in this time - * - * See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second) for more information. - */ - uint8_t second() const; - - /** - * Returns the nanosecond in this time - * - * See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond) for more information. - */ - uint32_t nanosecond() const; - inline const capi::ICU4XTime* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XTime* AsFFIMut() { return this->inner.get(); } - inline ICU4XTime(capi::ICU4XTime* i) : inner(i) {} - ICU4XTime() = default; - ICU4XTime(ICU4XTime&&) noexcept = default; - ICU4XTime& operator=(ICU4XTime&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline diplomat::result ICU4XTime::create(uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond) { - auto diplomat_result_raw_out_value = capi::ICU4XTime_create(hour, minute, second, nanosecond); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XTime(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline uint8_t ICU4XTime::hour() const { - return capi::ICU4XTime_hour(this->inner.get()); -} -inline uint8_t ICU4XTime::minute() const { - return capi::ICU4XTime_minute(this->inner.get()); -} -inline uint8_t ICU4XTime::second() const { - return capi::ICU4XTime_second(this->inner.get()); -} -inline uint32_t ICU4XTime::nanosecond() const { - return capi::ICU4XTime_nanosecond(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTimeFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XTimeFormatter.h deleted file mode 100644 index d200881399fa..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTimeFormatter.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef ICU4XTimeFormatter_H -#define ICU4XTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XTimeFormatter ICU4XTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h" -#include "ICU4XTime.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XDateTime.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XTimeFormatter_ICU4XError ICU4XTimeFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XTimeLength length); - -diplomat_result_void_ICU4XError ICU4XTimeFormatter_format_time(const ICU4XTimeFormatter* self, const ICU4XTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XTimeFormatter_format_datetime(const ICU4XTimeFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XTimeFormatter_format_iso_datetime(const ICU4XTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write); -void ICU4XTimeFormatter_destroy(ICU4XTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTimeFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XTimeFormatter.hpp deleted file mode 100644 index f036764f3892..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTimeFormatter.hpp +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef ICU4XTimeFormatter_HPP -#define ICU4XTimeFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XTimeFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XTimeLength.hpp" -class ICU4XTimeFormatter; -#include "ICU4XError.hpp" -class ICU4XTime; -class ICU4XDateTime; -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XTimeFormatter with std::unique_ptr. - */ -struct ICU4XTimeFormatterDeleter { - void operator()(capi::ICU4XTimeFormatter* l) const noexcept { - capi::ICU4XTimeFormatter_destroy(l); - } -}; - -/** - * An ICU4X TimeFormatter object capable of formatting an [`ICU4XTime`] type (and others) as a string - * - * See the [Rust documentation for `TimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html) for more information. - */ -class ICU4XTimeFormatter { - public: - - /** - * Creates a new [`ICU4XTimeFormatter`] from locale data. - * - * See the [Rust documentation for `try_new_with_length_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.try_new_with_length_unstable) for more information. - */ - static diplomat::result create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XTimeLength length); - - /** - * Formats a [`ICU4XTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_time_to_writeable(const ICU4XTime& value, W& write) const; - - /** - * Formats a [`ICU4XTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. - */ - diplomat::result format_time(const ICU4XTime& value) const; - - /** - * Formats a [`ICU4XDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. - */ - diplomat::result format_datetime(const ICU4XDateTime& value) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime(const ICU4XIsoDateTime& value) const; - inline const capi::ICU4XTimeFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XTimeFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XTimeFormatter(capi::ICU4XTimeFormatter* i) : inner(i) {} - ICU4XTimeFormatter() = default; - ICU4XTimeFormatter(ICU4XTimeFormatter&&) noexcept = default; - ICU4XTimeFormatter& operator=(ICU4XTimeFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XTime.hpp" -#include "ICU4XDateTime.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XTimeFormatter::create_with_length(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XTimeLength length) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_create_with_length(provider.AsFFI(), locale.AsFFI(), static_cast(length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XTimeFormatter::format_time_to_writeable(const ICU4XTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_format_time(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeFormatter::format_time(const ICU4XTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_format_time(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XTimeFormatter::format_datetime_to_writeable(const ICU4XDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_format_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeFormatter::format_datetime(const ICU4XDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_format_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XTimeFormatter::format_iso_datetime_to_writeable(const ICU4XIsoDateTime& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeFormatter::format_iso_datetime(const ICU4XIsoDateTime& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XTimeFormatter_format_iso_datetime(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTimeLength.h b/third_party/rust/icu_capi/cpp/include/ICU4XTimeLength.h deleted file mode 100644 index 6d98bc8ccb59..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTimeLength.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XTimeLength_H -#define ICU4XTimeLength_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XTimeLength { - ICU4XTimeLength_Full = 0, - ICU4XTimeLength_Long = 1, - ICU4XTimeLength_Medium = 2, - ICU4XTimeLength_Short = 3, -} ICU4XTimeLength; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XTimeLength_destroy(ICU4XTimeLength* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTimeLength.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XTimeLength.hpp deleted file mode 100644 index 9eae1892e36e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTimeLength.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ICU4XTimeLength_HPP -#define ICU4XTimeLength_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XTimeLength.h" - - - -/** - * - * - * See the [Rust documentation for `Time`](https://docs.rs/icu/latest/icu/datetime/options/length/enum.Time.html) for more information. - */ -enum struct ICU4XTimeLength { - Full = 0, - Long = 1, - Medium = 2, - Short = 3, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTimeZoneFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XTimeZoneFormatter.h deleted file mode 100644 index c11abf4362cb..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTimeZoneFormatter.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ICU4XTimeZoneFormatter_H -#define ICU4XTimeZoneFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XTimeZoneFormatter ICU4XTimeZoneFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h" -#include "ICU4XIsoTimeZoneOptions.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XCustomTimeZone.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XIsoTimeZoneOptions options); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_generic_non_location_long(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_generic_non_location_short(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_specific_non_location_long(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_specific_non_location_short(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_generic_location_format(ICU4XTimeZoneFormatter* self, const ICU4XDataProvider* provider); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_localized_gmt_format(ICU4XTimeZoneFormatter* self); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_load_iso_8601_format(ICU4XTimeZoneFormatter* self, ICU4XIsoTimeZoneOptions options); - -diplomat_result_void_ICU4XError ICU4XTimeZoneFormatter_format_custom_time_zone(const ICU4XTimeZoneFormatter* self, const ICU4XCustomTimeZone* value, DiplomatWriteable* write); -void ICU4XTimeZoneFormatter_destroy(ICU4XTimeZoneFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTimeZoneFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XTimeZoneFormatter.hpp deleted file mode 100644 index 13988619bc41..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTimeZoneFormatter.hpp +++ /dev/null @@ -1,256 +0,0 @@ -#ifndef ICU4XTimeZoneFormatter_HPP -#define ICU4XTimeZoneFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XTimeZoneFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -class ICU4XTimeZoneFormatter; -#include "ICU4XError.hpp" -struct ICU4XIsoTimeZoneOptions; -class ICU4XCustomTimeZone; - -/** - * A destruction policy for using ICU4XTimeZoneFormatter with std::unique_ptr. - */ -struct ICU4XTimeZoneFormatterDeleter { - void operator()(capi::ICU4XTimeZoneFormatter* l) const noexcept { - capi::ICU4XTimeZoneFormatter_destroy(l); - } -}; - -/** - * An ICU4X TimeZoneFormatter object capable of formatting an [`ICU4XCustomTimeZone`] type (and others) as a string - * - * See the [Rust documentation for `TimeZoneFormatter`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html) for more information. - */ -class ICU4XTimeZoneFormatter { - public: - - /** - * Creates a new [`ICU4XTimeZoneFormatter`] from locale data. - * - * Uses localized GMT as the fallback format. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new_unstable) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html) - */ - static diplomat::result create_with_localized_gmt_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * Creates a new [`ICU4XTimeZoneFormatter`] from locale data. - * - * Uses ISO-8601 as the fallback format. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new_unstable) for more information. - * - * Additional information: [1](https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html) - */ - static diplomat::result create_with_iso_8601_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XIsoTimeZoneOptions options); - - /** - * Loads generic non-location long format. Example: "Pacific Time" - * - * See the [Rust documentation for `load_generic_non_location_long`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_generic_non_location_long) for more information. - */ - diplomat::result load_generic_non_location_long(const ICU4XDataProvider& provider); - - /** - * Loads generic non-location short format. Example: "PT" - * - * See the [Rust documentation for `load_generic_non_location_short`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_generic_non_location_short) for more information. - */ - diplomat::result load_generic_non_location_short(const ICU4XDataProvider& provider); - - /** - * Loads specific non-location long format. Example: "Pacific Standard Time" - * - * See the [Rust documentation for `load_specific_non_location_long`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_specific_non_location_long) for more information. - */ - diplomat::result load_specific_non_location_long(const ICU4XDataProvider& provider); - - /** - * Loads specific non-location short format. Example: "PST" - * - * See the [Rust documentation for `load_specific_non_location_short`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_specific_non_location_short) for more information. - */ - diplomat::result load_specific_non_location_short(const ICU4XDataProvider& provider); - - /** - * Loads generic location format. Example: "Los Angeles Time" - * - * See the [Rust documentation for `load_generic_location_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_generic_location_format) for more information. - */ - diplomat::result load_generic_location_format(const ICU4XDataProvider& provider); - - /** - * Loads localized GMT format. Example: "GMT-07:00" - * - * See the [Rust documentation for `load_localized_gmt_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_localized_gmt_format) for more information. - */ - diplomat::result load_localized_gmt_format(); - - /** - * Loads ISO-8601 format. Example: "-07:00" - * - * See the [Rust documentation for `load_iso_8601_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_iso_8601_format) for more information. - */ - diplomat::result load_iso_8601_format(ICU4XIsoTimeZoneOptions options); - - /** - * Formats a [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format) for more information. - * - * See the [Rust documentation for `format_to_string`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format_to_string) for more information. - */ - template diplomat::result format_custom_time_zone_to_writeable(const ICU4XCustomTimeZone& value, W& write) const; - - /** - * Formats a [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format) for more information. - * - * See the [Rust documentation for `format_to_string`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format_to_string) for more information. - */ - diplomat::result format_custom_time_zone(const ICU4XCustomTimeZone& value) const; - inline const capi::ICU4XTimeZoneFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XTimeZoneFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XTimeZoneFormatter(capi::ICU4XTimeZoneFormatter* i) : inner(i) {} - ICU4XTimeZoneFormatter() = default; - ICU4XTimeZoneFormatter(ICU4XTimeZoneFormatter&&) noexcept = default; - ICU4XTimeZoneFormatter& operator=(ICU4XTimeZoneFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XIsoTimeZoneOptions.hpp" -#include "ICU4XCustomTimeZone.hpp" - -inline diplomat::result ICU4XTimeZoneFormatter::create_with_localized_gmt_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XTimeZoneFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::create_with_iso_8601_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XIsoTimeZoneOptions options) { - ICU4XIsoTimeZoneOptions diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(provider.AsFFI(), locale.AsFFI(), capi::ICU4XIsoTimeZoneOptions{ .format = static_cast(diplomat_wrapped_struct_options.format), .minutes = static_cast(diplomat_wrapped_struct_options.minutes), .seconds = static_cast(diplomat_wrapped_struct_options.seconds) }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XTimeZoneFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_generic_non_location_long(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_generic_non_location_long(this->inner.get(), provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_generic_non_location_short(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_generic_non_location_short(this->inner.get(), provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_specific_non_location_long(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_specific_non_location_long(this->inner.get(), provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_specific_non_location_short(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_specific_non_location_short(this->inner.get(), provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_generic_location_format(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_generic_location_format(this->inner.get(), provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_localized_gmt_format() { - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_localized_gmt_format(this->inner.get()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::load_iso_8601_format(ICU4XIsoTimeZoneOptions options) { - ICU4XIsoTimeZoneOptions diplomat_wrapped_struct_options = options; - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_load_iso_8601_format(this->inner.get(), capi::ICU4XIsoTimeZoneOptions{ .format = static_cast(diplomat_wrapped_struct_options.format), .minutes = static_cast(diplomat_wrapped_struct_options.minutes), .seconds = static_cast(diplomat_wrapped_struct_options.seconds) }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XTimeZoneFormatter::format_custom_time_zone_to_writeable(const ICU4XCustomTimeZone& value, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_format_custom_time_zone(this->inner.get(), value.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XTimeZoneFormatter::format_custom_time_zone(const ICU4XCustomTimeZone& value) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XTimeZoneFormatter_format_custom_time_zone(this->inner.get(), value.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTransformResult.h b/third_party/rust/icu_capi/cpp/include/ICU4XTransformResult.h deleted file mode 100644 index 66b268e266a7..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTransformResult.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef ICU4XTransformResult_H -#define ICU4XTransformResult_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XTransformResult { - ICU4XTransformResult_Modified = 0, - ICU4XTransformResult_Unmodified = 1, -} ICU4XTransformResult; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XTransformResult_destroy(ICU4XTransformResult* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XTransformResult.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XTransformResult.hpp deleted file mode 100644 index 106025313b84..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XTransformResult.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ICU4XTransformResult_HPP -#define ICU4XTransformResult_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XTransformResult.h" - - - -/** - * FFI version of `TransformResult`. - * - * See the [Rust documentation for `TransformResult`](https://docs.rs/icu/latest/icu/locid_transform/enum.TransformResult.html) for more information. - */ -enum struct ICU4XTransformResult { - Modified = 0, - Unmodified = 1, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XUnicodeSetData.h b/third_party/rust/icu_capi/cpp/include/ICU4XUnicodeSetData.h deleted file mode 100644 index 3e10e53097e5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XUnicodeSetData.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef ICU4XUnicodeSetData_H -#define ICU4XUnicodeSetData_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XUnicodeSetData ICU4XUnicodeSetData; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h" -#include "ICU4XLocale.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -bool ICU4XUnicodeSetData_contains(const ICU4XUnicodeSetData* self, const char* s_data, size_t s_len); - -bool ICU4XUnicodeSetData_contains_char(const ICU4XUnicodeSetData* self, char32_t cp); - -bool ICU4XUnicodeSetData_contains32(const ICU4XUnicodeSetData* self, uint32_t cp); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_basic_emoji(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_main(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_auxiliary(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_punctuation(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_numbers(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -diplomat_result_box_ICU4XUnicodeSetData_ICU4XError ICU4XUnicodeSetData_load_exemplars_index(const ICU4XDataProvider* provider, const ICU4XLocale* locale); -void ICU4XUnicodeSetData_destroy(ICU4XUnicodeSetData* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XUnicodeSetData.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XUnicodeSetData.hpp deleted file mode 100644 index 9f12caa2e61e..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XUnicodeSetData.hpp +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef ICU4XUnicodeSetData_HPP -#define ICU4XUnicodeSetData_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XUnicodeSetData.h" - -class ICU4XDataProvider; -class ICU4XUnicodeSetData; -#include "ICU4XError.hpp" -class ICU4XLocale; - -/** - * A destruction policy for using ICU4XUnicodeSetData with std::unique_ptr. - */ -struct ICU4XUnicodeSetDataDeleter { - void operator()(capi::ICU4XUnicodeSetData* l) const noexcept { - capi::ICU4XUnicodeSetData_destroy(l); - } -}; - -/** - * An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property. - * - * See the [Rust documentation for `properties`](https://docs.rs/icu/latest/icu/properties/index.html) for more information. - * - * See the [Rust documentation for `UnicodeSetData`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetData.html) for more information. - * - * See the [Rust documentation for `UnicodeSetDataBorrowed`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html) for more information. - */ -class ICU4XUnicodeSetData { - public: - - /** - * Checks whether the string is in the set. - * - * See the [Rust documentation for `contains`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains) for more information. - */ - bool contains(const std::string_view s) const; - - /** - * Checks whether the code point is in the set. - * - * See the [Rust documentation for `contains_char`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains_char) for more information. - */ - bool contains_char(char32_t cp) const; - - /** - * Checks whether the code point (specified as a 32 bit integer, in UTF-32) is in the set. - */ - bool contains32(uint32_t cp) const; - - /** - * - * - * See the [Rust documentation for `load_basic_emoji`](https://docs.rs/icu/latest/icu/properties/sets/fn.load_basic_emoji.html) for more information. - */ - static diplomat::result load_basic_emoji(const ICU4XDataProvider& provider); - - /** - * - * - * See the [Rust documentation for `load_exemplars_main`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_main.html) for more information. - */ - static diplomat::result load_exemplars_main(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * - * - * See the [Rust documentation for `load_exemplars_auxiliary`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_auxiliary.html) for more information. - */ - static diplomat::result load_exemplars_auxiliary(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * - * - * See the [Rust documentation for `load_exemplars_punctuation`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_punctuation.html) for more information. - */ - static diplomat::result load_exemplars_punctuation(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * - * - * See the [Rust documentation for `load_exemplars_numbers`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_numbers.html) for more information. - */ - static diplomat::result load_exemplars_numbers(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * - * - * See the [Rust documentation for `load_exemplars_index`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_index.html) for more information. - */ - static diplomat::result load_exemplars_index(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - inline const capi::ICU4XUnicodeSetData* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XUnicodeSetData* AsFFIMut() { return this->inner.get(); } - inline ICU4XUnicodeSetData(capi::ICU4XUnicodeSetData* i) : inner(i) {} - ICU4XUnicodeSetData() = default; - ICU4XUnicodeSetData(ICU4XUnicodeSetData&&) noexcept = default; - ICU4XUnicodeSetData& operator=(ICU4XUnicodeSetData&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" - -inline bool ICU4XUnicodeSetData::contains(const std::string_view s) const { - return capi::ICU4XUnicodeSetData_contains(this->inner.get(), s.data(), s.size()); -} -inline bool ICU4XUnicodeSetData::contains_char(char32_t cp) const { - return capi::ICU4XUnicodeSetData_contains_char(this->inner.get(), cp); -} -inline bool ICU4XUnicodeSetData::contains32(uint32_t cp) const { - return capi::ICU4XUnicodeSetData_contains32(this->inner.get(), cp); -} -inline diplomat::result ICU4XUnicodeSetData::load_basic_emoji(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XUnicodeSetData_load_basic_emoji(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XUnicodeSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XUnicodeSetData::load_exemplars_main(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XUnicodeSetData_load_exemplars_main(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XUnicodeSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XUnicodeSetData::load_exemplars_auxiliary(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XUnicodeSetData_load_exemplars_auxiliary(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XUnicodeSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XUnicodeSetData::load_exemplars_punctuation(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XUnicodeSetData_load_exemplars_punctuation(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XUnicodeSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XUnicodeSetData::load_exemplars_numbers(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XUnicodeSetData_load_exemplars_numbers(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XUnicodeSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XUnicodeSetData::load_exemplars_index(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XUnicodeSetData_load_exemplars_index(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XUnicodeSetData(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWeekCalculator.h b/third_party/rust/icu_capi/cpp/include/ICU4XWeekCalculator.h deleted file mode 100644 index 02a52c6e87be..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWeekCalculator.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef ICU4XWeekCalculator_H -#define ICU4XWeekCalculator_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWeekCalculator ICU4XWeekCalculator; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h" -#include "ICU4XIsoWeekday.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XWeekCalculator_ICU4XError ICU4XWeekCalculator_create(const ICU4XDataProvider* provider, const ICU4XLocale* locale); - -ICU4XWeekCalculator* ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(ICU4XIsoWeekday first_weekday, uint8_t min_week_days); - -ICU4XIsoWeekday ICU4XWeekCalculator_first_weekday(const ICU4XWeekCalculator* self); - -uint8_t ICU4XWeekCalculator_min_week_days(const ICU4XWeekCalculator* self); -void ICU4XWeekCalculator_destroy(ICU4XWeekCalculator* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWeekCalculator.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWeekCalculator.hpp deleted file mode 100644 index 807fee141e01..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWeekCalculator.hpp +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef ICU4XWeekCalculator_HPP -#define ICU4XWeekCalculator_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWeekCalculator.h" - -class ICU4XDataProvider; -class ICU4XLocale; -class ICU4XWeekCalculator; -#include "ICU4XError.hpp" -#include "ICU4XIsoWeekday.hpp" - -/** - * A destruction policy for using ICU4XWeekCalculator with std::unique_ptr. - */ -struct ICU4XWeekCalculatorDeleter { - void operator()(capi::ICU4XWeekCalculator* l) const noexcept { - capi::ICU4XWeekCalculator_destroy(l); - } -}; - -/** - * A Week calculator, useful to be passed in to `week_of_year()` on Date and DateTime types - * - * See the [Rust documentation for `WeekCalculator`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html) for more information. - */ -class ICU4XWeekCalculator { - public: - - /** - * Creates a new [`ICU4XWeekCalculator`] from locale data. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.try_new_unstable) for more information. - */ - static diplomat::result create(const ICU4XDataProvider& provider, const ICU4XLocale& locale); - - /** - * - * - * Additional information: [1](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday), [2](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days) - */ - static ICU4XWeekCalculator create_from_first_day_of_week_and_min_week_days(ICU4XIsoWeekday first_weekday, uint8_t min_week_days); - - /** - * Returns the weekday that starts the week for this object's locale - * - * See the [Rust documentation for `first_weekday`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday) for more information. - */ - ICU4XIsoWeekday first_weekday() const; - - /** - * The minimum number of days overlapping a year required for a week to be - * considered part of that year - * - * See the [Rust documentation for `min_week_days`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days) for more information. - */ - uint8_t min_week_days() const; - inline const capi::ICU4XWeekCalculator* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XWeekCalculator* AsFFIMut() { return this->inner.get(); } - inline ICU4XWeekCalculator(capi::ICU4XWeekCalculator* i) : inner(i) {} - ICU4XWeekCalculator() = default; - ICU4XWeekCalculator(ICU4XWeekCalculator&&) noexcept = default; - ICU4XWeekCalculator& operator=(ICU4XWeekCalculator&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" - -inline diplomat::result ICU4XWeekCalculator::create(const ICU4XDataProvider& provider, const ICU4XLocale& locale) { - auto diplomat_result_raw_out_value = capi::ICU4XWeekCalculator_create(provider.AsFFI(), locale.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWeekCalculator(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XWeekCalculator ICU4XWeekCalculator::create_from_first_day_of_week_and_min_week_days(ICU4XIsoWeekday first_weekday, uint8_t min_week_days) { - return ICU4XWeekCalculator(capi::ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(static_cast(first_weekday), min_week_days)); -} -inline ICU4XIsoWeekday ICU4XWeekCalculator::first_weekday() const { - return static_cast(capi::ICU4XWeekCalculator_first_weekday(this->inner.get())); -} -inline uint8_t ICU4XWeekCalculator::min_week_days() const { - return capi::ICU4XWeekCalculator_min_week_days(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWeekOf.h b/third_party/rust/icu_capi/cpp/include/ICU4XWeekOf.h deleted file mode 100644 index 5441b943d41f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWeekOf.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ICU4XWeekOf_H -#define ICU4XWeekOf_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XWeekRelativeUnit.h" -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWeekOf { - uint16_t week; - ICU4XWeekRelativeUnit unit; -} ICU4XWeekOf; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XWeekRelativeUnit.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XWeekOf_destroy(ICU4XWeekOf* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWeekOf.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWeekOf.hpp deleted file mode 100644 index 9f76ad73b642..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWeekOf.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef ICU4XWeekOf_HPP -#define ICU4XWeekOf_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWeekOf.h" - -#include "ICU4XWeekRelativeUnit.hpp" - - -/** - * - * - * See the [Rust documentation for `WeekOf`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekOf.html) for more information. - */ -struct ICU4XWeekOf { - public: - uint16_t week; - ICU4XWeekRelativeUnit unit; -}; - - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWeekRelativeUnit.h b/third_party/rust/icu_capi/cpp/include/ICU4XWeekRelativeUnit.h deleted file mode 100644 index ee6802dc3b37..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWeekRelativeUnit.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef ICU4XWeekRelativeUnit_H -#define ICU4XWeekRelativeUnit_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef enum ICU4XWeekRelativeUnit { - ICU4XWeekRelativeUnit_Previous = 0, - ICU4XWeekRelativeUnit_Current = 1, - ICU4XWeekRelativeUnit_Next = 2, -} ICU4XWeekRelativeUnit; -#ifdef __cplusplus -} // namespace capi -#endif -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -void ICU4XWeekRelativeUnit_destroy(ICU4XWeekRelativeUnit* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWeekRelativeUnit.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWeekRelativeUnit.hpp deleted file mode 100644 index 93ff7504257c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWeekRelativeUnit.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ICU4XWeekRelativeUnit_HPP -#define ICU4XWeekRelativeUnit_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWeekRelativeUnit.h" - - - -/** - * - * - * See the [Rust documentation for `RelativeUnit`](https://docs.rs/icu/latest/icu/calendar/week/enum.RelativeUnit.html) for more information. - */ -enum struct ICU4XWeekRelativeUnit { - Previous = 0, - Current = 1, - Next = 2, -}; - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.h b/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.h deleted file mode 100644 index 112025bdf510..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XWordBreakIteratorLatin1_H -#define ICU4XWordBreakIteratorLatin1_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordBreakIteratorLatin1 ICU4XWordBreakIteratorLatin1; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XSegmenterWordType.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XWordBreakIteratorLatin1_next(ICU4XWordBreakIteratorLatin1* self); - -ICU4XSegmenterWordType ICU4XWordBreakIteratorLatin1_word_type(const ICU4XWordBreakIteratorLatin1* self); - -bool ICU4XWordBreakIteratorLatin1_is_word_like(const ICU4XWordBreakIteratorLatin1* self); -void ICU4XWordBreakIteratorLatin1_destroy(ICU4XWordBreakIteratorLatin1* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp deleted file mode 100644 index e4056d8e9fed..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorLatin1.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef ICU4XWordBreakIteratorLatin1_HPP -#define ICU4XWordBreakIteratorLatin1_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWordBreakIteratorLatin1.h" - -#include "ICU4XSegmenterWordType.hpp" - -/** - * A destruction policy for using ICU4XWordBreakIteratorLatin1 with std::unique_ptr. - */ -struct ICU4XWordBreakIteratorLatin1Deleter { - void operator()(capi::ICU4XWordBreakIteratorLatin1* l) const noexcept { - capi::ICU4XWordBreakIteratorLatin1_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html) for more information. - */ -class ICU4XWordBreakIteratorLatin1 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next) for more information. - */ - int32_t next(); - - /** - * Return the status value of break boundary. - * - * See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information. - */ - ICU4XSegmenterWordType word_type() const; - - /** - * Return true when break boundary is word-like such as letter/number/CJK - * - * See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information. - */ - bool is_word_like() const; - inline const capi::ICU4XWordBreakIteratorLatin1* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XWordBreakIteratorLatin1* AsFFIMut() { return this->inner.get(); } - inline ICU4XWordBreakIteratorLatin1(capi::ICU4XWordBreakIteratorLatin1* i) : inner(i) {} - ICU4XWordBreakIteratorLatin1() = default; - ICU4XWordBreakIteratorLatin1(ICU4XWordBreakIteratorLatin1&&) noexcept = default; - ICU4XWordBreakIteratorLatin1& operator=(ICU4XWordBreakIteratorLatin1&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XWordBreakIteratorLatin1::next() { - return capi::ICU4XWordBreakIteratorLatin1_next(this->inner.get()); -} -inline ICU4XSegmenterWordType ICU4XWordBreakIteratorLatin1::word_type() const { - return static_cast(capi::ICU4XWordBreakIteratorLatin1_word_type(this->inner.get())); -} -inline bool ICU4XWordBreakIteratorLatin1::is_word_like() const { - return capi::ICU4XWordBreakIteratorLatin1_is_word_like(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.h b/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.h deleted file mode 100644 index 676aea3cff49..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XWordBreakIteratorUtf16_H -#define ICU4XWordBreakIteratorUtf16_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordBreakIteratorUtf16 ICU4XWordBreakIteratorUtf16; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XSegmenterWordType.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XWordBreakIteratorUtf16_next(ICU4XWordBreakIteratorUtf16* self); - -ICU4XSegmenterWordType ICU4XWordBreakIteratorUtf16_word_type(const ICU4XWordBreakIteratorUtf16* self); - -bool ICU4XWordBreakIteratorUtf16_is_word_like(const ICU4XWordBreakIteratorUtf16* self); -void ICU4XWordBreakIteratorUtf16_destroy(ICU4XWordBreakIteratorUtf16* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp deleted file mode 100644 index b825e1c63689..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf16.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef ICU4XWordBreakIteratorUtf16_HPP -#define ICU4XWordBreakIteratorUtf16_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWordBreakIteratorUtf16.h" - -#include "ICU4XSegmenterWordType.hpp" - -/** - * A destruction policy for using ICU4XWordBreakIteratorUtf16 with std::unique_ptr. - */ -struct ICU4XWordBreakIteratorUtf16Deleter { - void operator()(capi::ICU4XWordBreakIteratorUtf16* l) const noexcept { - capi::ICU4XWordBreakIteratorUtf16_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html) for more information. - */ -class ICU4XWordBreakIteratorUtf16 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next) for more information. - */ - int32_t next(); - - /** - * Return the status value of break boundary. - * - * See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information. - */ - ICU4XSegmenterWordType word_type() const; - - /** - * Return true when break boundary is word-like such as letter/number/CJK - * - * See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information. - */ - bool is_word_like() const; - inline const capi::ICU4XWordBreakIteratorUtf16* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XWordBreakIteratorUtf16* AsFFIMut() { return this->inner.get(); } - inline ICU4XWordBreakIteratorUtf16(capi::ICU4XWordBreakIteratorUtf16* i) : inner(i) {} - ICU4XWordBreakIteratorUtf16() = default; - ICU4XWordBreakIteratorUtf16(ICU4XWordBreakIteratorUtf16&&) noexcept = default; - ICU4XWordBreakIteratorUtf16& operator=(ICU4XWordBreakIteratorUtf16&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XWordBreakIteratorUtf16::next() { - return capi::ICU4XWordBreakIteratorUtf16_next(this->inner.get()); -} -inline ICU4XSegmenterWordType ICU4XWordBreakIteratorUtf16::word_type() const { - return static_cast(capi::ICU4XWordBreakIteratorUtf16_word_type(this->inner.get())); -} -inline bool ICU4XWordBreakIteratorUtf16::is_word_like() const { - return capi::ICU4XWordBreakIteratorUtf16_is_word_like(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.h b/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.h deleted file mode 100644 index d8e98fb9b19d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef ICU4XWordBreakIteratorUtf8_H -#define ICU4XWordBreakIteratorUtf8_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordBreakIteratorUtf8 ICU4XWordBreakIteratorUtf8; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XSegmenterWordType.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -int32_t ICU4XWordBreakIteratorUtf8_next(ICU4XWordBreakIteratorUtf8* self); - -ICU4XSegmenterWordType ICU4XWordBreakIteratorUtf8_word_type(const ICU4XWordBreakIteratorUtf8* self); - -bool ICU4XWordBreakIteratorUtf8_is_word_like(const ICU4XWordBreakIteratorUtf8* self); -void ICU4XWordBreakIteratorUtf8_destroy(ICU4XWordBreakIteratorUtf8* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp deleted file mode 100644 index 0c581884ae66..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordBreakIteratorUtf8.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef ICU4XWordBreakIteratorUtf8_HPP -#define ICU4XWordBreakIteratorUtf8_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWordBreakIteratorUtf8.h" - -#include "ICU4XSegmenterWordType.hpp" - -/** - * A destruction policy for using ICU4XWordBreakIteratorUtf8 with std::unique_ptr. - */ -struct ICU4XWordBreakIteratorUtf8Deleter { - void operator()(capi::ICU4XWordBreakIteratorUtf8* l) const noexcept { - capi::ICU4XWordBreakIteratorUtf8_destroy(l); - } -}; - -/** - * - * - * See the [Rust documentation for `WordBreakIterator`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html) for more information. - */ -class ICU4XWordBreakIteratorUtf8 { - public: - - /** - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is - * out of range of a 32-bit signed integer. - * - * See the [Rust documentation for `next`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next) for more information. - */ - int32_t next(); - - /** - * Return the status value of break boundary. - * - * See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information. - */ - ICU4XSegmenterWordType word_type() const; - - /** - * Return true when break boundary is word-like such as letter/number/CJK - * - * See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information. - */ - bool is_word_like() const; - inline const capi::ICU4XWordBreakIteratorUtf8* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XWordBreakIteratorUtf8* AsFFIMut() { return this->inner.get(); } - inline ICU4XWordBreakIteratorUtf8(capi::ICU4XWordBreakIteratorUtf8* i) : inner(i) {} - ICU4XWordBreakIteratorUtf8() = default; - ICU4XWordBreakIteratorUtf8(ICU4XWordBreakIteratorUtf8&&) noexcept = default; - ICU4XWordBreakIteratorUtf8& operator=(ICU4XWordBreakIteratorUtf8&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - - -inline int32_t ICU4XWordBreakIteratorUtf8::next() { - return capi::ICU4XWordBreakIteratorUtf8_next(this->inner.get()); -} -inline ICU4XSegmenterWordType ICU4XWordBreakIteratorUtf8::word_type() const { - return static_cast(capi::ICU4XWordBreakIteratorUtf8_word_type(this->inner.get())); -} -inline bool ICU4XWordBreakIteratorUtf8::is_word_like() const { - return capi::ICU4XWordBreakIteratorUtf8_is_word_like(this->inner.get()); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordSegmenter.h b/third_party/rust/icu_capi/cpp/include/ICU4XWordSegmenter.h deleted file mode 100644 index 5bef9437e092..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordSegmenter.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef ICU4XWordSegmenter_H -#define ICU4XWordSegmenter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XWordSegmenter ICU4XWordSegmenter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h" -#include "ICU4XWordBreakIteratorUtf8.h" -#include "ICU4XWordBreakIteratorUtf16.h" -#include "ICU4XWordBreakIteratorLatin1.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XWordSegmenter_ICU4XError ICU4XWordSegmenter_create_auto(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XWordSegmenter_ICU4XError ICU4XWordSegmenter_create_lstm(const ICU4XDataProvider* provider); - -diplomat_result_box_ICU4XWordSegmenter_ICU4XError ICU4XWordSegmenter_create_dictionary(const ICU4XDataProvider* provider); - -ICU4XWordBreakIteratorUtf8* ICU4XWordSegmenter_segment_utf8(const ICU4XWordSegmenter* self, const char* input_data, size_t input_len); - -ICU4XWordBreakIteratorUtf16* ICU4XWordSegmenter_segment_utf16(const ICU4XWordSegmenter* self, const uint16_t* input_data, size_t input_len); - -ICU4XWordBreakIteratorLatin1* ICU4XWordSegmenter_segment_latin1(const ICU4XWordSegmenter* self, const uint8_t* input_data, size_t input_len); -void ICU4XWordSegmenter_destroy(ICU4XWordSegmenter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XWordSegmenter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XWordSegmenter.hpp deleted file mode 100644 index d8bbfe923b45..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XWordSegmenter.hpp +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef ICU4XWordSegmenter_HPP -#define ICU4XWordSegmenter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XWordSegmenter.h" - -class ICU4XDataProvider; -class ICU4XWordSegmenter; -#include "ICU4XError.hpp" -class ICU4XWordBreakIteratorUtf8; -class ICU4XWordBreakIteratorUtf16; -class ICU4XWordBreakIteratorLatin1; - -/** - * A destruction policy for using ICU4XWordSegmenter with std::unique_ptr. - */ -struct ICU4XWordSegmenterDeleter { - void operator()(capi::ICU4XWordSegmenter* l) const noexcept { - capi::ICU4XWordSegmenter_destroy(l); - } -}; - -/** - * An ICU4X word-break segmenter, capable of finding word breakpoints in strings. - * - * See the [Rust documentation for `WordSegmenter`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html) for more information. - */ -class ICU4XWordSegmenter { - public: - - /** - * Construct an [`ICU4XWordSegmenter`] with automatically selecting the best available LSTM - * or dictionary payload data. - * - * Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese, - * Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_auto_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.try_new_auto_unstable) for more information. - */ - static diplomat::result create_auto(const ICU4XDataProvider& provider); - - /** - * Construct an [`ICU4XWordSegmenter`] with LSTM payload data for Burmese, Khmer, Lao, and - * Thai. - * - * Warning: [`ICU4XWordSegmenter`] created by this function doesn't handle Chinese or - * Japanese. - * - * See the [Rust documentation for `try_new_lstm_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.try_new_lstm_unstable) for more information. - */ - static diplomat::result create_lstm(const ICU4XDataProvider& provider); - - /** - * Construct an [`ICU4XWordSegmenter`] with dictionary payload data for Chinese, Japanese, - * Burmese, Khmer, Lao, and Thai. - * - * See the [Rust documentation for `try_new_dictionary_unstable`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.try_new_dictionary_unstable) for more information. - */ - static diplomat::result create_dictionary(const ICU4XDataProvider& provider); - - /** - * Segments a (potentially ill-formed) UTF-8 string. - * - * See the [Rust documentation for `segment_utf8`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_utf8) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XWordBreakIteratorUtf8 segment_utf8(const std::string_view input) const; - - /** - * Segments a UTF-16 string. - * - * See the [Rust documentation for `segment_utf16`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_utf16) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XWordBreakIteratorUtf16 segment_utf16(const diplomat::span input) const; - - /** - * Segments a Latin-1 string. - * - * See the [Rust documentation for `segment_latin1`](https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_latin1) for more information. - * - * Lifetimes: `this`, `input` must live at least as long as the output. - */ - ICU4XWordBreakIteratorLatin1 segment_latin1(const diplomat::span input) const; - inline const capi::ICU4XWordSegmenter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XWordSegmenter* AsFFIMut() { return this->inner.get(); } - inline ICU4XWordSegmenter(capi::ICU4XWordSegmenter* i) : inner(i) {} - ICU4XWordSegmenter() = default; - ICU4XWordSegmenter(ICU4XWordSegmenter&&) noexcept = default; - ICU4XWordSegmenter& operator=(ICU4XWordSegmenter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XWordBreakIteratorUtf8.hpp" -#include "ICU4XWordBreakIteratorUtf16.hpp" -#include "ICU4XWordBreakIteratorLatin1.hpp" - -inline diplomat::result ICU4XWordSegmenter::create_auto(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XWordSegmenter_create_auto(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWordSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XWordSegmenter::create_lstm(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XWordSegmenter_create_lstm(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWordSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XWordSegmenter::create_dictionary(const ICU4XDataProvider& provider) { - auto diplomat_result_raw_out_value = capi::ICU4XWordSegmenter_create_dictionary(provider.AsFFI()); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XWordSegmenter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline ICU4XWordBreakIteratorUtf8 ICU4XWordSegmenter::segment_utf8(const std::string_view input) const { - return ICU4XWordBreakIteratorUtf8(capi::ICU4XWordSegmenter_segment_utf8(this->inner.get(), input.data(), input.size())); -} -inline ICU4XWordBreakIteratorUtf16 ICU4XWordSegmenter::segment_utf16(const diplomat::span input) const { - return ICU4XWordBreakIteratorUtf16(capi::ICU4XWordSegmenter_segment_utf16(this->inner.get(), input.data(), input.size())); -} -inline ICU4XWordBreakIteratorLatin1 ICU4XWordSegmenter::segment_latin1(const diplomat::span input) const { - return ICU4XWordBreakIteratorLatin1(capi::ICU4XWordSegmenter_segment_latin1(this->inner.get(), input.data(), input.size())); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XZonedDateTimeFormatter.h b/third_party/rust/icu_capi/cpp/include/ICU4XZonedDateTimeFormatter.h deleted file mode 100644 index 77b228a5a2cf..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XZonedDateTimeFormatter.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ICU4XZonedDateTimeFormatter_H -#define ICU4XZonedDateTimeFormatter_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -#endif - -typedef struct ICU4XZonedDateTimeFormatter ICU4XZonedDateTimeFormatter; -#ifdef __cplusplus -} // namespace capi -#endif -#include "ICU4XDataProvider.h" -#include "ICU4XLocale.h" -#include "ICU4XDateLength.h" -#include "ICU4XTimeLength.h" -#include "diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h" -#include "ICU4XIsoTimeZoneOptions.h" -#include "ICU4XDateTime.h" -#include "ICU4XCustomTimeZone.h" -#include "diplomat_result_void_ICU4XError.h" -#include "ICU4XIsoDateTime.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError ICU4XZonedDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - -diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options); - -diplomat_result_void_ICU4XError ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(const ICU4XZonedDateTimeFormatter* self, const ICU4XDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write); - -diplomat_result_void_ICU4XError ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(const ICU4XZonedDateTimeFormatter* self, const ICU4XIsoDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write); -void ICU4XZonedDateTimeFormatter_destroy(ICU4XZonedDateTimeFormatter* self); - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/ICU4XZonedDateTimeFormatter.hpp b/third_party/rust/icu_capi/cpp/include/ICU4XZonedDateTimeFormatter.hpp deleted file mode 100644 index 9c2ee8a90a6c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/ICU4XZonedDateTimeFormatter.hpp +++ /dev/null @@ -1,173 +0,0 @@ -#ifndef ICU4XZonedDateTimeFormatter_HPP -#define ICU4XZonedDateTimeFormatter_HPP -#include -#include -#include -#include -#include -#include -#include -#include "diplomat_runtime.hpp" - -#include "ICU4XZonedDateTimeFormatter.h" - -class ICU4XDataProvider; -class ICU4XLocale; -#include "ICU4XDateLength.hpp" -#include "ICU4XTimeLength.hpp" -class ICU4XZonedDateTimeFormatter; -#include "ICU4XError.hpp" -struct ICU4XIsoTimeZoneOptions; -class ICU4XDateTime; -class ICU4XCustomTimeZone; -class ICU4XIsoDateTime; - -/** - * A destruction policy for using ICU4XZonedDateTimeFormatter with std::unique_ptr. - */ -struct ICU4XZonedDateTimeFormatterDeleter { - void operator()(capi::ICU4XZonedDateTimeFormatter* l) const noexcept { - capi::ICU4XZonedDateTimeFormatter_destroy(l); - } -}; - -/** - * An object capable of formatting a date time with time zone to a string. - * - * See the [Rust documentation for `ZonedDateTimeFormatter`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html) for more information. - */ -class ICU4XZonedDateTimeFormatter { - public: - - /** - * Creates a new [`ICU4XZonedDateTimeFormatter`] from locale data. - * - * This function has `date_length` and `time_length` arguments and uses default options - * for the time zone. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length); - - /** - * Creates a new [`ICU4XZonedDateTimeFormatter`] from locale data. - * - * This function has `date_length` and `time_length` arguments and uses an ISO-8601 style - * fallback for the time zone with the given configurations. - * - * See the [Rust documentation for `try_new_unstable`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new_unstable) for more information. - */ - static diplomat::result create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options); - - /** - * Formats a [`ICU4XDateTime`] and [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_datetime_with_custom_time_zone_to_writeable(const ICU4XDateTime& datetime, const ICU4XCustomTimeZone& time_zone, W& write) const; - - /** - * Formats a [`ICU4XDateTime`] and [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information. - */ - diplomat::result format_datetime_with_custom_time_zone(const ICU4XDateTime& datetime, const ICU4XCustomTimeZone& time_zone) const; - - /** - * Formats a [`ICU4XIsoDateTime`] and [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information. - */ - template diplomat::result format_iso_datetime_with_custom_time_zone_to_writeable(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone, W& write) const; - - /** - * Formats a [`ICU4XIsoDateTime`] and [`ICU4XCustomTimeZone`] to a string. - * - * See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information. - */ - diplomat::result format_iso_datetime_with_custom_time_zone(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone) const; - inline const capi::ICU4XZonedDateTimeFormatter* AsFFI() const { return this->inner.get(); } - inline capi::ICU4XZonedDateTimeFormatter* AsFFIMut() { return this->inner.get(); } - inline ICU4XZonedDateTimeFormatter(capi::ICU4XZonedDateTimeFormatter* i) : inner(i) {} - ICU4XZonedDateTimeFormatter() = default; - ICU4XZonedDateTimeFormatter(ICU4XZonedDateTimeFormatter&&) noexcept = default; - ICU4XZonedDateTimeFormatter& operator=(ICU4XZonedDateTimeFormatter&& other) noexcept = default; - private: - std::unique_ptr inner; -}; - -#include "ICU4XDataProvider.hpp" -#include "ICU4XLocale.hpp" -#include "ICU4XIsoTimeZoneOptions.hpp" -#include "ICU4XDateTime.hpp" -#include "ICU4XCustomTimeZone.hpp" -#include "ICU4XIsoDateTime.hpp" - -inline diplomat::result ICU4XZonedDateTimeFormatter::create_with_lengths(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length) { - auto diplomat_result_raw_out_value = capi::ICU4XZonedDateTimeFormatter_create_with_lengths(provider.AsFFI(), locale.AsFFI(), static_cast(date_length), static_cast(time_length)); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XZonedDateTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XZonedDateTimeFormatter::create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider& provider, const ICU4XLocale& locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options) { - ICU4XIsoTimeZoneOptions diplomat_wrapped_struct_zone_options = zone_options; - auto diplomat_result_raw_out_value = capi::ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(provider.AsFFI(), locale.AsFFI(), static_cast(date_length), static_cast(time_length), capi::ICU4XIsoTimeZoneOptions{ .format = static_cast(diplomat_wrapped_struct_zone_options.format), .minutes = static_cast(diplomat_wrapped_struct_zone_options.minutes), .seconds = static_cast(diplomat_wrapped_struct_zone_options.seconds) }); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::move(ICU4XZonedDateTimeFormatter(diplomat_result_raw_out_value.ok))); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -template inline diplomat::result ICU4XZonedDateTimeFormatter::format_datetime_with_custom_time_zone_to_writeable(const ICU4XDateTime& datetime, const ICU4XCustomTimeZone& time_zone, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(this->inner.get(), datetime.AsFFI(), time_zone.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XZonedDateTimeFormatter::format_datetime_with_custom_time_zone(const ICU4XDateTime& datetime, const ICU4XCustomTimeZone& time_zone) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(this->inner.get(), datetime.AsFFI(), time_zone.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -template inline diplomat::result ICU4XZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone_to_writeable(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone, W& write) const { - capi::DiplomatWriteable write_writer = diplomat::WriteableTrait::Construct(write); - auto diplomat_result_raw_out_value = capi::ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(this->inner.get(), datetime.AsFFI(), time_zone.AsFFI(), &write_writer); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value; -} -inline diplomat::result ICU4XZonedDateTimeFormatter::format_iso_datetime_with_custom_time_zone(const ICU4XIsoDateTime& datetime, const ICU4XCustomTimeZone& time_zone) const { - std::string diplomat_writeable_string; - capi::DiplomatWriteable diplomat_writeable_out = diplomat::WriteableFromString(diplomat_writeable_string); - auto diplomat_result_raw_out_value = capi::ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(this->inner.get(), datetime.AsFFI(), time_zone.AsFFI(), &diplomat_writeable_out); - diplomat::result diplomat_result_out_value; - if (diplomat_result_raw_out_value.is_ok) { - diplomat_result_out_value = diplomat::Ok(std::monostate()); - } else { - diplomat_result_out_value = diplomat::Err(std::move(static_cast(diplomat_result_raw_out_value.err))); - } - return diplomat_result_out_value.replace_ok(std::move(diplomat_writeable_string)); -} -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XAnyCalendarKind_void.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XAnyCalendarKind_void.h deleted file mode 100644 index f67f66ed4db4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XAnyCalendarKind_void.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef diplomat_result_ICU4XAnyCalendarKind_void_H -#define diplomat_result_ICU4XAnyCalendarKind_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XAnyCalendarKind.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_ICU4XAnyCalendarKind_void { - union { - ICU4XAnyCalendarKind ok; - }; - bool is_ok; -} diplomat_result_ICU4XAnyCalendarKind_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XPluralCategory_void.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XPluralCategory_void.h deleted file mode 100644 index b56ef60acb7f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XPluralCategory_void.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef diplomat_result_ICU4XPluralCategory_void_H -#define diplomat_result_ICU4XPluralCategory_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XPluralCategory.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_ICU4XPluralCategory_void { - union { - ICU4XPluralCategory ok; - }; - bool is_ok; -} diplomat_result_ICU4XPluralCategory_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XWeekOf_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XWeekOf_ICU4XError.h deleted file mode 100644 index 4dee8f941f70..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_ICU4XWeekOf_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_ICU4XWeekOf_ICU4XError_H -#define diplomat_result_ICU4XWeekOf_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XWeekOf.h" -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_ICU4XWeekOf_ICU4XError { - union { - ICU4XWeekOf ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_ICU4XWeekOf_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_bool_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_bool_ICU4XError.h deleted file mode 100644 index 015930214da6..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_bool_ICU4XError.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef diplomat_result_bool_ICU4XError_H -#define diplomat_result_bool_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_bool_ICU4XError { - union { - bool ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_bool_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XBidi_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XBidi_ICU4XError.h deleted file mode 100644 index f1cd7ca6a30d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XBidi_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XBidi_ICU4XError_H -#define diplomat_result_box_ICU4XBidi_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XBidi ICU4XBidi; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XBidi_ICU4XError { - union { - ICU4XBidi* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XBidi_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h deleted file mode 100644 index bffa22c6b027..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCalendar_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCalendar_ICU4XError_H -#define diplomat_result_box_ICU4XCalendar_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCalendar ICU4XCalendar; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCalendar_ICU4XError { - union { - ICU4XCalendar* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCalendar_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h deleted file mode 100644 index 2c05f7967151..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError_H -#define diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCanonicalCombiningClassMap ICU4XCanonicalCombiningClassMap; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError { - union { - ICU4XCanonicalCombiningClassMap* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h deleted file mode 100644 index 66d0386ff8b0..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCanonicalComposition_ICU4XError_H -#define diplomat_result_box_ICU4XCanonicalComposition_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCanonicalComposition ICU4XCanonicalComposition; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCanonicalComposition_ICU4XError { - union { - ICU4XCanonicalComposition* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCanonicalComposition_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h deleted file mode 100644 index cf02637fef0f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError_H -#define diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCanonicalDecomposition ICU4XCanonicalDecomposition; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError { - union { - ICU4XCanonicalDecomposition* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h deleted file mode 100644 index fbe11daad2e1..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCodePointMapData16_ICU4XError_H -#define diplomat_result_box_ICU4XCodePointMapData16_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCodePointMapData16 ICU4XCodePointMapData16; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCodePointMapData16_ICU4XError { - union { - ICU4XCodePointMapData16* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCodePointMapData16_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h deleted file mode 100644 index 2e203279e3b8..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCodePointMapData8_ICU4XError_H -#define diplomat_result_box_ICU4XCodePointMapData8_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCodePointMapData8 ICU4XCodePointMapData8; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCodePointMapData8_ICU4XError { - union { - ICU4XCodePointMapData8* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCodePointMapData8_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h deleted file mode 100644 index e70e39ba61dc..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCodePointSetData_ICU4XError_H -#define diplomat_result_box_ICU4XCodePointSetData_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCodePointSetData ICU4XCodePointSetData; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCodePointSetData_ICU4XError { - union { - ICU4XCodePointSetData* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCodePointSetData_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCollator_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCollator_ICU4XError.h deleted file mode 100644 index abb5c8a59839..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCollator_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCollator_ICU4XError_H -#define diplomat_result_box_ICU4XCollator_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCollator ICU4XCollator; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCollator_ICU4XError { - union { - ICU4XCollator* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCollator_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h deleted file mode 100644 index d0c381ef039c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XComposingNormalizer_ICU4XError_H -#define diplomat_result_box_ICU4XComposingNormalizer_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XComposingNormalizer ICU4XComposingNormalizer; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XComposingNormalizer_ICU4XError { - union { - ICU4XComposingNormalizer* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XComposingNormalizer_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h deleted file mode 100644 index 4709a89871e5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XCustomTimeZone_ICU4XError_H -#define diplomat_result_box_ICU4XCustomTimeZone_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XCustomTimeZone ICU4XCustomTimeZone; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XCustomTimeZone_ICU4XError { - union { - ICU4XCustomTimeZone* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XCustomTimeZone_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h deleted file mode 100644 index a5be84418382..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDataProvider_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDataProvider_ICU4XError_H -#define diplomat_result_box_ICU4XDataProvider_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDataProvider ICU4XDataProvider; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDataProvider_ICU4XError { - union { - ICU4XDataProvider* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDataProvider_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h deleted file mode 100644 index d8c1d33e2107..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDataStruct_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDataStruct_ICU4XError_H -#define diplomat_result_box_ICU4XDataStruct_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDataStruct ICU4XDataStruct; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDataStruct_ICU4XError { - union { - ICU4XDataStruct* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDataStruct_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h deleted file mode 100644 index b6d9671434c5..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDateFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XDateFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDateFormatter ICU4XDateFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDateFormatter_ICU4XError { - union { - ICU4XDateFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDateFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 855e74fe6c06..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDateTimeFormatter ICU4XDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError { - union { - ICU4XDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h deleted file mode 100644 index 2d4cb2fe4840..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDateTime_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDateTime_ICU4XError_H -#define diplomat_result_box_ICU4XDateTime_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDateTime ICU4XDateTime; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDateTime_ICU4XError { - union { - ICU4XDateTime* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDateTime_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDate_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDate_ICU4XError.h deleted file mode 100644 index 30461b264a65..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDate_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDate_ICU4XError_H -#define diplomat_result_box_ICU4XDate_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDate ICU4XDate; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDate_ICU4XError { - union { - ICU4XDate* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDate_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h deleted file mode 100644 index c51d9907bc9f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError_H -#define diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XDecomposingNormalizer ICU4XDecomposingNormalizer; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError { - union { - ICU4XDecomposingNormalizer* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h deleted file mode 100644 index 8ee245a09336..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XFixedDecimalFormatter ICU4XFixedDecimalFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError { - union { - ICU4XFixedDecimalFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h deleted file mode 100644 index f45cd78fb93b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XFixedDecimal_ICU4XError_H -#define diplomat_result_box_ICU4XFixedDecimal_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XFixedDecimal ICU4XFixedDecimal; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XFixedDecimal_ICU4XError { - union { - ICU4XFixedDecimal* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XFixedDecimal_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h deleted file mode 100644 index 98ff137a9a3c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError_H -#define diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGeneralCategoryNameToMaskMapper ICU4XGeneralCategoryNameToMaskMapper; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError { - union { - ICU4XGeneralCategoryNameToMaskMapper* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h deleted file mode 100644 index d560b381a59d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGraphemeClusterSegmenter ICU4XGraphemeClusterSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError { - union { - ICU4XGraphemeClusterSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h deleted file mode 100644 index 86b13be9121b..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGregorianDateFormatter ICU4XGregorianDateFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError { - union { - ICU4XGregorianDateFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 4393d9ffb0fb..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGregorianDateTimeFormatter ICU4XGregorianDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError { - union { - ICU4XGregorianDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 270b38ba94ce..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XGregorianZonedDateTimeFormatter ICU4XGregorianZonedDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError { - union { - ICU4XGregorianZonedDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h deleted file mode 100644 index 8a55b47a68b0..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XIsoDateTime_ICU4XError_H -#define diplomat_result_box_ICU4XIsoDateTime_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XIsoDateTime ICU4XIsoDateTime; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XIsoDateTime_ICU4XError { - union { - ICU4XIsoDateTime* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XIsoDateTime_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h deleted file mode 100644 index 8528d73b0721..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XIsoDate_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XIsoDate_ICU4XError_H -#define diplomat_result_box_ICU4XIsoDate_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XIsoDate ICU4XIsoDate; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XIsoDate_ICU4XError { - union { - ICU4XIsoDate* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XIsoDate_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h deleted file mode 100644 index 004d3494ae04..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLineSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XLineSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLineSegmenter ICU4XLineSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLineSegmenter_ICU4XError { - union { - ICU4XLineSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLineSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h deleted file mode 100644 index df40aa2daed1..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XListFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XListFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XListFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XListFormatter ICU4XListFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XListFormatter_ICU4XError { - union { - ICU4XListFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XListFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h deleted file mode 100644 index a49bb700ca67..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleCanonicalizer ICU4XLocaleCanonicalizer; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError { - union { - ICU4XLocaleCanonicalizer* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h deleted file mode 100644 index 6b0f09b2a2ff..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleDisplayNamesFormatter ICU4XLocaleDisplayNamesFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError { - union { - ICU4XLocaleDisplayNamesFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleDisplayNamesFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h deleted file mode 100644 index c7275e699c2d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleExpander_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleExpander_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleExpander_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleExpander ICU4XLocaleExpander; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleExpander_ICU4XError { - union { - ICU4XLocaleExpander* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleExpander_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h deleted file mode 100644 index 0dc002718e8c..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleFallbackerWithConfig ICU4XLocaleFallbackerWithConfig; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError { - union { - ICU4XLocaleFallbackerWithConfig* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleFallbackerWithConfig_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h deleted file mode 100644 index 3427bf3e3a35..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError_H -#define diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocaleFallbacker ICU4XLocaleFallbacker; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError { - union { - ICU4XLocaleFallbacker* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocaleFallbacker_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocale_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocale_ICU4XError.h deleted file mode 100644 index f5720b612f3d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XLocale_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XLocale_ICU4XError_H -#define diplomat_result_box_ICU4XLocale_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XLocale ICU4XLocale; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XLocale_ICU4XError { - union { - ICU4XLocale* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XLocale_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h deleted file mode 100644 index ebd519e0b5b4..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError_H -#define diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XMetazoneCalculator ICU4XMetazoneCalculator; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError { - union { - ICU4XMetazoneCalculator* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XMetazoneCalculator_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h deleted file mode 100644 index 7c068ba4b801..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPluralOperands_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XPluralOperands_ICU4XError_H -#define diplomat_result_box_ICU4XPluralOperands_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XPluralOperands ICU4XPluralOperands; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XPluralOperands_ICU4XError { - union { - ICU4XPluralOperands* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XPluralOperands_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h deleted file mode 100644 index 4fa522b8508f..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPluralRules_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XPluralRules_ICU4XError_H -#define diplomat_result_box_ICU4XPluralRules_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XPluralRules ICU4XPluralRules; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XPluralRules_ICU4XError { - union { - ICU4XPluralRules* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XPluralRules_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h deleted file mode 100644 index 047ef959b040..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError_H -#define diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XPropertyValueNameToEnumMapper ICU4XPropertyValueNameToEnumMapper; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError { - union { - ICU4XPropertyValueNameToEnumMapper* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XPropertyValueNameToEnumMapper_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h deleted file mode 100644 index fcf7e88a232a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError_H -#define diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XRegionDisplayNames ICU4XRegionDisplayNames; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError { - union { - ICU4XRegionDisplayNames* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XRegionDisplayNames_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h deleted file mode 100644 index bffd6161aa8d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError_H -#define diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XScriptWithExtensions ICU4XScriptWithExtensions; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError { - union { - ICU4XScriptWithExtensions* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XScriptWithExtensions_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h deleted file mode 100644 index a8ab968fa946..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XSentenceSegmenter ICU4XSentenceSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError { - union { - ICU4XSentenceSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XSentenceSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h deleted file mode 100644 index 0e63cbbc2a80..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XTimeFormatter ICU4XTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XTimeFormatter_ICU4XError { - union { - ICU4XTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h deleted file mode 100644 index 5f4851051e9a..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XTimeZoneFormatter ICU4XTimeZoneFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError { - union { - ICU4XTimeZoneFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XTimeZoneFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTime_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTime_ICU4XError.h deleted file mode 100644 index 3e58b1e4daa6..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XTime_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XTime_ICU4XError_H -#define diplomat_result_box_ICU4XTime_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XTime ICU4XTime; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XTime_ICU4XError { - union { - ICU4XTime* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XTime_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h deleted file mode 100644 index 6dd14e82b64d..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XUnicodeSetData_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XUnicodeSetData_ICU4XError_H -#define diplomat_result_box_ICU4XUnicodeSetData_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XUnicodeSetData ICU4XUnicodeSetData; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XUnicodeSetData_ICU4XError { - union { - ICU4XUnicodeSetData* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XUnicodeSetData_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h deleted file mode 100644 index 1f547fd383c3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XWeekCalculator_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XWeekCalculator_ICU4XError_H -#define diplomat_result_box_ICU4XWeekCalculator_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XWeekCalculator ICU4XWeekCalculator; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XWeekCalculator_ICU4XError { - union { - ICU4XWeekCalculator* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XWeekCalculator_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h deleted file mode 100644 index e41c59b661e1..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XWordSegmenter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XWordSegmenter_ICU4XError_H -#define diplomat_result_box_ICU4XWordSegmenter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XWordSegmenter ICU4XWordSegmenter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XWordSegmenter_ICU4XError { - union { - ICU4XWordSegmenter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XWordSegmenter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h deleted file mode 100644 index 52a0ab446213..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError_H -#define diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -typedef struct ICU4XZonedDateTimeFormatter ICU4XZonedDateTimeFormatter; -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError { - union { - ICU4XZonedDateTimeFormatter* ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_box_ICU4XZonedDateTimeFormatter_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_int32_t_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_int32_t_ICU4XError.h deleted file mode 100644 index adbe148dd153..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_int32_t_ICU4XError.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef diplomat_result_int32_t_ICU4XError_H -#define diplomat_result_int32_t_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_int32_t_ICU4XError { - union { - int32_t ok; - ICU4XError err; - }; - bool is_ok; -} diplomat_result_int32_t_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_uint16_t_void.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_uint16_t_void.h deleted file mode 100644 index 3adeb5f36de3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_uint16_t_void.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef diplomat_result_uint16_t_void_H -#define diplomat_result_uint16_t_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_uint16_t_void { - union { - uint16_t ok; - }; - bool is_ok; -} diplomat_result_uint16_t_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_void_ICU4XError.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_void_ICU4XError.h deleted file mode 100644 index f092491e3404..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_void_ICU4XError.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef diplomat_result_void_ICU4XError_H -#define diplomat_result_void_ICU4XError_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#include "ICU4XError.h" -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_void_ICU4XError { - union { - ICU4XError err; - }; - bool is_ok; -} diplomat_result_void_ICU4XError; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_result_void_void.h b/third_party/rust/icu_capi/cpp/include/diplomat_result_void_void.h deleted file mode 100644 index 2d5cc704e526..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_result_void_void.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef diplomat_result_void_void_H -#define diplomat_result_void_void_H -#include -#include -#include -#include -#include "diplomat_runtime.h" - -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif -typedef struct diplomat_result_void_void { - bool is_ok; -} diplomat_result_void_void; -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_runtime.h b/third_party/rust/icu_capi/cpp/include/diplomat_runtime.h deleted file mode 100644 index de0f9c76fee3..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_runtime.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef DIPLOMAT_RUNTIME_C_H -#define DIPLOMAT_RUNTIME_C_H - -#include -#include -#include -#include - -// uchar.h doesn't always exist, but char32_t is always available -// in C++ anyway -#ifndef __cplusplus -#ifdef __APPLE__ -#include -typedef uint16_t char16_t; -typedef uint32_t char32_t; -#else -#include -#endif -#endif - - -#ifdef __cplusplus -namespace capi { -extern "C" { -#endif - -typedef struct DiplomatWriteable { - void* context; - char* buf; - size_t len; - size_t cap; - void (*flush)(struct DiplomatWriteable*); - bool (*grow)(struct DiplomatWriteable*, size_t); -} DiplomatWriteable; - -DiplomatWriteable diplomat_simple_writeable(char* buf, size_t buf_size); - -typedef struct DiplomatStringView { - const char* data; - size_t len; -} DiplomatStringView; - -#define MAKE_SLICE_VIEW(name, c_ty) \ - typedef struct Diplomat##name##View { \ - const c_ty* data; \ - size_t len; \ - } Diplomat##name##View; - -MAKE_SLICE_VIEW(I8, int8_t) -MAKE_SLICE_VIEW(U8, uint8_t) -MAKE_SLICE_VIEW(I16, int16_t) -MAKE_SLICE_VIEW(U16, uint16_t) -MAKE_SLICE_VIEW(I32, int32_t) -MAKE_SLICE_VIEW(U32, uint32_t) -MAKE_SLICE_VIEW(I64, int64_t) -MAKE_SLICE_VIEW(U64, uint64_t) -MAKE_SLICE_VIEW(Isize, intptr_t) -MAKE_SLICE_VIEW(Usize, size_t) -MAKE_SLICE_VIEW(F32, float) -MAKE_SLICE_VIEW(F64, double) -MAKE_SLICE_VIEW(Bool, bool) -MAKE_SLICE_VIEW(Char, char32_t) - - -#ifdef __cplusplus -} // extern "C" -} // namespace capi -#endif - -#endif diff --git a/third_party/rust/icu_capi/cpp/include/diplomat_runtime.hpp b/third_party/rust/icu_capi/cpp/include/diplomat_runtime.hpp deleted file mode 100644 index 19d76044a710..000000000000 --- a/third_party/rust/icu_capi/cpp/include/diplomat_runtime.hpp +++ /dev/null @@ -1,160 +0,0 @@ -#ifndef DIPLOMAT_RUNTIME_CPP_H -#define DIPLOMAT_RUNTIME_CPP_H - -#include -#include -#include -#include - -#if __cplusplus >= 202002L -#include -#else -#include -#endif - -#include "diplomat_runtime.h" - -namespace diplomat { - -extern "C" inline void Flush(capi::DiplomatWriteable* w) { - std::string* string = reinterpret_cast(w->context); - string->resize(w->len); -}; - -extern "C" inline bool Grow(capi::DiplomatWriteable* w, uintptr_t requested) { - std::string* string = reinterpret_cast(w->context); - string->resize(requested); - w->cap = string->length(); - w->buf = &(*string)[0]; - return true; -}; - -inline capi::DiplomatWriteable WriteableFromString(std::string& string) { - capi::DiplomatWriteable w; - w.context = &string; - w.buf = &string[0]; - w.len = string.length(); - // Same as length, since C++ strings are not supposed - // to be written to past their len; you resize *first* - w.cap = string.length(); - w.flush = Flush; - w.grow = Grow; - return w; -}; - -template struct WriteableTrait { - // static inline capi::DiplomatWriteable Construct(T& t); -}; - - -template<> struct WriteableTrait { - static inline capi::DiplomatWriteable Construct(std::string& t) { - return diplomat::WriteableFromString(t); - } -}; - -template struct Ok { - T inner; - Ok(T&& i): inner(std::move(i)) {} - Ok() = default; - Ok(Ok&&) noexcept = default; - Ok(const Ok &) = default; - Ok& operator=(const Ok&) = default; - Ok& operator=(Ok&&) noexcept = default; -}; - -template struct Err { - T inner; - Err(T&& i): inner(std::move(i)) {} - Err() = default; - Err(Err&&) noexcept = default; - Err(const Err &) = default; - Err& operator=(const Err&) = default; - Err& operator=(Err&&) noexcept = default; -}; - -template -class result { -private: - std::variant, Err> val; -public: - result(Ok&& v): val(std::move(v)) {} - result(Err&& v): val(std::move(v)) {} - result() = default; - result(const result &) = default; - result& operator=(const result&) = default; - result& operator=(result&&) noexcept = default; - result(result &&) noexcept = default; - ~result() = default; - bool is_ok() const { - return std::holds_alternative>(this->val); - }; - bool is_err() const { - return std::holds_alternative>(this->val); - }; - - std::optional ok() && { - if (!this->is_ok()) { - return std::nullopt; - } - return std::make_optional(std::move(std::get>(std::move(this->val)).inner)); - }; - std::optional err() && { - if (!this->is_err()) { - return std::nullopt; - } - return std::make_optional(std::move(std::get>(std::move(this->val)).inner)); - } - - void set_ok(T&& t) { - this->val = Ok(std::move(t)); - } - - void set_err(E&& e) { - this->val = Err(std::move(e)); - } - - template - result replace_ok(T2&& t) { - if (this->is_err()) { - return result(Err(std::get>(std::move(this->val)))); - } else { - return result(Ok(std::move(t))); - } - } -}; - - -// Use custom std::span on C++17, otherwise use std::span -#if __cplusplus >= 202002L - -template using span = std::span; - -#else // __cplusplus >= 202002L - -// C++-17-compatible std::span -template -class span { - -public: - constexpr span(T* data, size_t size) - : data_(data), size_(size) {} - template - constexpr span(std::array::type, N>& arr) - : data_(const_cast(arr.data())), size_(N) {} - constexpr T* data() const noexcept { - return this->data_; - } - constexpr size_t size() const noexcept { - return this->size_; - } -private: - T* data_; - size_t size_; -}; - -#endif // __cplusplus >= 202002L - -} - -#endif diff --git a/third_party/rust/icu_capi/js/README.md b/third_party/rust/icu_capi/js/README.md deleted file mode 100644 index 7bc93e47d763..000000000000 --- a/third_party/rust/icu_capi/js/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# JavaScript/TypeScript FFI for ICU4X - -This folder contains the JavaScript/TypeScript FFI for ICU4X. To re-generate the bindings run: - -```sh -cargo make diplomat-install -cargo make diplomat-gen-js -``` - -Or re-generate all of the bindings: - -```sh -cargo make diplomat-gen -``` - -## More Information - -For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x). diff --git a/third_party/rust/icu_capi/js/examples/tinywasm/README.md b/third_party/rust/icu_capi/js/examples/tinywasm/README.md deleted file mode 100644 index 708e6b5d5a06..000000000000 --- a/third_party/rust/icu_capi/js/examples/tinywasm/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a example of how to build a size-optimized WASM library file using ICU4X. diff --git a/third_party/rust/icu_capi/js/include/CodePointRangeIterator.d.ts b/third_party/rust/icu_capi/js/include/CodePointRangeIterator.d.ts deleted file mode 100644 index 25d3076bc893..000000000000 --- a/third_party/rust/icu_capi/js/include/CodePointRangeIterator.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { CodePointRangeIteratorResult } from "./CodePointRangeIteratorResult"; - -/** - - * An iterator over code point ranges, produced by `ICU4XCodePointSetData` or one of the `ICU4XCodePointMapData` types - */ -export class CodePointRangeIterator { - - /** - - * Advance the iterator by one and return the next range. - - * If the iterator is out of items, `done` will be true - */ - next(): CodePointRangeIteratorResult; -} diff --git a/third_party/rust/icu_capi/js/include/CodePointRangeIterator.js b/third_party/rust/icu_capi/js/include/CodePointRangeIterator.js deleted file mode 100644 index 7fe654a93d8c..000000000000 --- a/third_party/rust/icu_capi/js/include/CodePointRangeIterator.js +++ /dev/null @@ -1,28 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { CodePointRangeIteratorResult } from "./CodePointRangeIteratorResult.js" - -const CodePointRangeIterator_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.CodePointRangeIterator_destroy(underlying); -}); - -export class CodePointRangeIterator { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - CodePointRangeIterator_box_destroy_registry.register(this, underlying); - } - } - - next() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(9, 4); - wasm.CodePointRangeIterator_next(diplomat_receive_buffer, this.underlying); - const out = new CodePointRangeIteratorResult(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - return out; - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/CodePointRangeIteratorResult.d.ts b/third_party/rust/icu_capi/js/include/CodePointRangeIteratorResult.d.ts deleted file mode 100644 index bcc72a65a618..000000000000 --- a/third_party/rust/icu_capi/js/include/CodePointRangeIteratorResult.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { u32 } from "./diplomat-runtime" - -/** - - * Result of a single iteration of {@link CodePointRangeIterator `CodePointRangeIterator`}. Logically can be considered to be an `Option>`, - - * `start` and `end` represent an inclusive range of code points start, end, and `done` will be true if the iterator has already finished. The last contentful iteration will NOT produce a range done=true, in other words `start` and `end` are useful values if and only if `done=false`. - */ -export class CodePointRangeIteratorResult { - start: u32; - end: u32; - done: boolean; -} diff --git a/third_party/rust/icu_capi/js/include/CodePointRangeIteratorResult.js b/third_party/rust/icu_capi/js/include/CodePointRangeIteratorResult.js deleted file mode 100644 index f544e085fa6d..000000000000 --- a/third_party/rust/icu_capi/js/include/CodePointRangeIteratorResult.js +++ /dev/null @@ -1,10 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export class CodePointRangeIteratorResult { - constructor(underlying) { - this.start = (new Uint32Array(wasm.memory.buffer, underlying, 1))[0]; - this.end = (new Uint32Array(wasm.memory.buffer, underlying + 4, 1))[0]; - this.done = (new Uint8Array(wasm.memory.buffer, underlying + 8, 1))[0] == 1; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XAnyCalendarKind.d.ts b/third_party/rust/icu_capi/js/include/ICU4XAnyCalendarKind.d.ts deleted file mode 100644 index a8be0b443c6d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XAnyCalendarKind.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * The various calendar types currently supported by {@link ICU4XCalendar `ICU4XCalendar`} - - * See the {@link https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html Rust documentation for `AnyCalendarKind`} for more information. - */ -export enum ICU4XAnyCalendarKind { - /** - - * The kind of an Iso calendar - */ - Iso = 'Iso', - /** - - * The kind of a Gregorian calendar - */ - Gregorian = 'Gregorian', - /** - - * The kind of a Buddhist calendar - */ - Buddhist = 'Buddhist', - /** - - * The kind of a Japanese calendar with modern eras - */ - Japanese = 'Japanese', - /** - - * The kind of a Japanese calendar with modern and historic eras - */ - JapaneseExtended = 'JapaneseExtended', - /** - - * The kind of an Ethiopian calendar, with Amete Mihret era - */ - Ethiopian = 'Ethiopian', - /** - - * The kind of an Ethiopian calendar, with Amete Alem era - */ - EthiopianAmeteAlem = 'EthiopianAmeteAlem', - /** - - * The kind of a Indian calendar - */ - Indian = 'Indian', - /** - - * The kind of a Coptic calendar - */ - Coptic = 'Coptic', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XAnyCalendarKind.js b/third_party/rust/icu_capi/js/include/ICU4XAnyCalendarKind.js deleted file mode 100644 index 188a144eb780..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XAnyCalendarKind.js +++ /dev/null @@ -1,39 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -export const ICU4XAnyCalendarKind_js_to_rust = { - "Iso": 0, - "Gregorian": 1, - "Buddhist": 2, - "Japanese": 3, - "JapaneseExtended": 4, - "Ethiopian": 5, - "EthiopianAmeteAlem": 6, - "Indian": 7, - "Coptic": 8, -}; - -export const ICU4XAnyCalendarKind_rust_to_js = { - [0]: "Iso", - [1]: "Gregorian", - [2]: "Buddhist", - [3]: "Japanese", - [4]: "JapaneseExtended", - [5]: "Ethiopian", - [6]: "EthiopianAmeteAlem", - [7]: "Indian", - [8]: "Coptic", -}; - -export const ICU4XAnyCalendarKind = { - "Iso": "Iso", - "Gregorian": "Gregorian", - "Buddhist": "Buddhist", - "Japanese": "Japanese", - "JapaneseExtended": "JapaneseExtended", - "Ethiopian": "Ethiopian", - "EthiopianAmeteAlem": "EthiopianAmeteAlem", - "Indian": "Indian", - "Coptic": "Coptic", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidi.d.ts b/third_party/rust/icu_capi/js/include/ICU4XBidi.d.ts deleted file mode 100644 index 96806c7479e2..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidi.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { u8 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XBidiInfo } from "./ICU4XBidiInfo"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XReorderedIndexMap } from "./ICU4XReorderedIndexMap"; - -/** - - * An ICU4X Bidi object, containing loaded bidi data - - * See the {@link https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html Rust documentation for `BidiClassAdapter`} for more information. - */ -export class ICU4XBidi { - - /** - - * Creates a new {@link ICU4XBidi `ICU4XBidi`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html#method.new Rust documentation for `new`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XBidi | never; - - /** - - * Use the data loaded in this object to process a string and calculate bidi information - - * Takes in a Level for the default level, if it is an invalid value it will default to LTR - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.new_with_data_source Rust documentation for `new_with_data_source`} for more information. - */ - for_text(text: string, default_level: u8): ICU4XBidiInfo; - - /** - - * Utility function for producing reorderings given a list of levels - - * Produces a map saying which visual index maps to which source index. - - * The levels array must not have values greater than 126 (this is the Bidi maximum explicit depth plus one). Failure to follow this invariant may lead to incorrect results, but is still safe. - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.reorder_visual Rust documentation for `reorder_visual`} for more information. - */ - reorder_visual(levels: Uint8Array): ICU4XReorderedIndexMap; - - /** - - * Check if a Level returned by level_at is an RTL level. - - * Invalid levels (numbers greater than 125) will be assumed LTR - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_rtl Rust documentation for `is_rtl`} for more information. - */ - static level_is_rtl(level: u8): boolean; - - /** - - * Check if a Level returned by level_at is an LTR level. - - * Invalid levels (numbers greater than 125) will be assumed LTR - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_ltr Rust documentation for `is_ltr`} for more information. - */ - static level_is_ltr(level: u8): boolean; - - /** - - * Get a basic RTL Level value - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.rtl Rust documentation for `rtl`} for more information. - */ - static level_rtl(): u8; - - /** - - * Get a simple LTR Level value - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.ltr Rust documentation for `ltr`} for more information. - */ - static level_ltr(): u8; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidi.js b/third_party/rust/icu_capi/js/include/ICU4XBidi.js deleted file mode 100644 index 18676b88740c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidi.js +++ /dev/null @@ -1,65 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XBidiInfo } from "./ICU4XBidiInfo.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XReorderedIndexMap } from "./ICU4XReorderedIndexMap.js" - -const ICU4XBidi_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XBidi_destroy(underlying); -}); - -export class ICU4XBidi { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XBidi_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XBidi_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XBidi(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - for_text(arg_text, arg_default_level) { - const buf_arg_text = diplomatRuntime.DiplomatBuf.str(wasm, arg_text); - return new ICU4XBidiInfo(wasm.ICU4XBidi_for_text(this.underlying, buf_arg_text.ptr, buf_arg_text.size, arg_default_level), true, [buf_arg_text]); - } - - reorder_visual(arg_levels) { - const buf_arg_levels = diplomatRuntime.DiplomatBuf.slice(wasm, arg_levels, 1); - const diplomat_out = new ICU4XReorderedIndexMap(wasm.ICU4XBidi_reorder_visual(this.underlying, buf_arg_levels.ptr, buf_arg_levels.size), true, []); - buf_arg_levels.free(); - return diplomat_out; - } - - static level_is_rtl(arg_level) { - return wasm.ICU4XBidi_level_is_rtl(arg_level); - } - - static level_is_ltr(arg_level) { - return wasm.ICU4XBidi_level_is_ltr(arg_level); - } - - static level_rtl() { - return wasm.ICU4XBidi_level_rtl(); - } - - static level_ltr() { - return wasm.ICU4XBidi_level_ltr(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidiDirection.d.ts b/third_party/rust/icu_capi/js/include/ICU4XBidiDirection.d.ts deleted file mode 100644 index 2c406601d6e4..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidiDirection.d.ts +++ /dev/null @@ -1,14 +0,0 @@ - -/** - */ -export enum ICU4XBidiDirection { - /** - */ - Ltr = 'Ltr', - /** - */ - Rtl = 'Rtl', - /** - */ - Mixed = 'Mixed', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidiDirection.js b/third_party/rust/icu_capi/js/include/ICU4XBidiDirection.js deleted file mode 100644 index 6e68a915987b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidiDirection.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XBidiDirection_js_to_rust = { - "Ltr": 0, - "Rtl": 1, - "Mixed": 2, -}; - -export const ICU4XBidiDirection_rust_to_js = { - [0]: "Ltr", - [1]: "Rtl", - [2]: "Mixed", -}; - -export const ICU4XBidiDirection = { - "Ltr": "Ltr", - "Rtl": "Rtl", - "Mixed": "Mixed", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidiInfo.d.ts b/third_party/rust/icu_capi/js/include/ICU4XBidiInfo.d.ts deleted file mode 100644 index 12d1d24d35b7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidiInfo.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { u8, usize } from "./diplomat-runtime" -import { ICU4XBidiParagraph } from "./ICU4XBidiParagraph"; - -/** - - * An object containing bidi information for a given string, produced by `for_text()` on `ICU4XBidi` - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html Rust documentation for `BidiInfo`} for more information. - */ -export class ICU4XBidiInfo { - - /** - - * The number of paragraphs contained here - */ - paragraph_count(): usize; - - /** - - * Get the nth paragraph, returning None if out of bounds - */ - paragraph_at(n: usize): ICU4XBidiParagraph | undefined; - - /** - - * The number of bytes in this full text - */ - size(): usize; - - /** - - * Get the BIDI level at a particular byte index in the full text. This integer is conceptually a `unicode_bidi::Level`, and can be further inspected using the static methods on ICU4XBidi. - - * Returns 0 (equivalent to `Level::ltr()`) on error - */ - level_at(pos: usize): u8; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidiInfo.js b/third_party/rust/icu_capi/js/include/ICU4XBidiInfo.js deleted file mode 100644 index dcdc78390ff6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidiInfo.js +++ /dev/null @@ -1,37 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XBidiParagraph } from "./ICU4XBidiParagraph.js" - -const ICU4XBidiInfo_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XBidiInfo_destroy(underlying); -}); - -export class ICU4XBidiInfo { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XBidiInfo_box_destroy_registry.register(this, underlying); - } - } - - paragraph_count() { - return wasm.ICU4XBidiInfo_paragraph_count(this.underlying); - } - - paragraph_at(arg_n) { - return (() => { - const option_ptr = wasm.ICU4XBidiInfo_paragraph_at(this.underlying, arg_n); - return (option_ptr == 0) ? null : new ICU4XBidiParagraph(option_ptr, true, [this]); - })(); - } - - size() { - return wasm.ICU4XBidiInfo_size(this.underlying); - } - - level_at(arg_pos) { - return wasm.ICU4XBidiInfo_level_at(this.underlying, arg_pos); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidiParagraph.d.ts b/third_party/rust/icu_capi/js/include/ICU4XBidiParagraph.d.ts deleted file mode 100644 index 94d29baa42f6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidiParagraph.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { u8, usize } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XBidiDirection } from "./ICU4XBidiDirection"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * Bidi information for a single processed paragraph - */ -export class ICU4XBidiParagraph { - - /** - - * Given a paragraph index `n` within the surrounding text, this sets this object to the paragraph at that index. Returns `ICU4XError::OutOfBoundsError` when out of bounds. - - * This is equivalent to calling `paragraph_at()` on `ICU4XBidiInfo` but doesn't create a new object - * @throws {@link FFIError}<{@link ICU4XError}> - */ - set_paragraph_in_text(n: usize): void | never; - - /** - - * The primary direction of this paragraph - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at Rust documentation for `level_at`} for more information. - */ - direction(): ICU4XBidiDirection; - - /** - - * The number of bytes in this paragraph - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.ParagraphInfo.html#method.len Rust documentation for `len`} for more information. - */ - size(): usize; - - /** - - * The start index of this paragraph within the source text - */ - range_start(): usize; - - /** - - * The end index of this paragraph within the source text - */ - range_end(): usize; - - /** - - * Reorder a line based on display order. The ranges are specified relative to the source text and must be contained within this paragraph's range. - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at Rust documentation for `level_at`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - reorder_line(range_start: usize, range_end: usize): string | never; - - /** - - * Get the BIDI level at a particular byte index in this paragraph. This integer is conceptually a `unicode_bidi::Level`, and can be further inspected using the static methods on ICU4XBidi. - - * Returns 0 (equivalent to `Level::ltr()`) on error - - * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at Rust documentation for `level_at`} for more information. - */ - level_at(pos: usize): u8; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XBidiParagraph.js b/third_party/rust/icu_capi/js/include/ICU4XBidiParagraph.js deleted file mode 100644 index 2037650134c3..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XBidiParagraph.js +++ /dev/null @@ -1,75 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XBidiDirection_js_to_rust, ICU4XBidiDirection_rust_to_js } from "./ICU4XBidiDirection.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XBidiParagraph_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XBidiParagraph_destroy(underlying); -}); - -export class ICU4XBidiParagraph { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XBidiParagraph_box_destroy_registry.register(this, underlying); - } - } - - set_paragraph_in_text(arg_n) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XBidiParagraph_set_paragraph_in_text(diplomat_receive_buffer, this.underlying, arg_n); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - direction() { - return ICU4XBidiDirection_rust_to_js[wasm.ICU4XBidiParagraph_direction(this.underlying)]; - } - - size() { - return wasm.ICU4XBidiParagraph_size(this.underlying); - } - - range_start() { - return wasm.ICU4XBidiParagraph_range_start(this.underlying); - } - - range_end() { - return wasm.ICU4XBidiParagraph_range_end(this.underlying); - } - - reorder_line(arg_range_start, arg_range_end) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XBidiParagraph_reorder_line(diplomat_receive_buffer, this.underlying, arg_range_start, arg_range_end, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - level_at(arg_pos) { - return wasm.ICU4XBidiParagraph_level_at(this.underlying, arg_pos); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCalendar.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCalendar.d.ts deleted file mode 100644 index 5656d71d789d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCalendar.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XAnyCalendarKind } from "./ICU4XAnyCalendarKind"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html Rust documentation for `AnyCalendar`} for more information. - */ -export class ICU4XCalendar { - - /** - - * Creates a new {@link ICU4XCalendar `ICU4XCalendar`} from the specified date and time. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.try_new_for_locale_unstable Rust documentation for `try_new_for_locale_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_for_locale(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XCalendar | never; - - /** - - * Creates a new {@link ICU4XCalendar `ICU4XCalendar`} from the specified date and time. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_for_kind(provider: ICU4XDataProvider, kind: ICU4XAnyCalendarKind): ICU4XCalendar | never; - - /** - - * Returns the kind of this calendar - - * See the {@link https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.kind Rust documentation for `kind`} for more information. - */ - kind(): ICU4XAnyCalendarKind; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCalendar.js b/third_party/rust/icu_capi/js/include/ICU4XCalendar.js deleted file mode 100644 index 03c5f882b8a7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCalendar.js +++ /dev/null @@ -1,57 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XAnyCalendarKind_js_to_rust, ICU4XAnyCalendarKind_rust_to_js } from "./ICU4XAnyCalendarKind.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCalendar_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCalendar_destroy(underlying); -}); - -export class ICU4XCalendar { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCalendar_box_destroy_registry.register(this, underlying); - } - } - - static create_for_locale(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCalendar_create_for_locale(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCalendar(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_for_kind(arg_provider, arg_kind) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCalendar_create_for_kind(diplomat_receive_buffer, arg_provider.underlying, ICU4XAnyCalendarKind_js_to_rust[arg_kind]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCalendar(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - kind() { - return ICU4XAnyCalendarKind_rust_to_js[wasm.ICU4XCalendar_kind(this.underlying)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCanonicalCombiningClassMap.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCanonicalCombiningClassMap.d.ts deleted file mode 100644 index 0a4bfcf96e42..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCanonicalCombiningClassMap.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { u8, u32, char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * Lookup of the Canonical_Combining_Class Unicode property - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html Rust documentation for `CanonicalCombiningClassMap`} for more information. - */ -export class ICU4XCanonicalCombiningClassMap { - - /** - - * Construct a new ICU4XCanonicalCombiningClassMap instance for NFC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XCanonicalCombiningClassMap | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.get Rust documentation for `get`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/properties/properties/struct.CanonicalCombiningClass.html 1} - */ - get(ch: char): u8; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.get32 Rust documentation for `get32`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/properties/properties/struct.CanonicalCombiningClass.html 1} - */ - get32(ch: u32): u8; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCanonicalCombiningClassMap.js b/third_party/rust/icu_capi/js/include/ICU4XCanonicalCombiningClassMap.js deleted file mode 100644 index 9bdb959134dd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCanonicalCombiningClassMap.js +++ /dev/null @@ -1,43 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCanonicalCombiningClassMap_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCanonicalCombiningClassMap_destroy(underlying); -}); - -export class ICU4XCanonicalCombiningClassMap { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCanonicalCombiningClassMap_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCanonicalCombiningClassMap_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCanonicalCombiningClassMap(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - get(arg_ch) { - return wasm.ICU4XCanonicalCombiningClassMap_get(this.underlying, diplomatRuntime.extractCodePoint(arg_ch, 'arg_ch')); - } - - get32(arg_ch) { - return wasm.ICU4XCanonicalCombiningClassMap_get32(this.underlying, arg_ch); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCanonicalComposition.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCanonicalComposition.d.ts deleted file mode 100644 index 744e99947f30..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCanonicalComposition.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * The raw canonical composition operation. - - * Callers should generally use ICU4XComposingNormalizer unless they specifically need raw composition operations - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html Rust documentation for `CanonicalComposition`} for more information. - */ -export class ICU4XCanonicalComposition { - - /** - - * Construct a new ICU4XCanonicalComposition instance for NFC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XCanonicalComposition | never; - - /** - - * Performs canonical composition (including Hangul) on a pair of characters or returns NUL if these characters don’t compose. Composition exclusions are taken into account. - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalComposition.html#method.compose Rust documentation for `compose`} for more information. - */ - compose(starter: char, second: char): char; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCanonicalComposition.js b/third_party/rust/icu_capi/js/include/ICU4XCanonicalComposition.js deleted file mode 100644 index ae217cafe9bd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCanonicalComposition.js +++ /dev/null @@ -1,39 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCanonicalComposition_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCanonicalComposition_destroy(underlying); -}); - -export class ICU4XCanonicalComposition { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCanonicalComposition_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCanonicalComposition_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCanonicalComposition(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - compose(arg_starter, arg_second) { - return wasm.ICU4XCanonicalComposition_compose(this.underlying, diplomatRuntime.extractCodePoint(arg_starter, 'arg_starter'), diplomatRuntime.extractCodePoint(arg_second, 'arg_second')); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCanonicalDecomposition.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCanonicalDecomposition.d.ts deleted file mode 100644 index 3e3d782a5a7b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCanonicalDecomposition.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDecomposed } from "./ICU4XDecomposed"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * The raw (non-recursive) canonical decomposition operation. - - * Callers should generally use ICU4XDecomposingNormalizer unless they specifically need raw composition operations - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html Rust documentation for `CanonicalDecomposition`} for more information. - */ -export class ICU4XCanonicalDecomposition { - - /** - - * Construct a new ICU4XCanonicalDecomposition instance for NFC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XCanonicalDecomposition | never; - - /** - - * Performs non-recursive canonical decomposition (including for Hangul). - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.decompose Rust documentation for `decompose`} for more information. - */ - decompose(c: char): ICU4XDecomposed; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCanonicalDecomposition.js b/third_party/rust/icu_capi/js/include/ICU4XCanonicalDecomposition.js deleted file mode 100644 index 249a09d54071..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCanonicalDecomposition.js +++ /dev/null @@ -1,46 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDecomposed } from "./ICU4XDecomposed.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCanonicalDecomposition_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCanonicalDecomposition_destroy(underlying); -}); - -export class ICU4XCanonicalDecomposition { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCanonicalDecomposition_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCanonicalDecomposition_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCanonicalDecomposition(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - decompose(arg_c) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(8, 4); - wasm.ICU4XCanonicalDecomposition_decompose(diplomat_receive_buffer, this.underlying, diplomatRuntime.extractCodePoint(arg_c, 'arg_c')); - const out = new ICU4XDecomposed(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 8, 4); - return out; - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData16.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData16.d.ts deleted file mode 100644 index dc8a2a4fc1a4..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData16.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { u16, u32, char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { CodePointRangeIterator } from "./CodePointRangeIterator"; -import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * An ICU4X Unicode Map Property object, capable of querying whether a code point (key) to obtain the Unicode property value, for a specific Unicode property. - - * For properties whose values fit into 16 bits. - - * See the {@link https://docs.rs/icu/latest/icu/properties/index.html Rust documentation for `properties`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html Rust documentation for `CodePointMapData`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html Rust documentation for `CodePointMapDataBorrowed`} for more information. - */ -export class ICU4XCodePointMapData16 { - - /** - - * Gets the value for a code point. - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get Rust documentation for `get`} for more information. - */ - get(cp: char): u16; - - /** - - * Gets the value for a code point (specified as a 32 bit integer, in UTF-32) - */ - get32(cp: u32): u16; - - /** - - * Produces an iterator over ranges of code points that map to `value` - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value Rust documentation for `iter_ranges_for_value`} for more information. - */ - iter_ranges_for_value(value: u16): CodePointRangeIterator; - - /** - - * Produces an iterator over ranges of code points that do not map to `value` - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented Rust documentation for `iter_ranges_for_value_complemented`} for more information. - */ - iter_ranges_for_value_complemented(value: u16): CodePointRangeIterator; - - /** - - * Gets a {@link ICU4XCodePointSetData `ICU4XCodePointSetData`} representing all entries in this map that map to the given value - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value Rust documentation for `get_set_for_value`} for more information. - */ - get_set_for_value(value: u16): ICU4XCodePointSetData; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_script.html Rust documentation for `load_script`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_script(provider: ICU4XDataProvider): ICU4XCodePointMapData16 | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData16.js b/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData16.js deleted file mode 100644 index cbdb61da4598..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData16.js +++ /dev/null @@ -1,57 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { CodePointRangeIterator } from "./CodePointRangeIterator.js" -import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCodePointMapData16_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCodePointMapData16_destroy(underlying); -}); - -export class ICU4XCodePointMapData16 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCodePointMapData16_box_destroy_registry.register(this, underlying); - } - } - - get(arg_cp) { - return wasm.ICU4XCodePointMapData16_get(this.underlying, diplomatRuntime.extractCodePoint(arg_cp, 'arg_cp')); - } - - get32(arg_cp) { - return wasm.ICU4XCodePointMapData16_get32(this.underlying, arg_cp); - } - - iter_ranges_for_value(arg_value) { - return new CodePointRangeIterator(wasm.ICU4XCodePointMapData16_iter_ranges_for_value(this.underlying, arg_value), true, [this]); - } - - iter_ranges_for_value_complemented(arg_value) { - return new CodePointRangeIterator(wasm.ICU4XCodePointMapData16_iter_ranges_for_value_complemented(this.underlying, arg_value), true, [this]); - } - - get_set_for_value(arg_value) { - return new ICU4XCodePointSetData(wasm.ICU4XCodePointMapData16_get_set_for_value(this.underlying, arg_value), true, []); - } - - static load_script(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData16_load_script(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData16(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData8.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData8.d.ts deleted file mode 100644 index d6616eb35cb8..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData8.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { u8, u32, char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { CodePointRangeIterator } from "./CodePointRangeIterator"; -import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * An ICU4X Unicode Map Property object, capable of querying whether a code point (key) to obtain the Unicode property value, for a specific Unicode property. - - * For properties whose values fit into 8 bits. - - * See the {@link https://docs.rs/icu/latest/icu/properties/index.html Rust documentation for `properties`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html Rust documentation for `CodePointMapData`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html Rust documentation for `CodePointMapDataBorrowed`} for more information. - */ -export class ICU4XCodePointMapData8 { - - /** - - * Gets the value for a code point. - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get Rust documentation for `get`} for more information. - */ - get(cp: char): u8; - - /** - - * Gets the value for a code point (specified as a 32 bit integer, in UTF-32) - */ - get32(cp: u32): u8; - - /** - - * Converts a general category to its corresponding mask value - - * Nonexistant general categories will map to the empty mask - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html Rust documentation for `GeneralCategoryGroup`} for more information. - */ - static general_category_to_mask(gc: u8): u32; - - /** - - * Produces an iterator over ranges of code points that map to `value` - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value Rust documentation for `iter_ranges_for_value`} for more information. - */ - iter_ranges_for_value(value: u8): CodePointRangeIterator; - - /** - - * Produces an iterator over ranges of code points that do not map to `value` - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented Rust documentation for `iter_ranges_for_value_complemented`} for more information. - */ - iter_ranges_for_value_complemented(value: u8): CodePointRangeIterator; - - /** - - * Given a mask value (the nth bit marks property value = n), produce an iterator over ranges of code points whose property values are contained in the mask. - - * The main mask property supported is that for General_Category, which can be obtained via `general_category_to_mask()` or by using `ICU4XGeneralCategoryNameToMaskMapper` - - * Should only be used on maps for properties with values less than 32 (like Generak_Category), other maps will have unpredictable results - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_group Rust documentation for `iter_ranges_for_group`} for more information. - */ - iter_ranges_for_mask(mask: u32): CodePointRangeIterator; - - /** - - * Gets a {@link ICU4XCodePointSetData `ICU4XCodePointSetData`} representing all entries in this map that map to the given value - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value Rust documentation for `get_set_for_value`} for more information. - */ - get_set_for_value(value: u8): ICU4XCodePointSetData; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_general_category.html Rust documentation for `load_general_category`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_general_category(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_bidi_class.html Rust documentation for `load_bidi_class`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_bidi_class(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_east_asian_width.html Rust documentation for `load_east_asian_width`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_east_asian_width(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_line_break.html Rust documentation for `load_line_break`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_line_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_grapheme_cluster_break.html Rust documentation for `load_grapheme_cluster_break`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static try_grapheme_cluster_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_word_break.html Rust documentation for `load_word_break`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_word_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.load_sentence_break.html Rust documentation for `load_sentence_break`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_sentence_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData8.js b/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData8.js deleted file mode 100644 index 3fc2d65d61fd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCodePointMapData8.js +++ /dev/null @@ -1,167 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { CodePointRangeIterator } from "./CodePointRangeIterator.js" -import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCodePointMapData8_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCodePointMapData8_destroy(underlying); -}); - -export class ICU4XCodePointMapData8 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCodePointMapData8_box_destroy_registry.register(this, underlying); - } - } - - get(arg_cp) { - return wasm.ICU4XCodePointMapData8_get(this.underlying, diplomatRuntime.extractCodePoint(arg_cp, 'arg_cp')); - } - - get32(arg_cp) { - return wasm.ICU4XCodePointMapData8_get32(this.underlying, arg_cp); - } - - static general_category_to_mask(arg_gc) { - return wasm.ICU4XCodePointMapData8_general_category_to_mask(arg_gc); - } - - iter_ranges_for_value(arg_value) { - return new CodePointRangeIterator(wasm.ICU4XCodePointMapData8_iter_ranges_for_value(this.underlying, arg_value), true, [this]); - } - - iter_ranges_for_value_complemented(arg_value) { - return new CodePointRangeIterator(wasm.ICU4XCodePointMapData8_iter_ranges_for_value_complemented(this.underlying, arg_value), true, [this]); - } - - iter_ranges_for_mask(arg_mask) { - return new CodePointRangeIterator(wasm.ICU4XCodePointMapData8_iter_ranges_for_mask(this.underlying, arg_mask), true, [this]); - } - - get_set_for_value(arg_value) { - return new ICU4XCodePointSetData(wasm.ICU4XCodePointMapData8_get_set_for_value(this.underlying, arg_value), true, []); - } - - static load_general_category(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_load_general_category(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_bidi_class(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_load_bidi_class(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_east_asian_width(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_load_east_asian_width(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_line_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_load_line_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static try_grapheme_cluster_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_try_grapheme_cluster_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_word_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_load_word_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_sentence_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointMapData8_load_sentence_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointMapData8(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCodePointSetData.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCodePointSetData.d.ts deleted file mode 100644 index 6120ed1b5a29..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCodePointSetData.d.ts +++ /dev/null @@ -1,523 +0,0 @@ -import { u32, char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { CodePointRangeIterator } from "./CodePointRangeIterator"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property. - - * See the {@link https://docs.rs/icu/latest/icu/properties/index.html Rust documentation for `properties`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetData.html Rust documentation for `CodePointSetData`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html Rust documentation for `CodePointSetDataBorrowed`} for more information. - */ -export class ICU4XCodePointSetData { - - /** - - * Checks whether the code point is in the set. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.contains Rust documentation for `contains`} for more information. - */ - contains(cp: char): boolean; - - /** - - * Checks whether the code point (specified as a 32 bit integer, in UTF-32) is in the set. - */ - contains32(cp: u32): boolean; - - /** - - * Produces an iterator over ranges of code points contained in this set - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges Rust documentation for `iter_ranges`} for more information. - */ - iter_ranges(): CodePointRangeIterator; - - /** - - * Produces an iterator over ranges of code points not contained in this set - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges_complemented Rust documentation for `iter_ranges_complemented`} for more information. - */ - iter_ranges_complemented(): CodePointRangeIterator; - - /** - - * which is a mask with the same format as the `U_GC_XX_MASK` mask in ICU4C - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_for_general_category_group.html Rust documentation for `load_for_general_category_group`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_for_general_category_group(provider: ICU4XDataProvider, group: u32): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_ascii_hex_digit.html Rust documentation for `load_ascii_hex_digit`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_ascii_hex_digit(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_alnum.html Rust documentation for `load_alnum`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_alnum(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_alphabetic.html Rust documentation for `load_alphabetic`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_alphabetic(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_bidi_control.html Rust documentation for `load_bidi_control`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_bidi_control(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_bidi_mirrored.html Rust documentation for `load_bidi_mirrored`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_bidi_mirrored(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_blank.html Rust documentation for `load_blank`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_blank(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_cased.html Rust documentation for `load_cased`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_cased(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_case_ignorable.html Rust documentation for `load_case_ignorable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_case_ignorable(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_full_composition_exclusion.html Rust documentation for `load_full_composition_exclusion`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_full_composition_exclusion(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_casefolded.html Rust documentation for `load_changes_when_casefolded`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_changes_when_casefolded(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_casemapped.html Rust documentation for `load_changes_when_casemapped`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_changes_when_casemapped(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_nfkc_casefolded.html Rust documentation for `load_changes_when_nfkc_casefolded`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_changes_when_nfkc_casefolded(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_lowercased.html Rust documentation for `load_changes_when_lowercased`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_changes_when_lowercased(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_titlecased.html Rust documentation for `load_changes_when_titlecased`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_changes_when_titlecased(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_changes_when_uppercased.html Rust documentation for `load_changes_when_uppercased`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_changes_when_uppercased(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_dash.html Rust documentation for `load_dash`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_dash(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_deprecated.html Rust documentation for `load_deprecated`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_deprecated(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_default_ignorable_code_point.html Rust documentation for `load_default_ignorable_code_point`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_default_ignorable_code_point(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_diacritic.html Rust documentation for `load_diacritic`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_diacritic(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_modifier_base.html Rust documentation for `load_emoji_modifier_base`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_emoji_modifier_base(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_component.html Rust documentation for `load_emoji_component`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_emoji_component(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_modifier.html Rust documentation for `load_emoji_modifier`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_emoji_modifier(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji.html Rust documentation for `load_emoji`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_emoji(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_emoji_presentation.html Rust documentation for `load_emoji_presentation`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_emoji_presentation(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_extender.html Rust documentation for `load_extender`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_extender(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_extended_pictographic.html Rust documentation for `load_extended_pictographic`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_extended_pictographic(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_graph.html Rust documentation for `load_graph`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_graph(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_grapheme_base.html Rust documentation for `load_grapheme_base`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_grapheme_base(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_grapheme_extend.html Rust documentation for `load_grapheme_extend`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_grapheme_extend(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_grapheme_link.html Rust documentation for `load_grapheme_link`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_grapheme_link(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_hex_digit.html Rust documentation for `load_hex_digit`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_hex_digit(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_hyphen.html Rust documentation for `load_hyphen`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_hyphen(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_id_continue.html Rust documentation for `load_id_continue`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_id_continue(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_ideographic.html Rust documentation for `load_ideographic`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_ideographic(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_id_start.html Rust documentation for `load_id_start`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_id_start(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_ids_binary_operator.html Rust documentation for `load_ids_binary_operator`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_ids_binary_operator(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_ids_trinary_operator.html Rust documentation for `load_ids_trinary_operator`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_ids_trinary_operator(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_join_control.html Rust documentation for `load_join_control`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_join_control(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_logical_order_exception.html Rust documentation for `load_logical_order_exception`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_logical_order_exception(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_lowercase.html Rust documentation for `load_lowercase`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_lowercase(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_math.html Rust documentation for `load_math`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_math(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_noncharacter_code_point.html Rust documentation for `load_noncharacter_code_point`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_noncharacter_code_point(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfc_inert.html Rust documentation for `load_nfc_inert`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_nfc_inert(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfd_inert.html Rust documentation for `load_nfd_inert`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_nfd_inert(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfkc_inert.html Rust documentation for `load_nfkc_inert`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_nfkc_inert(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_nfkd_inert.html Rust documentation for `load_nfkd_inert`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_nfkd_inert(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_pattern_syntax.html Rust documentation for `load_pattern_syntax`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_pattern_syntax(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_pattern_white_space.html Rust documentation for `load_pattern_white_space`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_pattern_white_space(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_prepended_concatenation_mark.html Rust documentation for `load_prepended_concatenation_mark`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_prepended_concatenation_mark(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_print.html Rust documentation for `load_print`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_print(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_quotation_mark.html Rust documentation for `load_quotation_mark`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_quotation_mark(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_radical.html Rust documentation for `load_radical`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_radical(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_regional_indicator.html Rust documentation for `load_regional_indicator`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_regional_indicator(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_soft_dotted.html Rust documentation for `load_soft_dotted`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_soft_dotted(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_segment_starter.html Rust documentation for `load_segment_starter`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_segment_starter(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_case_sensitive.html Rust documentation for `load_case_sensitive`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_case_sensitive(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_sentence_terminal.html Rust documentation for `load_sentence_terminal`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_sentence_terminal(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_terminal_punctuation.html Rust documentation for `load_terminal_punctuation`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_terminal_punctuation(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_unified_ideograph.html Rust documentation for `load_unified_ideograph`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_unified_ideograph(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_uppercase.html Rust documentation for `load_uppercase`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_uppercase(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_variation_selector.html Rust documentation for `load_variation_selector`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_variation_selector(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_white_space.html Rust documentation for `load_white_space`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_white_space(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_xdigit.html Rust documentation for `load_xdigit`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_xdigit(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_xid_continue.html Rust documentation for `load_xid_continue`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_xid_continue(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_xid_start.html Rust documentation for `load_xid_start`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_xid_start(provider: ICU4XDataProvider): ICU4XCodePointSetData | never; - - /** - - * Loads data for a property specified as a string as long as it is one of the {@link https://tc39.es/ecma262/#table-binary-unicode-properties ECMA-262 binary properties} (not including Any, ASCII, and Assigned pseudoproperties). - - * Returns `ICU4XError::PropertyUnexpectedPropertyNameError` in case the string does not match any property in the list - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_for_ecma262_unstable.html Rust documentation for `load_for_ecma262_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_for_ecma262(provider: ICU4XDataProvider, property_name: string): ICU4XCodePointSetData | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCodePointSetData.js b/third_party/rust/icu_capi/js/include/ICU4XCodePointSetData.js deleted file mode 100644 index 55a1605d4e6f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCodePointSetData.js +++ /dev/null @@ -1,1177 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { CodePointRangeIterator } from "./CodePointRangeIterator.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCodePointSetData_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCodePointSetData_destroy(underlying); -}); - -export class ICU4XCodePointSetData { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCodePointSetData_box_destroy_registry.register(this, underlying); - } - } - - contains(arg_cp) { - return wasm.ICU4XCodePointSetData_contains(this.underlying, diplomatRuntime.extractCodePoint(arg_cp, 'arg_cp')); - } - - contains32(arg_cp) { - return wasm.ICU4XCodePointSetData_contains32(this.underlying, arg_cp); - } - - iter_ranges() { - return new CodePointRangeIterator(wasm.ICU4XCodePointSetData_iter_ranges(this.underlying), true, [this]); - } - - iter_ranges_complemented() { - return new CodePointRangeIterator(wasm.ICU4XCodePointSetData_iter_ranges_complemented(this.underlying), true, [this]); - } - - static load_for_general_category_group(arg_provider, arg_group) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_for_general_category_group(diplomat_receive_buffer, arg_provider.underlying, arg_group); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_ascii_hex_digit(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_ascii_hex_digit(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_alnum(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_alnum(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_alphabetic(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_alphabetic(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_bidi_control(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_bidi_control(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_bidi_mirrored(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_bidi_mirrored(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_blank(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_blank(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_cased(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_cased(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_case_ignorable(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_case_ignorable(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_full_composition_exclusion(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_full_composition_exclusion(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_changes_when_casefolded(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_changes_when_casefolded(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_changes_when_casemapped(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_changes_when_casemapped(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_changes_when_nfkc_casefolded(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_changes_when_lowercased(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_changes_when_lowercased(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_changes_when_titlecased(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_changes_when_titlecased(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_changes_when_uppercased(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_changes_when_uppercased(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_dash(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_dash(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_deprecated(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_deprecated(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_default_ignorable_code_point(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_default_ignorable_code_point(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_diacritic(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_diacritic(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_emoji_modifier_base(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_emoji_modifier_base(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_emoji_component(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_emoji_component(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_emoji_modifier(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_emoji_modifier(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_emoji(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_emoji(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_emoji_presentation(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_emoji_presentation(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_extender(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_extender(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_extended_pictographic(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_extended_pictographic(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_graph(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_graph(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_grapheme_base(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_grapheme_base(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_grapheme_extend(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_grapheme_extend(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_grapheme_link(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_grapheme_link(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_hex_digit(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_hex_digit(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_hyphen(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_hyphen(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_id_continue(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_id_continue(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_ideographic(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_ideographic(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_id_start(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_id_start(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_ids_binary_operator(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_ids_binary_operator(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_ids_trinary_operator(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_ids_trinary_operator(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_join_control(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_join_control(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_logical_order_exception(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_logical_order_exception(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_lowercase(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_lowercase(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_math(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_math(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_noncharacter_code_point(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_noncharacter_code_point(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_nfc_inert(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_nfc_inert(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_nfd_inert(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_nfd_inert(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_nfkc_inert(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_nfkc_inert(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_nfkd_inert(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_nfkd_inert(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_pattern_syntax(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_pattern_syntax(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_pattern_white_space(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_pattern_white_space(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_prepended_concatenation_mark(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_prepended_concatenation_mark(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_print(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_print(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_quotation_mark(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_quotation_mark(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_radical(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_radical(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_regional_indicator(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_regional_indicator(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_soft_dotted(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_soft_dotted(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_segment_starter(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_segment_starter(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_case_sensitive(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_case_sensitive(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_sentence_terminal(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_sentence_terminal(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_terminal_punctuation(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_terminal_punctuation(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_unified_ideograph(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_unified_ideograph(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_uppercase(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_uppercase(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_variation_selector(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_variation_selector(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_white_space(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_white_space(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_xdigit(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_xdigit(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_xid_continue(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_xid_continue(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_xid_start(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_xid_start(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_for_ecma262(arg_provider, arg_property_name) { - const buf_arg_property_name = diplomatRuntime.DiplomatBuf.str(wasm, arg_property_name); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCodePointSetData_load_for_ecma262(diplomat_receive_buffer, arg_provider.underlying, buf_arg_property_name.ptr, buf_arg_property_name.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCodePointSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_property_name.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollator.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollator.d.ts deleted file mode 100644 index 7b74de0ca41f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollator.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XCollatorOptionsV1 } from "./ICU4XCollatorOptionsV1"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XOrdering } from "./ICU4XOrdering"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/struct.Collator.html Rust documentation for `Collator`} for more information. - */ -export class ICU4XCollator { - - /** - - * Construct a new Collator instance. - - * See the {@link https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_v1(provider: ICU4XDataProvider, locale: ICU4XLocale, options: ICU4XCollatorOptionsV1): ICU4XCollator | never; - - /** - - * Compare potentially ill-formed UTF-8 strings. - - * Ill-formed input is compared as if errors had been replaced with REPLACEMENT CHARACTERs according to the WHATWG Encoding Standard. - - * See the {@link https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf8 Rust documentation for `compare_utf8`} for more information. - */ - compare(left: string, right: string): ICU4XOrdering; - - /** - - * Compare guaranteed well-formed UTF-8 strings. - - * Note: In C++, passing ill-formed UTF-8 strings is undefined behavior (and may be memory-unsafe to do so, too). - - * See the {@link https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare Rust documentation for `compare`} for more information. - */ - compare_valid_utf8(left: string, right: string): ICU4XOrdering; - - /** - - * Compare potentially ill-formed UTF-16 strings, with unpaired surrogates compared as REPLACEMENT CHARACTER. - - * See the {@link https://docs.rs/icu/latest/icu/collator/struct.Collator.html#method.compare_utf16 Rust documentation for `compare_utf16`} for more information. - */ - compare_utf16(left: Uint16Array, right: Uint16Array): ICU4XOrdering; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollator.js b/third_party/rust/icu_capi/js/include/ICU4XCollator.js deleted file mode 100644 index 5fc796cbd24b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollator.js +++ /dev/null @@ -1,77 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XCollatorAlternateHandling_js_to_rust, ICU4XCollatorAlternateHandling_rust_to_js } from "./ICU4XCollatorAlternateHandling.js" -import { ICU4XCollatorBackwardSecondLevel_js_to_rust, ICU4XCollatorBackwardSecondLevel_rust_to_js } from "./ICU4XCollatorBackwardSecondLevel.js" -import { ICU4XCollatorCaseFirst_js_to_rust, ICU4XCollatorCaseFirst_rust_to_js } from "./ICU4XCollatorCaseFirst.js" -import { ICU4XCollatorCaseLevel_js_to_rust, ICU4XCollatorCaseLevel_rust_to_js } from "./ICU4XCollatorCaseLevel.js" -import { ICU4XCollatorMaxVariable_js_to_rust, ICU4XCollatorMaxVariable_rust_to_js } from "./ICU4XCollatorMaxVariable.js" -import { ICU4XCollatorNumeric_js_to_rust, ICU4XCollatorNumeric_rust_to_js } from "./ICU4XCollatorNumeric.js" -import { ICU4XCollatorStrength_js_to_rust, ICU4XCollatorStrength_rust_to_js } from "./ICU4XCollatorStrength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XOrdering_js_to_rust, ICU4XOrdering_rust_to_js } from "./ICU4XOrdering.js" - -const ICU4XCollator_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCollator_destroy(underlying); -}); - -export class ICU4XCollator { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCollator_box_destroy_registry.register(this, underlying); - } - } - - static create_v1(arg_provider, arg_locale, arg_options) { - const field_strength_arg_options = arg_options["strength"]; - const field_alternate_handling_arg_options = arg_options["alternate_handling"]; - const field_case_first_arg_options = arg_options["case_first"]; - const field_max_variable_arg_options = arg_options["max_variable"]; - const field_case_level_arg_options = arg_options["case_level"]; - const field_numeric_arg_options = arg_options["numeric"]; - const field_backward_second_level_arg_options = arg_options["backward_second_level"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCollator_create_v1(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XCollatorStrength_js_to_rust[field_strength_arg_options], ICU4XCollatorAlternateHandling_js_to_rust[field_alternate_handling_arg_options], ICU4XCollatorCaseFirst_js_to_rust[field_case_first_arg_options], ICU4XCollatorMaxVariable_js_to_rust[field_max_variable_arg_options], ICU4XCollatorCaseLevel_js_to_rust[field_case_level_arg_options], ICU4XCollatorNumeric_js_to_rust[field_numeric_arg_options], ICU4XCollatorBackwardSecondLevel_js_to_rust[field_backward_second_level_arg_options]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCollator(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - compare(arg_left, arg_right) { - const buf_arg_left = diplomatRuntime.DiplomatBuf.str(wasm, arg_left); - const buf_arg_right = diplomatRuntime.DiplomatBuf.str(wasm, arg_right); - const diplomat_out = ICU4XOrdering_rust_to_js[wasm.ICU4XCollator_compare(this.underlying, buf_arg_left.ptr, buf_arg_left.size, buf_arg_right.ptr, buf_arg_right.size)]; - buf_arg_left.free(); - buf_arg_right.free(); - return diplomat_out; - } - - compare_valid_utf8(arg_left, arg_right) { - const buf_arg_left = diplomatRuntime.DiplomatBuf.str(wasm, arg_left); - const buf_arg_right = diplomatRuntime.DiplomatBuf.str(wasm, arg_right); - const diplomat_out = ICU4XOrdering_rust_to_js[wasm.ICU4XCollator_compare_valid_utf8(this.underlying, buf_arg_left.ptr, buf_arg_left.size, buf_arg_right.ptr, buf_arg_right.size)]; - buf_arg_left.free(); - buf_arg_right.free(); - return diplomat_out; - } - - compare_utf16(arg_left, arg_right) { - const buf_arg_left = diplomatRuntime.DiplomatBuf.slice(wasm, arg_left, 2); - const buf_arg_right = diplomatRuntime.DiplomatBuf.slice(wasm, arg_right, 2); - const diplomat_out = ICU4XOrdering_rust_to_js[wasm.ICU4XCollator_compare_utf16(this.underlying, buf_arg_left.ptr, buf_arg_left.size, buf_arg_right.ptr, buf_arg_right.size)]; - buf_arg_left.free(); - buf_arg_right.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorAlternateHandling.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorAlternateHandling.d.ts deleted file mode 100644 index 9e84343353dd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorAlternateHandling.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.AlternateHandling.html Rust documentation for `AlternateHandling`} for more information. - */ -export enum ICU4XCollatorAlternateHandling { - /** - */ - Auto = 'Auto', - /** - */ - NonIgnorable = 'NonIgnorable', - /** - */ - Shifted = 'Shifted', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorAlternateHandling.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorAlternateHandling.js deleted file mode 100644 index 50467508156e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorAlternateHandling.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorAlternateHandling_js_to_rust = { - "Auto": 0, - "NonIgnorable": 1, - "Shifted": 2, -}; - -export const ICU4XCollatorAlternateHandling_rust_to_js = { - [0]: "Auto", - [1]: "NonIgnorable", - [2]: "Shifted", -}; - -export const ICU4XCollatorAlternateHandling = { - "Auto": "Auto", - "NonIgnorable": "NonIgnorable", - "Shifted": "Shifted", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorBackwardSecondLevel.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorBackwardSecondLevel.d.ts deleted file mode 100644 index 6dc06e7e2a7c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorBackwardSecondLevel.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.BackwardSecondLevel.html Rust documentation for `BackwardSecondLevel`} for more information. - */ -export enum ICU4XCollatorBackwardSecondLevel { - /** - */ - Auto = 'Auto', - /** - */ - Off = 'Off', - /** - */ - On = 'On', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorBackwardSecondLevel.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorBackwardSecondLevel.js deleted file mode 100644 index 825b3d200c82..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorBackwardSecondLevel.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorBackwardSecondLevel_js_to_rust = { - "Auto": 0, - "Off": 1, - "On": 2, -}; - -export const ICU4XCollatorBackwardSecondLevel_rust_to_js = { - [0]: "Auto", - [1]: "Off", - [2]: "On", -}; - -export const ICU4XCollatorBackwardSecondLevel = { - "Auto": "Auto", - "Off": "Off", - "On": "On", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseFirst.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseFirst.d.ts deleted file mode 100644 index f72b75cfeceb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseFirst.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.CaseFirst.html Rust documentation for `CaseFirst`} for more information. - */ -export enum ICU4XCollatorCaseFirst { - /** - */ - Auto = 'Auto', - /** - */ - Off = 'Off', - /** - */ - LowerFirst = 'LowerFirst', - /** - */ - UpperFirst = 'UpperFirst', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseFirst.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseFirst.js deleted file mode 100644 index b5c11fb4e8e7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseFirst.js +++ /dev/null @@ -1,23 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorCaseFirst_js_to_rust = { - "Auto": 0, - "Off": 1, - "LowerFirst": 2, - "UpperFirst": 3, -}; - -export const ICU4XCollatorCaseFirst_rust_to_js = { - [0]: "Auto", - [1]: "Off", - [2]: "LowerFirst", - [3]: "UpperFirst", -}; - -export const ICU4XCollatorCaseFirst = { - "Auto": "Auto", - "Off": "Off", - "LowerFirst": "LowerFirst", - "UpperFirst": "UpperFirst", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseLevel.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseLevel.d.ts deleted file mode 100644 index 3825eaeae0f0..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseLevel.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.CaseLevel.html Rust documentation for `CaseLevel`} for more information. - */ -export enum ICU4XCollatorCaseLevel { - /** - */ - Auto = 'Auto', - /** - */ - Off = 'Off', - /** - */ - On = 'On', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseLevel.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseLevel.js deleted file mode 100644 index aa0f74738968..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorCaseLevel.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorCaseLevel_js_to_rust = { - "Auto": 0, - "Off": 1, - "On": 2, -}; - -export const ICU4XCollatorCaseLevel_rust_to_js = { - [0]: "Auto", - [1]: "Off", - [2]: "On", -}; - -export const ICU4XCollatorCaseLevel = { - "Auto": "Auto", - "Off": "Off", - "On": "On", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorMaxVariable.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorMaxVariable.d.ts deleted file mode 100644 index 2605bbc45001..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorMaxVariable.d.ts +++ /dev/null @@ -1,22 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.MaxVariable.html Rust documentation for `MaxVariable`} for more information. - */ -export enum ICU4XCollatorMaxVariable { - /** - */ - Auto = 'Auto', - /** - */ - Space = 'Space', - /** - */ - Punctuation = 'Punctuation', - /** - */ - Symbol = 'Symbol', - /** - */ - Currency = 'Currency', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorMaxVariable.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorMaxVariable.js deleted file mode 100644 index 6964c4812d34..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorMaxVariable.js +++ /dev/null @@ -1,26 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorMaxVariable_js_to_rust = { - "Auto": 0, - "Space": 1, - "Punctuation": 2, - "Symbol": 3, - "Currency": 4, -}; - -export const ICU4XCollatorMaxVariable_rust_to_js = { - [0]: "Auto", - [1]: "Space", - [2]: "Punctuation", - [3]: "Symbol", - [4]: "Currency", -}; - -export const ICU4XCollatorMaxVariable = { - "Auto": "Auto", - "Space": "Space", - "Punctuation": "Punctuation", - "Symbol": "Symbol", - "Currency": "Currency", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorNumeric.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorNumeric.d.ts deleted file mode 100644 index 884c71d62b2f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorNumeric.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.Numeric.html Rust documentation for `Numeric`} for more information. - */ -export enum ICU4XCollatorNumeric { - /** - */ - Auto = 'Auto', - /** - */ - Off = 'Off', - /** - */ - On = 'On', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorNumeric.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorNumeric.js deleted file mode 100644 index 8a5e5e1f5805..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorNumeric.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorNumeric_js_to_rust = { - "Auto": 0, - "Off": 1, - "On": 2, -}; - -export const ICU4XCollatorNumeric_rust_to_js = { - [0]: "Auto", - [1]: "Off", - [2]: "On", -}; - -export const ICU4XCollatorNumeric = { - "Auto": "Auto", - "Off": "Off", - "On": "On", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorOptionsV1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorOptionsV1.d.ts deleted file mode 100644 index 3306764cd459..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorOptionsV1.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ICU4XCollatorAlternateHandling } from "./ICU4XCollatorAlternateHandling"; -import { ICU4XCollatorBackwardSecondLevel } from "./ICU4XCollatorBackwardSecondLevel"; -import { ICU4XCollatorCaseFirst } from "./ICU4XCollatorCaseFirst"; -import { ICU4XCollatorCaseLevel } from "./ICU4XCollatorCaseLevel"; -import { ICU4XCollatorMaxVariable } from "./ICU4XCollatorMaxVariable"; -import { ICU4XCollatorNumeric } from "./ICU4XCollatorNumeric"; -import { ICU4XCollatorStrength } from "./ICU4XCollatorStrength"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/struct.CollatorOptions.html Rust documentation for `CollatorOptions`} for more information. - */ -export class ICU4XCollatorOptionsV1 { - strength: ICU4XCollatorStrength; - alternate_handling: ICU4XCollatorAlternateHandling; - case_first: ICU4XCollatorCaseFirst; - max_variable: ICU4XCollatorMaxVariable; - case_level: ICU4XCollatorCaseLevel; - numeric: ICU4XCollatorNumeric; - backward_second_level: ICU4XCollatorBackwardSecondLevel; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorOptionsV1.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorOptionsV1.js deleted file mode 100644 index 5be95f595533..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorOptionsV1.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XCollatorAlternateHandling_js_to_rust, ICU4XCollatorAlternateHandling_rust_to_js } from "./ICU4XCollatorAlternateHandling.js" -import { ICU4XCollatorBackwardSecondLevel_js_to_rust, ICU4XCollatorBackwardSecondLevel_rust_to_js } from "./ICU4XCollatorBackwardSecondLevel.js" -import { ICU4XCollatorCaseFirst_js_to_rust, ICU4XCollatorCaseFirst_rust_to_js } from "./ICU4XCollatorCaseFirst.js" -import { ICU4XCollatorCaseLevel_js_to_rust, ICU4XCollatorCaseLevel_rust_to_js } from "./ICU4XCollatorCaseLevel.js" -import { ICU4XCollatorMaxVariable_js_to_rust, ICU4XCollatorMaxVariable_rust_to_js } from "./ICU4XCollatorMaxVariable.js" -import { ICU4XCollatorNumeric_js_to_rust, ICU4XCollatorNumeric_rust_to_js } from "./ICU4XCollatorNumeric.js" -import { ICU4XCollatorStrength_js_to_rust, ICU4XCollatorStrength_rust_to_js } from "./ICU4XCollatorStrength.js" - -export class ICU4XCollatorOptionsV1 { - constructor(underlying) { - this.strength = ICU4XCollatorStrength_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying)]; - this.alternate_handling = ICU4XCollatorAlternateHandling_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 4)]; - this.case_first = ICU4XCollatorCaseFirst_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 8)]; - this.max_variable = ICU4XCollatorMaxVariable_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 12)]; - this.case_level = ICU4XCollatorCaseLevel_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 16)]; - this.numeric = ICU4XCollatorNumeric_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 20)]; - this.backward_second_level = ICU4XCollatorBackwardSecondLevel_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 24)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorStrength.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCollatorStrength.d.ts deleted file mode 100644 index 2f1ff28a60aa..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorStrength.d.ts +++ /dev/null @@ -1,25 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/collator/enum.Strength.html Rust documentation for `Strength`} for more information. - */ -export enum ICU4XCollatorStrength { - /** - */ - Auto = 'Auto', - /** - */ - Primary = 'Primary', - /** - */ - Secondary = 'Secondary', - /** - */ - Tertiary = 'Tertiary', - /** - */ - Quaternary = 'Quaternary', - /** - */ - Identical = 'Identical', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XCollatorStrength.js b/third_party/rust/icu_capi/js/include/ICU4XCollatorStrength.js deleted file mode 100644 index 4a8ca99fd2d2..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCollatorStrength.js +++ /dev/null @@ -1,29 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XCollatorStrength_js_to_rust = { - "Auto": 0, - "Primary": 1, - "Secondary": 2, - "Tertiary": 3, - "Quaternary": 4, - "Identical": 5, -}; - -export const ICU4XCollatorStrength_rust_to_js = { - [0]: "Auto", - [1]: "Primary", - [2]: "Secondary", - [3]: "Tertiary", - [4]: "Quaternary", - [5]: "Identical", -}; - -export const ICU4XCollatorStrength = { - "Auto": "Auto", - "Primary": "Primary", - "Secondary": "Secondary", - "Tertiary": "Tertiary", - "Quaternary": "Quaternary", - "Identical": "Identical", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XComposingNormalizer.d.ts b/third_party/rust/icu_capi/js/include/ICU4XComposingNormalizer.d.ts deleted file mode 100644 index 9e07d0da3aa1..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XComposingNormalizer.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html Rust documentation for `ComposingNormalizer`} for more information. - */ -export class ICU4XComposingNormalizer { - - /** - - * Construct a new ICU4XComposingNormalizer instance for NFC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.try_new_nfc_unstable Rust documentation for `try_new_nfc_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_nfc(provider: ICU4XDataProvider): ICU4XComposingNormalizer | never; - - /** - - * Construct a new ICU4XComposingNormalizer instance for NFKC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.try_new_nfkc_unstable Rust documentation for `try_new_nfkc_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_nfkc(provider: ICU4XDataProvider): ICU4XComposingNormalizer | never; - - /** - - * Normalize a (potentially ill-formed) UTF8 string - - * Errors are mapped to REPLACEMENT CHARACTER - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.normalize_utf8 Rust documentation for `normalize_utf8`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - normalize(s: string): string | never; - - /** - - * Check if a (potentially ill-formed) UTF8 string is normalized - - * Errors are mapped to REPLACEMENT CHARACTER - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.is_normalized_utf8 Rust documentation for `is_normalized_utf8`} for more information. - */ - is_normalized(s: string): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XComposingNormalizer.js b/third_party/rust/icu_capi/js/include/ICU4XComposingNormalizer.js deleted file mode 100644 index 8793316b7ac1..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XComposingNormalizer.js +++ /dev/null @@ -1,81 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XComposingNormalizer_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XComposingNormalizer_destroy(underlying); -}); - -export class ICU4XComposingNormalizer { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XComposingNormalizer_box_destroy_registry.register(this, underlying); - } - } - - static create_nfc(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XComposingNormalizer_create_nfc(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XComposingNormalizer(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_nfkc(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XComposingNormalizer_create_nfkc(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XComposingNormalizer(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - normalize(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XComposingNormalizer_normalize(diplomat_receive_buffer, this.underlying, buf_arg_s.ptr, buf_arg_s.size, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - buf_arg_s.free(); - return diplomat_out; - } - - is_normalized(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = wasm.ICU4XComposingNormalizer_is_normalized(this.underlying, buf_arg_s.ptr, buf_arg_s.size); - buf_arg_s.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCustomTimeZone.d.ts b/third_party/rust/icu_capi/js/include/ICU4XCustomTimeZone.d.ts deleted file mode 100644 index a5f78f49ed86..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCustomTimeZone.d.ts +++ /dev/null @@ -1,281 +0,0 @@ -import { i32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XMetazoneCalculator } from "./ICU4XMetazoneCalculator"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html Rust documentation for `CustomTimeZone`} for more information. - */ -export class ICU4XCustomTimeZone { - - /** - - * Creates a time zone from an offset string. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.from_str Rust documentation for `from_str`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_string(s: string): ICU4XCustomTimeZone | never; - - /** - - * Creates a time zone with no information. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.new_empty Rust documentation for `new_empty`} for more information. - */ - static create_empty(): ICU4XCustomTimeZone; - - /** - - * Creates a time zone for UTC. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.utc Rust documentation for `utc`} for more information. - */ - static create_utc(): ICU4XCustomTimeZone; - - /** - - * Sets the `gmt_offset` field from offset seconds. - - * Errors if the offset seconds are out of range. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.try_from_offset_seconds Rust documentation for `try_from_offset_seconds`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - try_set_gmt_offset_seconds(offset_seconds: i32): void | never; - - /** - - * Clears the `gmt_offset` field. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds Rust documentation for `offset_seconds`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html 1} - */ - clear_gmt_offset(): void; - - /** - - * Returns the value of the `gmt_offset` field as offset seconds. - - * Errors if the `gmt_offset` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds Rust documentation for `offset_seconds`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - gmt_offset_seconds(): i32 | never; - - /** - - * Returns whether the `gmt_offset` field is positive. - - * Errors if the `gmt_offset` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_positive Rust documentation for `is_positive`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - is_gmt_offset_positive(): boolean | never; - - /** - - * Returns whether the `gmt_offset` field is zero. - - * Errors if the `gmt_offset` field is empty (which is not the same as zero). - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.is_zero Rust documentation for `is_zero`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - is_gmt_offset_zero(): boolean | never; - - /** - - * Returns whether the `gmt_offset` field has nonzero minutes. - - * Errors if the `gmt_offset` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_minutes Rust documentation for `has_minutes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - gmt_offset_has_minutes(): boolean | never; - - /** - - * Returns whether the `gmt_offset` field has nonzero seconds. - - * Errors if the `gmt_offset` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.has_seconds Rust documentation for `has_seconds`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - gmt_offset_has_seconds(): boolean | never; - - /** - - * Sets the `time_zone_id` field from a string. - - * Errors if the string is not a valid BCP-47 time zone ID. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id Rust documentation for `time_zone_id`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - try_set_time_zone_id(id: string): void | never; - - /** - - * Clears the `time_zone_id` field. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id Rust documentation for `time_zone_id`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html 1} - */ - clear_time_zone_id(): void; - - /** - - * Writes the value of the `time_zone_id` field as a string. - - * Errors if the `time_zone_id` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id Rust documentation for `time_zone_id`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.TimeZoneBcp47Id.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - time_zone_id(): string | never; - - /** - - * Sets the `metazone_id` field from a string. - - * Errors if the string is not a valid BCP-47 metazone ID. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id Rust documentation for `metazone_id`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - try_set_metazone_id(id: string): void | never; - - /** - - * Clears the `metazone_id` field. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id Rust documentation for `metazone_id`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html 1} - */ - clear_metazone_id(): void; - - /** - - * Writes the value of the `metazone_id` field as a string. - - * Errors if the `metazone_id` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id Rust documentation for `metazone_id`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneId.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - metazone_id(): string | never; - - /** - - * Sets the `zone_variant` field from a string. - - * Errors if the string is not a valid zone variant. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant Rust documentation for `zone_variant`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - try_set_zone_variant(id: string): void | never; - - /** - - * Clears the `zone_variant` field. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant Rust documentation for `zone_variant`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html 1} - */ - clear_zone_variant(): void; - - /** - - * Writes the value of the `zone_variant` field as a string. - - * Errors if the `zone_variant` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant Rust documentation for `zone_variant`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - zone_variant(): string | never; - - /** - - * Sets the `zone_variant` field to standard time. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard Rust documentation for `standard`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1} - */ - set_standard_time(): void; - - /** - - * Sets the `zone_variant` field to daylight time. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight Rust documentation for `daylight`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1} - */ - set_daylight_time(): void; - - /** - - * Returns whether the `zone_variant` field is standard time. - - * Errors if the `zone_variant` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard Rust documentation for `standard`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - is_standard_time(): boolean | never; - - /** - - * Returns whether the `zone_variant` field is daylight time. - - * Errors if the `zone_variant` field is empty. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight Rust documentation for `daylight`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - is_daylight_time(): boolean | never; - - /** - - * Sets the metazone based on the time zone and the local timestamp. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.maybe_calculate_metazone Rust documentation for `maybe_calculate_metazone`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.compute_metazone_from_time_zone 1} - */ - maybe_calculate_metazone(metazone_calculator: ICU4XMetazoneCalculator, local_datetime: ICU4XIsoDateTime): void; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XCustomTimeZone.js b/third_party/rust/icu_capi/js/include/ICU4XCustomTimeZone.js deleted file mode 100644 index 5e0b3ab6c87b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XCustomTimeZone.js +++ /dev/null @@ -1,327 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XCustomTimeZone_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XCustomTimeZone_destroy(underlying); -}); - -export class ICU4XCustomTimeZone { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XCustomTimeZone_box_destroy_registry.register(this, underlying); - } - } - - static create_from_string(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_create_from_string(diplomat_receive_buffer, buf_arg_s.ptr, buf_arg_s.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XCustomTimeZone(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_s.free(); - return diplomat_out; - } - - static create_empty() { - return new ICU4XCustomTimeZone(wasm.ICU4XCustomTimeZone_create_empty(), true, []); - } - - static create_utc() { - return new ICU4XCustomTimeZone(wasm.ICU4XCustomTimeZone_create_utc(), true, []); - } - - try_set_gmt_offset_seconds(arg_offset_seconds) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_try_set_gmt_offset_seconds(diplomat_receive_buffer, this.underlying, arg_offset_seconds); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - clear_gmt_offset() { - wasm.ICU4XCustomTimeZone_clear_gmt_offset(this.underlying); - } - - gmt_offset_seconds() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_gmt_offset_seconds(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Int32Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - is_gmt_offset_positive() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_is_gmt_offset_positive(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Uint8Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0] == 1; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - is_gmt_offset_zero() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_is_gmt_offset_zero(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Uint8Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0] == 1; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - gmt_offset_has_minutes() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_gmt_offset_has_minutes(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Uint8Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0] == 1; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - gmt_offset_has_seconds() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_gmt_offset_has_seconds(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Uint8Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0] == 1; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - try_set_time_zone_id(arg_id) { - const buf_arg_id = diplomatRuntime.DiplomatBuf.str(wasm, arg_id); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_try_set_time_zone_id(diplomat_receive_buffer, this.underlying, buf_arg_id.ptr, buf_arg_id.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_id.free(); - return diplomat_out; - } - - clear_time_zone_id() { - wasm.ICU4XCustomTimeZone_clear_time_zone_id(this.underlying); - } - - time_zone_id() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_time_zone_id(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - try_set_metazone_id(arg_id) { - const buf_arg_id = diplomatRuntime.DiplomatBuf.str(wasm, arg_id); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_try_set_metazone_id(diplomat_receive_buffer, this.underlying, buf_arg_id.ptr, buf_arg_id.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_id.free(); - return diplomat_out; - } - - clear_metazone_id() { - wasm.ICU4XCustomTimeZone_clear_metazone_id(this.underlying); - } - - metazone_id() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_metazone_id(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - try_set_zone_variant(arg_id) { - const buf_arg_id = diplomatRuntime.DiplomatBuf.str(wasm, arg_id); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_try_set_zone_variant(diplomat_receive_buffer, this.underlying, buf_arg_id.ptr, buf_arg_id.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_id.free(); - return diplomat_out; - } - - clear_zone_variant() { - wasm.ICU4XCustomTimeZone_clear_zone_variant(this.underlying); - } - - zone_variant() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_zone_variant(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - set_standard_time() { - wasm.ICU4XCustomTimeZone_set_standard_time(this.underlying); - } - - set_daylight_time() { - wasm.ICU4XCustomTimeZone_set_daylight_time(this.underlying); - } - - is_standard_time() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_is_standard_time(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Uint8Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0] == 1; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - is_daylight_time() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XCustomTimeZone_is_daylight_time(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = (new Uint8Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0] == 1; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - maybe_calculate_metazone(arg_metazone_calculator, arg_local_datetime) { - wasm.ICU4XCustomTimeZone_maybe_calculate_metazone(this.underlying, arg_metazone_calculator.underlying, arg_local_datetime.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDataProvider.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDataProvider.d.ts deleted file mode 100644 index 7ca2760d9738..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDataProvider.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocaleFallbacker } from "./ICU4XLocaleFallbacker"; - -/** - - * An ICU4X data provider, capable of loading ICU4X data keys from some source. - - * See the {@link https://docs.rs/icu_provider/latest/icu_provider/index.html Rust documentation for `icu_provider`} for more information. - */ -export class ICU4XDataProvider { - - /** - - * Constructs an `FsDataProvider` and returns it as an {@link ICU4XDataProvider `ICU4XDataProvider`}. Requires the `provider_fs` Cargo feature. Not supported in WASM. - - * See the {@link https://docs.rs/icu_provider_fs/latest/icu_provider_fs/struct.FsDataProvider.html Rust documentation for `FsDataProvider`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_fs(path: string): ICU4XDataProvider | never; - - /** - - * Constructs a testdata provider and returns it as an {@link ICU4XDataProvider `ICU4XDataProvider`}. Requires the `provider_test` and one of `any_provider` or `buffer_provider` Cargo features. - - * See the {@link https://docs.rs/icu_testdata/latest/icu_testdata/index.html Rust documentation for `icu_testdata`} for more information. - */ - static create_test(): ICU4XDataProvider; - - /** - - * Constructs a `BlobDataProvider` and returns it as an {@link ICU4XDataProvider `ICU4XDataProvider`}. - - * See the {@link https://docs.rs/icu_provider_blob/latest/icu_provider_blob/struct.BlobDataProvider.html Rust documentation for `BlobDataProvider`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_byte_slice(blob: Uint8Array): ICU4XDataProvider | never; - - /** - - * Constructs an empty {@link ICU4XDataProvider `ICU4XDataProvider`}. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/empty/struct.EmptyDataProvider.html Rust documentation for `EmptyDataProvider`} for more information. - */ - static create_empty(): ICU4XDataProvider; - - /** - - * Creates a provider that tries the current provider and then, if the current provider doesn't support the data key, another provider `other`. - - * This takes ownership of the `other` provider, leaving an empty provider in its place. - - * The providers must be the same type (Any or Buffer). This condition is satisfied if both providers originate from the same constructor, such as `create_from_byte_slice` or `create_fs`. If the condition is not upheld, a runtime error occurs. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/type.ForkByKeyProvider.html Rust documentation for `ForkByKeyProvider`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - fork_by_key(other: ICU4XDataProvider): void | never; - - /** - - * Same as `fork_by_key` but forks by locale instead of key. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/predicates/struct.MissingLocalePredicate.html Rust documentation for `MissingLocalePredicate`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - fork_by_locale(other: ICU4XDataProvider): void | never; - - /** - - * Enables locale fallbacking for data requests made to this provider. - - * Note that the test provider (from `create_test`) already has fallbacking enabled. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - - * Additional information: {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - enable_locale_fallback(): void | never; - - /** - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new_with_fallbacker Rust documentation for `new_with_fallbacker`} for more information. - - * Additional information: {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - enable_locale_fallback_with(fallbacker: ICU4XLocaleFallbacker): void | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDataProvider.js b/third_party/rust/icu_capi/js/include/ICU4XDataProvider.js deleted file mode 100644 index 3b1354f8248d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDataProvider.js +++ /dev/null @@ -1,134 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XDataProvider_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDataProvider_destroy(underlying); -}); - -export class ICU4XDataProvider { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDataProvider_box_destroy_registry.register(this, underlying); - } - } - - static create_fs(arg_path) { - const buf_arg_path = diplomatRuntime.DiplomatBuf.str(wasm, arg_path); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataProvider_create_fs(diplomat_receive_buffer, buf_arg_path.ptr, buf_arg_path.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDataProvider(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_path.free(); - return diplomat_out; - } - - static create_test() { - return new ICU4XDataProvider(wasm.ICU4XDataProvider_create_test(), true, []); - } - - static create_from_byte_slice(arg_blob) { - const buf_arg_blob = diplomatRuntime.DiplomatBuf.slice(wasm, arg_blob, 1); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataProvider_create_from_byte_slice(diplomat_receive_buffer, buf_arg_blob.ptr, buf_arg_blob.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDataProvider(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_blob.leak(); - return diplomat_out; - } - - static create_empty() { - return new ICU4XDataProvider(wasm.ICU4XDataProvider_create_empty(), true, []); - } - - fork_by_key(arg_other) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataProvider_fork_by_key(diplomat_receive_buffer, this.underlying, arg_other.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - fork_by_locale(arg_other) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataProvider_fork_by_locale(diplomat_receive_buffer, this.underlying, arg_other.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - enable_locale_fallback() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataProvider_enable_locale_fallback(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - enable_locale_fallback_with(arg_fallbacker) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataProvider_enable_locale_fallback_with(diplomat_receive_buffer, this.underlying, arg_fallbacker.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDataStruct.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDataStruct.d.ts deleted file mode 100644 index 8d2464f40ed5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDataStruct.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { u8 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; - -/** - - * A generic data struct to be used by ICU4X - - * This can be used to construct a StructDataProvider. - */ -export class ICU4XDataStruct { - - /** - - * Construct a new DecimalSymbolsV1 data struct. - - * C++ users: All string arguments must be valid UTF8 - - * See the {@link https://docs.rs/icu/latest/icu/decimal/provider/struct.DecimalSymbolsV1.html Rust documentation for `DecimalSymbolsV1`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_decimal_symbols_v1(plus_sign_prefix: string, plus_sign_suffix: string, minus_sign_prefix: string, minus_sign_suffix: string, decimal_separator: string, grouping_separator: string, primary_group_size: u8, secondary_group_size: u8, min_group_size: u8, digits: Uint32Array): ICU4XDataStruct | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDataStruct.js b/third_party/rust/icu_capi/js/include/ICU4XDataStruct.js deleted file mode 100644 index 22bc10d69b23..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDataStruct.js +++ /dev/null @@ -1,50 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XDataStruct_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDataStruct_destroy(underlying); -}); - -export class ICU4XDataStruct { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDataStruct_box_destroy_registry.register(this, underlying); - } - } - - static create_decimal_symbols_v1(arg_plus_sign_prefix, arg_plus_sign_suffix, arg_minus_sign_prefix, arg_minus_sign_suffix, arg_decimal_separator, arg_grouping_separator, arg_primary_group_size, arg_secondary_group_size, arg_min_group_size, arg_digits) { - const buf_arg_plus_sign_prefix = diplomatRuntime.DiplomatBuf.str(wasm, arg_plus_sign_prefix); - const buf_arg_plus_sign_suffix = diplomatRuntime.DiplomatBuf.str(wasm, arg_plus_sign_suffix); - const buf_arg_minus_sign_prefix = diplomatRuntime.DiplomatBuf.str(wasm, arg_minus_sign_prefix); - const buf_arg_minus_sign_suffix = diplomatRuntime.DiplomatBuf.str(wasm, arg_minus_sign_suffix); - const buf_arg_decimal_separator = diplomatRuntime.DiplomatBuf.str(wasm, arg_decimal_separator); - const buf_arg_grouping_separator = diplomatRuntime.DiplomatBuf.str(wasm, arg_grouping_separator); - const buf_arg_digits = diplomatRuntime.DiplomatBuf.slice(wasm, arg_digits, 4); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDataStruct_create_decimal_symbols_v1(diplomat_receive_buffer, buf_arg_plus_sign_prefix.ptr, buf_arg_plus_sign_prefix.size, buf_arg_plus_sign_suffix.ptr, buf_arg_plus_sign_suffix.size, buf_arg_minus_sign_prefix.ptr, buf_arg_minus_sign_prefix.size, buf_arg_minus_sign_suffix.ptr, buf_arg_minus_sign_suffix.size, buf_arg_decimal_separator.ptr, buf_arg_decimal_separator.size, buf_arg_grouping_separator.ptr, buf_arg_grouping_separator.size, arg_primary_group_size, arg_secondary_group_size, arg_min_group_size, buf_arg_digits.ptr, buf_arg_digits.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDataStruct(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_plus_sign_prefix.free(); - buf_arg_plus_sign_suffix.free(); - buf_arg_minus_sign_prefix.free(); - buf_arg_minus_sign_suffix.free(); - buf_arg_decimal_separator.free(); - buf_arg_grouping_separator.free(); - buf_arg_digits.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDate.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDate.d.ts deleted file mode 100644 index 7ff938aa2a16..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDate.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { u8, i32, u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XCalendar } from "./ICU4XCalendar"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDate } from "./ICU4XIsoDate"; -import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday"; -import { ICU4XWeekCalculator } from "./ICU4XWeekCalculator"; -import { ICU4XWeekOf } from "./ICU4XWeekOf"; - -/** - - * An ICU4X Date object capable of containing a date and time for any calendar. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html Rust documentation for `Date`} for more information. - */ -export class ICU4XDate { - - /** - - * Creates a new {@link ICU4XDate `ICU4XDate`} representing the ISO date and time given but in a given calendar - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.new_from_iso Rust documentation for `new_from_iso`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_iso_in_calendar(year: i32, month: u8, day: u8, calendar: ICU4XCalendar): ICU4XDate | never; - - /** - - * Creates a new {@link ICU4XDate `ICU4XDate`} from the given codes, which are interpreted in the given calendar system - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_from_codes Rust documentation for `try_new_from_codes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_codes_in_calendar(era_code: string, year: i32, month_code: string, day: u8, calendar: ICU4XCalendar): ICU4XDate | never; - - /** - - * Convert this date to one in a different calendar - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar Rust documentation for `to_calendar`} for more information. - */ - to_calendar(calendar: ICU4XCalendar): ICU4XDate; - - /** - - * Converts this date to ISO - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_iso Rust documentation for `to_iso`} for more information. - */ - to_iso(): ICU4XIsoDate; - - /** - - * Returns the 1-indexed day in the month for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month Rust documentation for `day_of_month`} for more information. - */ - day_of_month(): u32; - - /** - - * Returns the day in the week for this day - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week Rust documentation for `day_of_week`} for more information. - */ - day_of_week(): ICU4XIsoWeekday; - - /** - - * Returns the week number in this month, 1-indexed, based on what is considered the first day of the week (often a locale preference). - - * `first_weekday` can be obtained via `first_weekday()` on {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month Rust documentation for `week_of_month`} for more information. - */ - week_of_month(first_weekday: ICU4XIsoWeekday): u32; - - /** - - * Returns the week number in this year, using week data - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year Rust documentation for `week_of_year`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - week_of_year(calculator: ICU4XWeekCalculator): ICU4XWeekOf | never; - - /** - - * Returns 1-indexed number of the month of this date in its year - - * Note that for lunar calendars this may not lead to the same month having the same ordinal month across years; use month_code if you care about month identity. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month Rust documentation for `month`} for more information. - */ - ordinal_month(): u32; - - /** - - * Returns the month code for this date. Typically something like "M01", "M02", but can be more complicated for lunar calendars. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month Rust documentation for `month`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - month_code(): string | never; - - /** - - * Returns the year number in the current era for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year Rust documentation for `year`} for more information. - */ - year_in_era(): i32; - - /** - - * Returns the era for this date, - - * See the {@link https://docs.rs/icu/latest/icu/struct.Date.html#method.year Rust documentation for `year`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/types/struct.Era.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - era(): string | never; - - /** - - * Returns the number of months in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year Rust documentation for `months_in_year`} for more information. - */ - months_in_year(): u8; - - /** - - * Returns the number of days in the month represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month Rust documentation for `days_in_month`} for more information. - */ - days_in_month(): u8; - - /** - - * Returns the number of days in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year Rust documentation for `days_in_year`} for more information. - */ - days_in_year(): u32; - - /** - - * Returns the {@link ICU4XCalendar `ICU4XCalendar`} object backing this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar Rust documentation for `calendar`} for more information. - */ - calendar(): ICU4XCalendar; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDate.js b/third_party/rust/icu_capi/js/include/ICU4XDate.js deleted file mode 100644 index de7b646eb066..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDate.js +++ /dev/null @@ -1,161 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XCalendar } from "./ICU4XCalendar.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoDate } from "./ICU4XIsoDate.js" -import { ICU4XIsoWeekday_js_to_rust, ICU4XIsoWeekday_rust_to_js } from "./ICU4XIsoWeekday.js" -import { ICU4XWeekOf } from "./ICU4XWeekOf.js" -import { ICU4XWeekRelativeUnit_js_to_rust, ICU4XWeekRelativeUnit_rust_to_js } from "./ICU4XWeekRelativeUnit.js" - -const ICU4XDate_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDate_destroy(underlying); -}); - -export class ICU4XDate { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDate_box_destroy_registry.register(this, underlying); - } - } - - static create_from_iso_in_calendar(arg_year, arg_month, arg_day, arg_calendar) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDate_create_from_iso_in_calendar(diplomat_receive_buffer, arg_year, arg_month, arg_day, arg_calendar.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDate(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_codes_in_calendar(arg_era_code, arg_year, arg_month_code, arg_day, arg_calendar) { - const buf_arg_era_code = diplomatRuntime.DiplomatBuf.str(wasm, arg_era_code); - const buf_arg_month_code = diplomatRuntime.DiplomatBuf.str(wasm, arg_month_code); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDate_create_from_codes_in_calendar(diplomat_receive_buffer, buf_arg_era_code.ptr, buf_arg_era_code.size, arg_year, buf_arg_month_code.ptr, buf_arg_month_code.size, arg_day, arg_calendar.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDate(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_era_code.free(); - buf_arg_month_code.free(); - return diplomat_out; - } - - to_calendar(arg_calendar) { - return new ICU4XDate(wasm.ICU4XDate_to_calendar(this.underlying, arg_calendar.underlying), true, []); - } - - to_iso() { - return new ICU4XIsoDate(wasm.ICU4XDate_to_iso(this.underlying), true, []); - } - - day_of_month() { - return wasm.ICU4XDate_day_of_month(this.underlying); - } - - day_of_week() { - return ICU4XIsoWeekday_rust_to_js[wasm.ICU4XDate_day_of_week(this.underlying)]; - } - - week_of_month(arg_first_weekday) { - return wasm.ICU4XDate_week_of_month(this.underlying, ICU4XIsoWeekday_js_to_rust[arg_first_weekday]); - } - - week_of_year(arg_calculator) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(9, 4); - wasm.ICU4XDate_week_of_year(diplomat_receive_buffer, this.underlying, arg_calculator.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 8); - if (is_ok) { - const ok_value = new ICU4XWeekOf(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - ordinal_month() { - return wasm.ICU4XDate_ordinal_month(this.underlying); - } - - month_code() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDate_month_code(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - year_in_era() { - return wasm.ICU4XDate_year_in_era(this.underlying); - } - - era() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDate_era(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - months_in_year() { - return wasm.ICU4XDate_months_in_year(this.underlying); - } - - days_in_month() { - return wasm.ICU4XDate_days_in_month(this.underlying); - } - - days_in_year() { - return wasm.ICU4XDate_days_in_year(this.underlying); - } - - calendar() { - return new ICU4XCalendar(wasm.ICU4XDate_calendar(this.underlying), true, []); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDateFormatter.d.ts deleted file mode 100644 index 461fc78cd4e2..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateFormatter.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDate } from "./ICU4XDate"; -import { ICU4XDateLength } from "./ICU4XDateLength"; -import { ICU4XDateTime } from "./ICU4XDateTime"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDate } from "./ICU4XIsoDate"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * An ICU4X DateFormatter object capable of formatting a {@link ICU4XDate `ICU4XDate`} as a string, using some calendar specified at runtime in the locale. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html Rust documentation for `DateFormatter`} for more information. - */ -export class ICU4XDateFormatter { - - /** - - * Creates a new {@link ICU4XDateFormatter `ICU4XDateFormatter`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.try_new_with_length_unstable Rust documentation for `try_new_with_length_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength): ICU4XDateFormatter | never; - - /** - - * Formats a {@link ICU4XDate `ICU4XDate`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_date(value: ICU4XDate): string | never; - - /** - - * Formats a {@link ICU4XIsoDate `ICU4XIsoDate`} to a string. - - * Will convert to this formatter's calendar first - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_date(value: ICU4XIsoDate): string | never; - - /** - - * Formats a {@link ICU4XDateTime `ICU4XDateTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_datetime(value: ICU4XDateTime): string | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string. - - * Will convert to this formatter's calendar first - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime(value: ICU4XIsoDateTime): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XDateFormatter.js deleted file mode 100644 index d48003362d15..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateFormatter.js +++ /dev/null @@ -1,112 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateLength_js_to_rust, ICU4XDateLength_rust_to_js } from "./ICU4XDateLength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XDateFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDateFormatter_destroy(underlying); -}); - -export class ICU4XDateFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDateFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_length(arg_provider, arg_locale, arg_date_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateFormatter_create_with_length(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDateFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_date(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateFormatter_format_date(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_iso_date(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateFormatter_format_iso_date(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateFormatter_format_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_iso_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateFormatter_format_iso_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateLength.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDateLength.d.ts deleted file mode 100644 index 1229c2ce096a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateLength.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/datetime/options/length/enum.Date.html Rust documentation for `Date`} for more information. - */ -export enum ICU4XDateLength { - /** - */ - Full = 'Full', - /** - */ - Long = 'Long', - /** - */ - Medium = 'Medium', - /** - */ - Short = 'Short', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateLength.js b/third_party/rust/icu_capi/js/include/ICU4XDateLength.js deleted file mode 100644 index bca6c2d8b895..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateLength.js +++ /dev/null @@ -1,23 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XDateLength_js_to_rust = { - "Full": 0, - "Long": 1, - "Medium": 2, - "Short": 3, -}; - -export const ICU4XDateLength_rust_to_js = { - [0]: "Full", - [1]: "Long", - [2]: "Medium", - [3]: "Short", -}; - -export const ICU4XDateLength = { - "Full": "Full", - "Long": "Long", - "Medium": "Medium", - "Short": "Short", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateTime.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDateTime.d.ts deleted file mode 100644 index d0c6f1f1f1d6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateTime.d.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { u8, i32, u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XCalendar } from "./ICU4XCalendar"; -import { ICU4XDate } from "./ICU4XDate"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday"; -import { ICU4XTime } from "./ICU4XTime"; -import { ICU4XWeekCalculator } from "./ICU4XWeekCalculator"; -import { ICU4XWeekOf } from "./ICU4XWeekOf"; - -/** - - * An ICU4X DateTime object capable of containing a date and time for any calendar. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html Rust documentation for `DateTime`} for more information. - */ -export class ICU4XDateTime { - - /** - - * Creates a new {@link ICU4XDateTime `ICU4XDateTime`} representing the ISO date and time given but in a given calendar - - * See the {@link https://docs.rs/icu/latest/icu/struct.DateTime.html#method.new_from_iso Rust documentation for `new_from_iso`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_iso_in_calendar(year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, nanosecond: u32, calendar: ICU4XCalendar): ICU4XDateTime | never; - - /** - - * Creates a new {@link ICU4XDateTime `ICU4XDateTime`} from the given codes, which are interpreted in the given calendar system - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_from_codes Rust documentation for `try_new_from_codes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_codes_in_calendar(era_code: string, year: i32, month_code: string, day: u8, hour: u8, minute: u8, second: u8, nanosecond: u32, calendar: ICU4XCalendar): ICU4XDateTime | never; - - /** - - * Creates a new {@link ICU4XDateTime `ICU4XDateTime`} from an {@link ICU4XDate `ICU4XDate`} and {@link ICU4XTime `ICU4XTime`} object - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new Rust documentation for `new`} for more information. - */ - static create_from_date_and_time(date: ICU4XDate, time: ICU4XTime): ICU4XDateTime; - - /** - - * Gets a copy of the date contained in this object - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date Rust documentation for `date`} for more information. - */ - date(): ICU4XDate; - - /** - - * Gets the time contained in this object - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time Rust documentation for `time`} for more information. - */ - time(): ICU4XTime; - - /** - - * Converts this date to ISO - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_iso Rust documentation for `to_iso`} for more information. - */ - to_iso(): ICU4XIsoDateTime; - - /** - - * Convert this datetime to one in a different calendar - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar Rust documentation for `to_calendar`} for more information. - */ - to_calendar(calendar: ICU4XCalendar): ICU4XDateTime; - - /** - - * Returns the hour in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour Rust documentation for `hour`} for more information. - */ - hour(): u8; - - /** - - * Returns the minute in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute Rust documentation for `minute`} for more information. - */ - minute(): u8; - - /** - - * Returns the second in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second Rust documentation for `second`} for more information. - */ - second(): u8; - - /** - - * Returns the nanosecond in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond Rust documentation for `nanosecond`} for more information. - */ - nanosecond(): u32; - - /** - - * Returns the 1-indexed day in the month for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month Rust documentation for `day_of_month`} for more information. - */ - day_of_month(): u32; - - /** - - * Returns the day in the week for this day - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week Rust documentation for `day_of_week`} for more information. - */ - day_of_week(): ICU4XIsoWeekday; - - /** - - * Returns the week number in this month, 1-indexed, based on what is considered the first day of the week (often a locale preference). - - * `first_weekday` can be obtained via `first_weekday()` on {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month Rust documentation for `week_of_month`} for more information. - */ - week_of_month(first_weekday: ICU4XIsoWeekday): u32; - - /** - - * Returns the week number in this year, using week data - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year Rust documentation for `week_of_year`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - week_of_year(calculator: ICU4XWeekCalculator): ICU4XWeekOf | never; - - /** - - * Returns 1-indexed number of the month of this date in its year - - * Note that for lunar calendars this may not lead to the same month having the same ordinal month across years; use month_code if you care about month identity. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month Rust documentation for `month`} for more information. - */ - ordinal_month(): u32; - - /** - - * Returns the month code for this date. Typically something like "M01", "M02", but can be more complicated for lunar calendars. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month Rust documentation for `month`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - month_code(): string | never; - - /** - - * Returns the year number in the current era for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year Rust documentation for `year`} for more information. - */ - year_in_era(): i32; - - /** - - * Returns the era for this date, - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year Rust documentation for `year`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - era(): string | never; - - /** - - * Returns the number of months in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year Rust documentation for `months_in_year`} for more information. - */ - months_in_year(): u8; - - /** - - * Returns the number of days in the month represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month Rust documentation for `days_in_month`} for more information. - */ - days_in_month(): u8; - - /** - - * Returns the number of days in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year Rust documentation for `days_in_year`} for more information. - */ - days_in_year(): u32; - - /** - - * Returns the {@link ICU4XCalendar `ICU4XCalendar`} object backing this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar Rust documentation for `calendar`} for more information. - */ - calendar(): ICU4XCalendar; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateTime.js b/third_party/rust/icu_capi/js/include/ICU4XDateTime.js deleted file mode 100644 index 3d0d3d910fd3..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateTime.js +++ /dev/null @@ -1,191 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XCalendar } from "./ICU4XCalendar.js" -import { ICU4XDate } from "./ICU4XDate.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime.js" -import { ICU4XIsoWeekday_js_to_rust, ICU4XIsoWeekday_rust_to_js } from "./ICU4XIsoWeekday.js" -import { ICU4XTime } from "./ICU4XTime.js" -import { ICU4XWeekOf } from "./ICU4XWeekOf.js" -import { ICU4XWeekRelativeUnit_js_to_rust, ICU4XWeekRelativeUnit_rust_to_js } from "./ICU4XWeekRelativeUnit.js" - -const ICU4XDateTime_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDateTime_destroy(underlying); -}); - -export class ICU4XDateTime { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDateTime_box_destroy_registry.register(this, underlying); - } - } - - static create_from_iso_in_calendar(arg_year, arg_month, arg_day, arg_hour, arg_minute, arg_second, arg_nanosecond, arg_calendar) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTime_create_from_iso_in_calendar(diplomat_receive_buffer, arg_year, arg_month, arg_day, arg_hour, arg_minute, arg_second, arg_nanosecond, arg_calendar.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDateTime(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_codes_in_calendar(arg_era_code, arg_year, arg_month_code, arg_day, arg_hour, arg_minute, arg_second, arg_nanosecond, arg_calendar) { - const buf_arg_era_code = diplomatRuntime.DiplomatBuf.str(wasm, arg_era_code); - const buf_arg_month_code = diplomatRuntime.DiplomatBuf.str(wasm, arg_month_code); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTime_create_from_codes_in_calendar(diplomat_receive_buffer, buf_arg_era_code.ptr, buf_arg_era_code.size, arg_year, buf_arg_month_code.ptr, buf_arg_month_code.size, arg_day, arg_hour, arg_minute, arg_second, arg_nanosecond, arg_calendar.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDateTime(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_era_code.free(); - buf_arg_month_code.free(); - return diplomat_out; - } - - static create_from_date_and_time(arg_date, arg_time) { - return new ICU4XDateTime(wasm.ICU4XDateTime_create_from_date_and_time(arg_date.underlying, arg_time.underlying), true, []); - } - - date() { - return new ICU4XDate(wasm.ICU4XDateTime_date(this.underlying), true, []); - } - - time() { - return new ICU4XTime(wasm.ICU4XDateTime_time(this.underlying), true, []); - } - - to_iso() { - return new ICU4XIsoDateTime(wasm.ICU4XDateTime_to_iso(this.underlying), true, []); - } - - to_calendar(arg_calendar) { - return new ICU4XDateTime(wasm.ICU4XDateTime_to_calendar(this.underlying, arg_calendar.underlying), true, []); - } - - hour() { - return wasm.ICU4XDateTime_hour(this.underlying); - } - - minute() { - return wasm.ICU4XDateTime_minute(this.underlying); - } - - second() { - return wasm.ICU4XDateTime_second(this.underlying); - } - - nanosecond() { - return wasm.ICU4XDateTime_nanosecond(this.underlying); - } - - day_of_month() { - return wasm.ICU4XDateTime_day_of_month(this.underlying); - } - - day_of_week() { - return ICU4XIsoWeekday_rust_to_js[wasm.ICU4XDateTime_day_of_week(this.underlying)]; - } - - week_of_month(arg_first_weekday) { - return wasm.ICU4XDateTime_week_of_month(this.underlying, ICU4XIsoWeekday_js_to_rust[arg_first_weekday]); - } - - week_of_year(arg_calculator) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(9, 4); - wasm.ICU4XDateTime_week_of_year(diplomat_receive_buffer, this.underlying, arg_calculator.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 8); - if (is_ok) { - const ok_value = new ICU4XWeekOf(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - ordinal_month() { - return wasm.ICU4XDateTime_ordinal_month(this.underlying); - } - - month_code() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTime_month_code(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - year_in_era() { - return wasm.ICU4XDateTime_year_in_era(this.underlying); - } - - era() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTime_era(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - months_in_year() { - return wasm.ICU4XDateTime_months_in_year(this.underlying); - } - - days_in_month() { - return wasm.ICU4XDateTime_days_in_month(this.underlying); - } - - days_in_year() { - return wasm.ICU4XDateTime_days_in_year(this.underlying); - } - - calendar() { - return new ICU4XCalendar(wasm.ICU4XDateTime_calendar(this.underlying), true, []); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateTimeFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDateTimeFormatter.d.ts deleted file mode 100644 index ee956df0ce9a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateTimeFormatter.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDateLength } from "./ICU4XDateLength"; -import { ICU4XDateTime } from "./ICU4XDateTime"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTimeLength } from "./ICU4XTimeLength"; - -/** - - * An ICU4X DateFormatter object capable of formatting a {@link ICU4XDateTime `ICU4XDateTime`} as a string, using some calendar specified at runtime in the locale. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html Rust documentation for `DateTimeFormatter`} for more information. - */ -export class ICU4XDateTimeFormatter { - - /** - - * Creates a new {@link ICU4XDateTimeFormatter `ICU4XDateTimeFormatter`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_lengths(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength): ICU4XDateTimeFormatter | never; - - /** - - * Formats a {@link ICU4XDateTime `ICU4XDateTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_datetime(value: ICU4XDateTime): string | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string. - - * Will convert to this formatter's calendar first - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime(value: ICU4XIsoDateTime): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDateTimeFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XDateTimeFormatter.js deleted file mode 100644 index 83bbbae72f90..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDateTimeFormatter.js +++ /dev/null @@ -1,75 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateLength_js_to_rust, ICU4XDateLength_rust_to_js } from "./ICU4XDateLength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XTimeLength_js_to_rust, ICU4XTimeLength_rust_to_js } from "./ICU4XTimeLength.js" - -const ICU4XDateTimeFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDateTimeFormatter_destroy(underlying); -}); - -export class ICU4XDateTimeFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDateTimeFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_lengths(arg_provider, arg_locale, arg_date_length, arg_time_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTimeFormatter_create_with_lengths(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length], ICU4XTimeLength_js_to_rust[arg_time_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDateTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTimeFormatter_format_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_iso_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDateTimeFormatter_format_iso_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDecomposed.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDecomposed.d.ts deleted file mode 100644 index a95e7cbde82f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDecomposed.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { char } from "./diplomat-runtime" - -/** - - * The outcome of non-recursive canonical decomposition of a character. `second` will be NUL when the decomposition expands to a single character (which may or may not be the original one) - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/properties/enum.Decomposed.html Rust documentation for `Decomposed`} for more information. - */ -export class ICU4XDecomposed { - first: char; - second: char; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDecomposed.js b/third_party/rust/icu_capi/js/include/ICU4XDecomposed.js deleted file mode 100644 index 8f5e80f5e43b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDecomposed.js +++ /dev/null @@ -1,9 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export class ICU4XDecomposed { - constructor(underlying) { - this.first = String.fromCharCode((new Uint32Array(wasm.memory.buffer, underlying, 1))[0]); - this.second = String.fromCharCode((new Uint32Array(wasm.memory.buffer, underlying + 4, 1))[0]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDecomposingNormalizer.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDecomposingNormalizer.d.ts deleted file mode 100644 index d4e6498ed19e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDecomposingNormalizer.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html Rust documentation for `DecomposingNormalizer`} for more information. - */ -export class ICU4XDecomposingNormalizer { - - /** - - * Construct a new ICU4XDecomposingNormalizer instance for NFC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.try_new_nfd_unstable Rust documentation for `try_new_nfd_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_nfd(provider: ICU4XDataProvider): ICU4XDecomposingNormalizer | never; - - /** - - * Construct a new ICU4XDecomposingNormalizer instance for NFKC - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.try_new_nfkd_unstable Rust documentation for `try_new_nfkd_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_nfkd(provider: ICU4XDataProvider): ICU4XDecomposingNormalizer | never; - - /** - - * Normalize a (potentially ill-formed) UTF8 string - - * Errors are mapped to REPLACEMENT CHARACTER - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.normalize_utf8 Rust documentation for `normalize_utf8`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - normalize(s: string): string | never; - - /** - - * Check if a (potentially ill-formed) UTF8 string is normalized - - * Errors are mapped to REPLACEMENT CHARACTER - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.is_normalized_utf8 Rust documentation for `is_normalized_utf8`} for more information. - */ - is_normalized(s: string): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDecomposingNormalizer.js b/third_party/rust/icu_capi/js/include/ICU4XDecomposingNormalizer.js deleted file mode 100644 index e1357dbb2a34..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDecomposingNormalizer.js +++ /dev/null @@ -1,81 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XDecomposingNormalizer_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XDecomposingNormalizer_destroy(underlying); -}); - -export class ICU4XDecomposingNormalizer { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XDecomposingNormalizer_box_destroy_registry.register(this, underlying); - } - } - - static create_nfd(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDecomposingNormalizer_create_nfd(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDecomposingNormalizer(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_nfkd(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDecomposingNormalizer_create_nfkd(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XDecomposingNormalizer(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - normalize(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XDecomposingNormalizer_normalize(diplomat_receive_buffer, this.underlying, buf_arg_s.ptr, buf_arg_s.size, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - buf_arg_s.free(); - return diplomat_out; - } - - is_normalized(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = wasm.ICU4XDecomposingNormalizer_is_normalized(this.underlying, buf_arg_s.ptr, buf_arg_s.size); - buf_arg_s.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesFallback.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesFallback.d.ts deleted file mode 100644 index 46f8452fb1ee..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesFallback.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/options/enum.Fallback.html Rust documentation for `Fallback`} for more information. - */ -export enum ICU4XDisplayNamesFallback { - /** - */ - Code = 'Code', - /** - */ - None = 'None', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesFallback.js b/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesFallback.js deleted file mode 100644 index aa7dc2d43fdd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesFallback.js +++ /dev/null @@ -1,17 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XDisplayNamesFallback_js_to_rust = { - "Code": 0, - "None": 1, -}; - -export const ICU4XDisplayNamesFallback_rust_to_js = { - [0]: "Code", - [1]: "None", -}; - -export const ICU4XDisplayNamesFallback = { - "Code": "Code", - "None": "None", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesOptionsV1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesOptionsV1.d.ts deleted file mode 100644 index 2f964d343977..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesOptionsV1.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ICU4XDisplayNamesFallback } from "./ICU4XDisplayNamesFallback"; -import { ICU4XDisplayNamesStyle } from "./ICU4XDisplayNamesStyle"; -import { ICU4XLanguageDisplay } from "./ICU4XLanguageDisplay"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/options/struct.DisplayNamesOptions.html Rust documentation for `DisplayNamesOptions`} for more information. - */ -export class ICU4XDisplayNamesOptionsV1 { - style: ICU4XDisplayNamesStyle; - fallback: ICU4XDisplayNamesFallback; - language_display: ICU4XLanguageDisplay; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesOptionsV1.js b/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesOptionsV1.js deleted file mode 100644 index eeaa0100b35a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesOptionsV1.js +++ /dev/null @@ -1,13 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDisplayNamesFallback_js_to_rust, ICU4XDisplayNamesFallback_rust_to_js } from "./ICU4XDisplayNamesFallback.js" -import { ICU4XDisplayNamesStyle_js_to_rust, ICU4XDisplayNamesStyle_rust_to_js } from "./ICU4XDisplayNamesStyle.js" -import { ICU4XLanguageDisplay_js_to_rust, ICU4XLanguageDisplay_rust_to_js } from "./ICU4XLanguageDisplay.js" - -export class ICU4XDisplayNamesOptionsV1 { - constructor(underlying) { - this.style = ICU4XDisplayNamesStyle_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying)]; - this.fallback = ICU4XDisplayNamesFallback_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 4)]; - this.language_display = ICU4XLanguageDisplay_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 8)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesStyle.d.ts b/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesStyle.d.ts deleted file mode 100644 index 5f92c6e96142..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesStyle.d.ts +++ /dev/null @@ -1,22 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/options/enum.Style.html Rust documentation for `Style`} for more information. - */ -export enum ICU4XDisplayNamesStyle { - /** - */ - Auto = 'Auto', - /** - */ - Narrow = 'Narrow', - /** - */ - Short = 'Short', - /** - */ - Long = 'Long', - /** - */ - Menu = 'Menu', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesStyle.js b/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesStyle.js deleted file mode 100644 index 9bb346422941..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XDisplayNamesStyle.js +++ /dev/null @@ -1,26 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XDisplayNamesStyle_js_to_rust = { - "Auto": 0, - "Narrow": 1, - "Short": 2, - "Long": 3, - "Menu": 4, -}; - -export const ICU4XDisplayNamesStyle_rust_to_js = { - [0]: "Auto", - [1]: "Narrow", - [2]: "Short", - [3]: "Long", - [4]: "Menu", -}; - -export const ICU4XDisplayNamesStyle = { - "Auto": "Auto", - "Narrow": "Narrow", - "Short": "Short", - "Long": "Long", - "Menu": "Menu", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XError.d.ts b/third_party/rust/icu_capi/js/include/ICU4XError.d.ts deleted file mode 100644 index ef00127f3660..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XError.d.ts +++ /dev/null @@ -1,183 +0,0 @@ - -/** - - * A common enum for errors that ICU4X may return, organized by API - - * The error names are stable and can be checked against as strings in the JS API - - * Additional information: {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.Error.html 1}, {@link https://docs.rs/icu/latest/icu/calendar/enum.CalendarError.html 2}, {@link https://docs.rs/icu/latest/icu/collator/enum.CollatorError.html 3}, {@link https://docs.rs/icu/latest/icu/datetime/enum.DateTimeError.html 4}, {@link https://docs.rs/icu/latest/icu/decimal/enum.DecimalError.html 5}, {@link https://docs.rs/icu/latest/icu/list/enum.ListError.html 6}, {@link https://docs.rs/icu/latest/icu/locid/enum.ParserError.html 7}, {@link https://docs.rs/icu/latest/icu/locid_transform/enum.LocaleTransformError.html 8}, {@link https://docs.rs/icu/latest/icu/normalizer/enum.NormalizerError.html 9}, {@link https://docs.rs/icu/latest/icu/plurals/enum.PluralsError.html 10}, {@link https://docs.rs/icu/latest/icu/properties/enum.PropertiesError.html 11}, {@link https://docs.rs/icu/latest/icu/provider/struct.DataError.html 12}, {@link https://docs.rs/icu/latest/icu/provider/enum.DataErrorKind.html 13}, {@link https://docs.rs/icu/latest/icu/segmenter/enum.SegmenterError.html 14}, {@link https://docs.rs/icu/latest/icu/timezone/enum.TimeZoneError.html 15} - */ -export enum ICU4XError { - /** - - * The error is not currently categorized as ICU4XError. Please file a bug - */ - UnknownError = 'UnknownError', - /** - - * An error arising from writing to a string Typically found when not enough space is allocated Most APIs that return a string may return this error - */ - WriteableError = 'WriteableError', - /** - */ - OutOfBoundsError = 'OutOfBoundsError', - /** - */ - DataMissingDataKeyError = 'DataMissingDataKeyError', - /** - */ - DataMissingVariantError = 'DataMissingVariantError', - /** - */ - DataMissingLocaleError = 'DataMissingLocaleError', - /** - */ - DataNeedsVariantError = 'DataNeedsVariantError', - /** - */ - DataNeedsLocaleError = 'DataNeedsLocaleError', - /** - */ - DataExtraneousLocaleError = 'DataExtraneousLocaleError', - /** - */ - DataFilteredResourceError = 'DataFilteredResourceError', - /** - */ - DataMismatchedTypeError = 'DataMismatchedTypeError', - /** - */ - DataMissingPayloadError = 'DataMissingPayloadError', - /** - */ - DataInvalidStateError = 'DataInvalidStateError', - /** - */ - DataCustomError = 'DataCustomError', - /** - */ - DataIoError = 'DataIoError', - /** - */ - DataUnavailableBufferFormatError = 'DataUnavailableBufferFormatError', - /** - */ - DataMismatchedAnyBufferError = 'DataMismatchedAnyBufferError', - /** - - * The subtag being requested was not set - */ - LocaleUndefinedSubtagError = 'LocaleUndefinedSubtagError', - /** - - * The locale or subtag string failed to parse - */ - LocaleParserLanguageError = 'LocaleParserLanguageError', - /** - */ - LocaleParserSubtagError = 'LocaleParserSubtagError', - /** - */ - LocaleParserExtensionError = 'LocaleParserExtensionError', - /** - - * Attempted to construct an invalid data struct - */ - DataStructValidityError = 'DataStructValidityError', - /** - */ - PropertyUnknownScriptIdError = 'PropertyUnknownScriptIdError', - /** - */ - PropertyUnknownGeneralCategoryGroupError = 'PropertyUnknownGeneralCategoryGroupError', - /** - */ - PropertyUnexpectedPropertyNameError = 'PropertyUnexpectedPropertyNameError', - /** - */ - FixedDecimalLimitError = 'FixedDecimalLimitError', - /** - */ - FixedDecimalSyntaxError = 'FixedDecimalSyntaxError', - /** - */ - PluralsParserError = 'PluralsParserError', - /** - */ - CalendarParseError = 'CalendarParseError', - /** - */ - CalendarOverflowError = 'CalendarOverflowError', - /** - */ - CalendarUnderflowError = 'CalendarUnderflowError', - /** - */ - CalendarOutOfRangeError = 'CalendarOutOfRangeError', - /** - */ - CalendarUnknownEraError = 'CalendarUnknownEraError', - /** - */ - CalendarUnknownMonthCodeError = 'CalendarUnknownMonthCodeError', - /** - */ - CalendarMissingInputError = 'CalendarMissingInputError', - /** - */ - CalendarUnknownKindError = 'CalendarUnknownKindError', - /** - */ - CalendarMissingError = 'CalendarMissingError', - /** - */ - DateTimePatternError = 'DateTimePatternError', - /** - */ - DateTimeMissingInputFieldError = 'DateTimeMissingInputFieldError', - /** - */ - DateTimeSkeletonError = 'DateTimeSkeletonError', - /** - */ - DateTimeUnsupportedFieldError = 'DateTimeUnsupportedFieldError', - /** - */ - DateTimeUnsupportedOptionsError = 'DateTimeUnsupportedOptionsError', - /** - */ - DateTimeMissingWeekdaySymbolError = 'DateTimeMissingWeekdaySymbolError', - /** - */ - DateTimeMissingMonthSymbolError = 'DateTimeMissingMonthSymbolError', - /** - */ - DateTimeFixedDecimalError = 'DateTimeFixedDecimalError', - /** - */ - DateTimeMismatchedCalendarError = 'DateTimeMismatchedCalendarError', - /** - */ - TinyStrTooLargeError = 'TinyStrTooLargeError', - /** - */ - TinyStrContainsNullError = 'TinyStrContainsNullError', - /** - */ - TinyStrNonAsciiError = 'TinyStrNonAsciiError', - /** - */ - TimeZoneOffsetOutOfBoundsError = 'TimeZoneOffsetOutOfBoundsError', - /** - */ - TimeZoneInvalidOffsetError = 'TimeZoneInvalidOffsetError', - /** - */ - TimeZoneMissingInputError = 'TimeZoneMissingInputError', - /** - */ - NormalizerFutureExtensionError = 'NormalizerFutureExtensionError', - /** - */ - NormalizerValidationError = 'NormalizerValidationError', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XError.js b/third_party/rust/icu_capi/js/include/ICU4XError.js deleted file mode 100644 index d64c46208f6e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XError.js +++ /dev/null @@ -1,173 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XError_js_to_rust = { - "UnknownError": 0, - "WriteableError": 1, - "OutOfBoundsError": 2, - "DataMissingDataKeyError": 256, - "DataMissingVariantError": 257, - "DataMissingLocaleError": 258, - "DataNeedsVariantError": 259, - "DataNeedsLocaleError": 260, - "DataExtraneousLocaleError": 261, - "DataFilteredResourceError": 262, - "DataMismatchedTypeError": 263, - "DataMissingPayloadError": 264, - "DataInvalidStateError": 265, - "DataCustomError": 266, - "DataIoError": 267, - "DataUnavailableBufferFormatError": 268, - "DataMismatchedAnyBufferError": 269, - "LocaleUndefinedSubtagError": 512, - "LocaleParserLanguageError": 513, - "LocaleParserSubtagError": 514, - "LocaleParserExtensionError": 515, - "DataStructValidityError": 768, - "PropertyUnknownScriptIdError": 1024, - "PropertyUnknownGeneralCategoryGroupError": 1025, - "PropertyUnexpectedPropertyNameError": 1026, - "FixedDecimalLimitError": 1280, - "FixedDecimalSyntaxError": 1281, - "PluralsParserError": 1536, - "CalendarParseError": 1792, - "CalendarOverflowError": 1793, - "CalendarUnderflowError": 1794, - "CalendarOutOfRangeError": 1795, - "CalendarUnknownEraError": 1796, - "CalendarUnknownMonthCodeError": 1797, - "CalendarMissingInputError": 1798, - "CalendarUnknownKindError": 1799, - "CalendarMissingError": 1800, - "DateTimePatternError": 2048, - "DateTimeMissingInputFieldError": 2049, - "DateTimeSkeletonError": 2050, - "DateTimeUnsupportedFieldError": 2051, - "DateTimeUnsupportedOptionsError": 2052, - "DateTimeMissingWeekdaySymbolError": 2053, - "DateTimeMissingMonthSymbolError": 2054, - "DateTimeFixedDecimalError": 2055, - "DateTimeMismatchedCalendarError": 2056, - "TinyStrTooLargeError": 2304, - "TinyStrContainsNullError": 2305, - "TinyStrNonAsciiError": 2306, - "TimeZoneOffsetOutOfBoundsError": 2560, - "TimeZoneInvalidOffsetError": 2561, - "TimeZoneMissingInputError": 2562, - "NormalizerFutureExtensionError": 2816, - "NormalizerValidationError": 2817, -}; - -export const ICU4XError_rust_to_js = { - [0]: "UnknownError", - [1]: "WriteableError", - [2]: "OutOfBoundsError", - [256]: "DataMissingDataKeyError", - [257]: "DataMissingVariantError", - [258]: "DataMissingLocaleError", - [259]: "DataNeedsVariantError", - [260]: "DataNeedsLocaleError", - [261]: "DataExtraneousLocaleError", - [262]: "DataFilteredResourceError", - [263]: "DataMismatchedTypeError", - [264]: "DataMissingPayloadError", - [265]: "DataInvalidStateError", - [266]: "DataCustomError", - [267]: "DataIoError", - [268]: "DataUnavailableBufferFormatError", - [269]: "DataMismatchedAnyBufferError", - [512]: "LocaleUndefinedSubtagError", - [513]: "LocaleParserLanguageError", - [514]: "LocaleParserSubtagError", - [515]: "LocaleParserExtensionError", - [768]: "DataStructValidityError", - [1024]: "PropertyUnknownScriptIdError", - [1025]: "PropertyUnknownGeneralCategoryGroupError", - [1026]: "PropertyUnexpectedPropertyNameError", - [1280]: "FixedDecimalLimitError", - [1281]: "FixedDecimalSyntaxError", - [1536]: "PluralsParserError", - [1792]: "CalendarParseError", - [1793]: "CalendarOverflowError", - [1794]: "CalendarUnderflowError", - [1795]: "CalendarOutOfRangeError", - [1796]: "CalendarUnknownEraError", - [1797]: "CalendarUnknownMonthCodeError", - [1798]: "CalendarMissingInputError", - [1799]: "CalendarUnknownKindError", - [1800]: "CalendarMissingError", - [2048]: "DateTimePatternError", - [2049]: "DateTimeMissingInputFieldError", - [2050]: "DateTimeSkeletonError", - [2051]: "DateTimeUnsupportedFieldError", - [2052]: "DateTimeUnsupportedOptionsError", - [2053]: "DateTimeMissingWeekdaySymbolError", - [2054]: "DateTimeMissingMonthSymbolError", - [2055]: "DateTimeFixedDecimalError", - [2056]: "DateTimeMismatchedCalendarError", - [2304]: "TinyStrTooLargeError", - [2305]: "TinyStrContainsNullError", - [2306]: "TinyStrNonAsciiError", - [2560]: "TimeZoneOffsetOutOfBoundsError", - [2561]: "TimeZoneInvalidOffsetError", - [2562]: "TimeZoneMissingInputError", - [2816]: "NormalizerFutureExtensionError", - [2817]: "NormalizerValidationError", -}; - -export const ICU4XError = { - "UnknownError": "UnknownError", - "WriteableError": "WriteableError", - "OutOfBoundsError": "OutOfBoundsError", - "DataMissingDataKeyError": "DataMissingDataKeyError", - "DataMissingVariantError": "DataMissingVariantError", - "DataMissingLocaleError": "DataMissingLocaleError", - "DataNeedsVariantError": "DataNeedsVariantError", - "DataNeedsLocaleError": "DataNeedsLocaleError", - "DataExtraneousLocaleError": "DataExtraneousLocaleError", - "DataFilteredResourceError": "DataFilteredResourceError", - "DataMismatchedTypeError": "DataMismatchedTypeError", - "DataMissingPayloadError": "DataMissingPayloadError", - "DataInvalidStateError": "DataInvalidStateError", - "DataCustomError": "DataCustomError", - "DataIoError": "DataIoError", - "DataUnavailableBufferFormatError": "DataUnavailableBufferFormatError", - "DataMismatchedAnyBufferError": "DataMismatchedAnyBufferError", - "LocaleUndefinedSubtagError": "LocaleUndefinedSubtagError", - "LocaleParserLanguageError": "LocaleParserLanguageError", - "LocaleParserSubtagError": "LocaleParserSubtagError", - "LocaleParserExtensionError": "LocaleParserExtensionError", - "DataStructValidityError": "DataStructValidityError", - "PropertyUnknownScriptIdError": "PropertyUnknownScriptIdError", - "PropertyUnknownGeneralCategoryGroupError": "PropertyUnknownGeneralCategoryGroupError", - "PropertyUnexpectedPropertyNameError": "PropertyUnexpectedPropertyNameError", - "FixedDecimalLimitError": "FixedDecimalLimitError", - "FixedDecimalSyntaxError": "FixedDecimalSyntaxError", - "PluralsParserError": "PluralsParserError", - "CalendarParseError": "CalendarParseError", - "CalendarOverflowError": "CalendarOverflowError", - "CalendarUnderflowError": "CalendarUnderflowError", - "CalendarOutOfRangeError": "CalendarOutOfRangeError", - "CalendarUnknownEraError": "CalendarUnknownEraError", - "CalendarUnknownMonthCodeError": "CalendarUnknownMonthCodeError", - "CalendarMissingInputError": "CalendarMissingInputError", - "CalendarUnknownKindError": "CalendarUnknownKindError", - "CalendarMissingError": "CalendarMissingError", - "DateTimePatternError": "DateTimePatternError", - "DateTimeMissingInputFieldError": "DateTimeMissingInputFieldError", - "DateTimeSkeletonError": "DateTimeSkeletonError", - "DateTimeUnsupportedFieldError": "DateTimeUnsupportedFieldError", - "DateTimeUnsupportedOptionsError": "DateTimeUnsupportedOptionsError", - "DateTimeMissingWeekdaySymbolError": "DateTimeMissingWeekdaySymbolError", - "DateTimeMissingMonthSymbolError": "DateTimeMissingMonthSymbolError", - "DateTimeFixedDecimalError": "DateTimeFixedDecimalError", - "DateTimeMismatchedCalendarError": "DateTimeMismatchedCalendarError", - "TinyStrTooLargeError": "TinyStrTooLargeError", - "TinyStrContainsNullError": "TinyStrContainsNullError", - "TinyStrNonAsciiError": "TinyStrNonAsciiError", - "TimeZoneOffsetOutOfBoundsError": "TimeZoneOffsetOutOfBoundsError", - "TimeZoneInvalidOffsetError": "TimeZoneInvalidOffsetError", - "TimeZoneMissingInputError": "TimeZoneMissingInputError", - "NormalizerFutureExtensionError": "NormalizerFutureExtensionError", - "NormalizerValidationError": "NormalizerValidationError", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimal.d.ts b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimal.d.ts deleted file mode 100644 index cf524c2601c7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimal.d.ts +++ /dev/null @@ -1,272 +0,0 @@ -import { u8, i16, i32, u32, i64, u64, f64 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; -import { ICU4XFixedDecimalSign } from "./ICU4XFixedDecimalSign"; -import { ICU4XFixedDecimalSignDisplay } from "./ICU4XFixedDecimalSignDisplay"; - -/** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html Rust documentation for `FixedDecimal`} for more information. - */ -export class ICU4XFixedDecimal { - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an integer. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html Rust documentation for `FixedDecimal`} for more information. - */ - static create_from_i32(v: i32): ICU4XFixedDecimal; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an integer. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html Rust documentation for `FixedDecimal`} for more information. - */ - static create_from_u32(v: u32): ICU4XFixedDecimal; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an integer. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html Rust documentation for `FixedDecimal`} for more information. - */ - static create_from_i64(v: i64): ICU4XFixedDecimal; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an integer. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html Rust documentation for `FixedDecimal`} for more information. - */ - static create_from_u64(v: u64): ICU4XFixedDecimal; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an integer-valued float - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64 Rust documentation for `try_from_f64`} for more information. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html Rust documentation for `DoublePrecision`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_f64_with_integer_precision(f: f64): ICU4XFixedDecimal | never; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an float, with a given power of 10 for the lower magnitude - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64 Rust documentation for `try_from_f64`} for more information. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html Rust documentation for `DoublePrecision`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_f64_with_lower_magnitude(f: f64, magnitude: i16): ICU4XFixedDecimal | never; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an float, for a given number of significant digits - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64 Rust documentation for `try_from_f64`} for more information. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html Rust documentation for `DoublePrecision`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_f64_with_significant_digits(f: f64, digits: u8): ICU4XFixedDecimal | never; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from an float, with enough digits to recover the original floating point in IEEE 754 without needing trailing zeros - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64 Rust documentation for `try_from_f64`} for more information. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.DoublePrecision.html Rust documentation for `DoublePrecision`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_f64_with_floating_precision(f: f64): ICU4XFixedDecimal | never; - - /** - - * Construct an {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} from a string. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.from_str Rust documentation for `from_str`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_string(v: string): ICU4XFixedDecimal | never; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.digit_at Rust documentation for `digit_at`} for more information. - */ - digit_at(magnitude: i16): u8; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range Rust documentation for `magnitude_range`} for more information. - */ - magnitude_start(): i16; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range Rust documentation for `magnitude_range`} for more information. - */ - magnitude_end(): i16; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_start Rust documentation for `nonzero_magnitude_start`} for more information. - */ - nonzero_magnitude_start(): i16; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_end Rust documentation for `nonzero_magnitude_end`} for more information. - */ - nonzero_magnitude_end(): i16; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.is_zero Rust documentation for `is_zero`} for more information. - */ - is_zero(): boolean; - - /** - - * Multiply the {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} by a given power of ten. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.multiply_pow10 Rust documentation for `multiply_pow10`} for more information. - */ - multiply_pow10(power: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.sign Rust documentation for `sign`} for more information. - */ - sign(): ICU4XFixedDecimalSign; - - /** - - * Set the sign of the {@link ICU4XFixedDecimal `ICU4XFixedDecimal`}. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_sign Rust documentation for `set_sign`} for more information. - */ - set_sign(sign: ICU4XFixedDecimalSign): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.apply_sign_display Rust documentation for `apply_sign_display`} for more information. - */ - apply_sign_display(sign_display: ICU4XFixedDecimalSignDisplay): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_start Rust documentation for `trim_start`} for more information. - */ - trim_start(): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_end Rust documentation for `trim_end`} for more information. - */ - trim_end(): void; - - /** - - * Zero-pad the {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} on the left to a particular position - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_start Rust documentation for `pad_start`} for more information. - */ - pad_start(position: i16): void; - - /** - - * Zero-pad the {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} on the right to a particular position - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_end Rust documentation for `pad_end`} for more information. - */ - pad_end(position: i16): void; - - /** - - * Truncate the {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years ("2022" -> "22") - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_max_position Rust documentation for `set_max_position`} for more information. - */ - set_max_position(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trunc Rust documentation for `trunc`} for more information. - */ - trunc(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_trunc Rust documentation for `half_trunc`} for more information. - */ - half_trunc(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.expand Rust documentation for `expand`} for more information. - */ - expand(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_expand Rust documentation for `half_expand`} for more information. - */ - half_expand(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.ceil Rust documentation for `ceil`} for more information. - */ - ceil(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_ceil Rust documentation for `half_ceil`} for more information. - */ - half_ceil(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.floor Rust documentation for `floor`} for more information. - */ - floor(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_floor Rust documentation for `half_floor`} for more information. - */ - half_floor(position: i16): void; - - /** - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_even Rust documentation for `half_even`} for more information. - */ - half_even(position: i16): void; - - /** - - * Concatenates `other` to the end of `self`. - - * If successful, `other` will be set to 0 and a successful status is returned. - - * If not successful, `other` will be unchanged and an error is returned. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.concatenate_end Rust documentation for `concatenate_end`} for more information. - * @throws {@link FFIError} - */ - concatenate_end(other: ICU4XFixedDecimal): void | never; - - /** - - * Format the {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} as a string. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.write_to Rust documentation for `write_to`} for more information. - */ - to_string(): string; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimal.js b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimal.js deleted file mode 100644 index e517bc9f48cb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimal.js +++ /dev/null @@ -1,235 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XFixedDecimalSign_js_to_rust, ICU4XFixedDecimalSign_rust_to_js } from "./ICU4XFixedDecimalSign.js" -import { ICU4XFixedDecimalSignDisplay_js_to_rust, ICU4XFixedDecimalSignDisplay_rust_to_js } from "./ICU4XFixedDecimalSignDisplay.js" - -const ICU4XFixedDecimal_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XFixedDecimal_destroy(underlying); -}); - -export class ICU4XFixedDecimal { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XFixedDecimal_box_destroy_registry.register(this, underlying); - } - } - - static create_from_i32(arg_v) { - return new ICU4XFixedDecimal(wasm.ICU4XFixedDecimal_create_from_i32(arg_v), true, []); - } - - static create_from_u32(arg_v) { - return new ICU4XFixedDecimal(wasm.ICU4XFixedDecimal_create_from_u32(arg_v), true, []); - } - - static create_from_i64(arg_v) { - return new ICU4XFixedDecimal(wasm.ICU4XFixedDecimal_create_from_i64(arg_v), true, []); - } - - static create_from_u64(arg_v) { - return new ICU4XFixedDecimal(wasm.ICU4XFixedDecimal_create_from_u64(arg_v), true, []); - } - - static create_from_f64_with_integer_precision(arg_f) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimal_create_from_f64_with_integer_precision(diplomat_receive_buffer, arg_f); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimal(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_f64_with_lower_magnitude(arg_f, arg_magnitude) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(diplomat_receive_buffer, arg_f, arg_magnitude); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimal(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_f64_with_significant_digits(arg_f, arg_digits) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimal_create_from_f64_with_significant_digits(diplomat_receive_buffer, arg_f, arg_digits); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimal(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_f64_with_floating_precision(arg_f) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimal_create_from_f64_with_floating_precision(diplomat_receive_buffer, arg_f); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimal(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_string(arg_v) { - const buf_arg_v = diplomatRuntime.DiplomatBuf.str(wasm, arg_v); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimal_create_from_string(diplomat_receive_buffer, buf_arg_v.ptr, buf_arg_v.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimal(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_v.free(); - return diplomat_out; - } - - digit_at(arg_magnitude) { - return wasm.ICU4XFixedDecimal_digit_at(this.underlying, arg_magnitude); - } - - magnitude_start() { - return wasm.ICU4XFixedDecimal_magnitude_start(this.underlying); - } - - magnitude_end() { - return wasm.ICU4XFixedDecimal_magnitude_end(this.underlying); - } - - nonzero_magnitude_start() { - return wasm.ICU4XFixedDecimal_nonzero_magnitude_start(this.underlying); - } - - nonzero_magnitude_end() { - return wasm.ICU4XFixedDecimal_nonzero_magnitude_end(this.underlying); - } - - is_zero() { - return wasm.ICU4XFixedDecimal_is_zero(this.underlying); - } - - multiply_pow10(arg_power) { - wasm.ICU4XFixedDecimal_multiply_pow10(this.underlying, arg_power); - } - - sign() { - return ICU4XFixedDecimalSign_rust_to_js[wasm.ICU4XFixedDecimal_sign(this.underlying)]; - } - - set_sign(arg_sign) { - wasm.ICU4XFixedDecimal_set_sign(this.underlying, ICU4XFixedDecimalSign_js_to_rust[arg_sign]); - } - - apply_sign_display(arg_sign_display) { - wasm.ICU4XFixedDecimal_apply_sign_display(this.underlying, ICU4XFixedDecimalSignDisplay_js_to_rust[arg_sign_display]); - } - - trim_start() { - wasm.ICU4XFixedDecimal_trim_start(this.underlying); - } - - trim_end() { - wasm.ICU4XFixedDecimal_trim_end(this.underlying); - } - - pad_start(arg_position) { - wasm.ICU4XFixedDecimal_pad_start(this.underlying, arg_position); - } - - pad_end(arg_position) { - wasm.ICU4XFixedDecimal_pad_end(this.underlying, arg_position); - } - - set_max_position(arg_position) { - wasm.ICU4XFixedDecimal_set_max_position(this.underlying, arg_position); - } - - trunc(arg_position) { - wasm.ICU4XFixedDecimal_trunc(this.underlying, arg_position); - } - - half_trunc(arg_position) { - wasm.ICU4XFixedDecimal_half_trunc(this.underlying, arg_position); - } - - expand(arg_position) { - wasm.ICU4XFixedDecimal_expand(this.underlying, arg_position); - } - - half_expand(arg_position) { - wasm.ICU4XFixedDecimal_half_expand(this.underlying, arg_position); - } - - ceil(arg_position) { - wasm.ICU4XFixedDecimal_ceil(this.underlying, arg_position); - } - - half_ceil(arg_position) { - wasm.ICU4XFixedDecimal_half_ceil(this.underlying, arg_position); - } - - floor(arg_position) { - wasm.ICU4XFixedDecimal_floor(this.underlying, arg_position); - } - - half_floor(arg_position) { - wasm.ICU4XFixedDecimal_half_floor(this.underlying, arg_position); - } - - half_even(arg_position) { - wasm.ICU4XFixedDecimal_half_even(this.underlying, arg_position); - } - - concatenate_end(arg_other) { - return (() => { - const is_ok = wasm.ICU4XFixedDecimal_concatenate_end(this.underlying, arg_other.underlying) == 1; - if (!is_ok) { - throw new diplomatRuntime.FFIError(undefined); - } - })(); - } - - to_string() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return wasm.ICU4XFixedDecimal_to_string(this.underlying, writeable); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalFormatter.d.ts deleted file mode 100644 index 6c78c7f66d4c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalFormatter.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDataStruct } from "./ICU4XDataStruct"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XFixedDecimal } from "./ICU4XFixedDecimal"; -import { ICU4XFixedDecimalGroupingStrategy } from "./ICU4XFixedDecimalGroupingStrategy"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * An ICU4X Fixed Decimal Format object, capable of formatting a {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} as a string. - - * See the {@link https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html Rust documentation for `FixedDecimalFormatter`} for more information. - */ -export class ICU4XFixedDecimalFormatter { - - /** - - * Creates a new {@link ICU4XFixedDecimalFormatter `ICU4XFixedDecimalFormatter`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_grouping_strategy(provider: ICU4XDataProvider, locale: ICU4XLocale, grouping_strategy: ICU4XFixedDecimalGroupingStrategy): ICU4XFixedDecimalFormatter | never; - - /** - - * Creates a new {@link ICU4XFixedDecimalFormatter `ICU4XFixedDecimalFormatter`} from preconstructed locale data in the form of an {@link ICU4XDataStruct `ICU4XDataStruct`} constructed from `ICU4XDataStruct::create_decimal_symbols()`. - - * The contents of the data struct will be consumed: if you wish to use the struct again it will have to be reconstructed. Passing a consumed struct to this method will return an error. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_decimal_symbols_v1(data_struct: ICU4XDataStruct, grouping_strategy: ICU4XFixedDecimalGroupingStrategy): ICU4XFixedDecimalFormatter | never; - - /** - - * Formats a {@link ICU4XFixedDecimal `ICU4XFixedDecimal`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format(value: ICU4XFixedDecimal): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalFormatter.js deleted file mode 100644 index 03cff035b1e4..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalFormatter.js +++ /dev/null @@ -1,72 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XFixedDecimalGroupingStrategy_js_to_rust, ICU4XFixedDecimalGroupingStrategy_rust_to_js } from "./ICU4XFixedDecimalGroupingStrategy.js" - -const ICU4XFixedDecimalFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XFixedDecimalFormatter_destroy(underlying); -}); - -export class ICU4XFixedDecimalFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XFixedDecimalFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_grouping_strategy(arg_provider, arg_locale, arg_grouping_strategy) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimalFormatter_create_with_grouping_strategy(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XFixedDecimalGroupingStrategy_js_to_rust[arg_grouping_strategy]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimalFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_with_decimal_symbols_v1(arg_data_struct, arg_grouping_strategy) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimalFormatter_create_with_decimal_symbols_v1(diplomat_receive_buffer, arg_data_struct.underlying, ICU4XFixedDecimalGroupingStrategy_js_to_rust[arg_grouping_strategy]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XFixedDecimalFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XFixedDecimalFormatter_format(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalGroupingStrategy.d.ts b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalGroupingStrategy.d.ts deleted file mode 100644 index 6a615f93a527..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalGroupingStrategy.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/decimal/options/enum.GroupingStrategy.html Rust documentation for `GroupingStrategy`} for more information. - */ -export enum ICU4XFixedDecimalGroupingStrategy { - /** - */ - Auto = 'Auto', - /** - */ - Never = 'Never', - /** - */ - Always = 'Always', - /** - */ - Min2 = 'Min2', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalGroupingStrategy.js b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalGroupingStrategy.js deleted file mode 100644 index 8272ee599d63..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalGroupingStrategy.js +++ /dev/null @@ -1,23 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XFixedDecimalGroupingStrategy_js_to_rust = { - "Auto": 0, - "Never": 1, - "Always": 2, - "Min2": 3, -}; - -export const ICU4XFixedDecimalGroupingStrategy_rust_to_js = { - [0]: "Auto", - [1]: "Never", - [2]: "Always", - [3]: "Min2", -}; - -export const ICU4XFixedDecimalGroupingStrategy = { - "Auto": "Auto", - "Never": "Never", - "Always": "Always", - "Min2": "Min2", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSign.d.ts b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSign.d.ts deleted file mode 100644 index ec777aa3ebaf..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSign.d.ts +++ /dev/null @@ -1,24 +0,0 @@ - -/** - - * The sign of a FixedDecimal, as shown in formatting. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.Sign.html Rust documentation for `Sign`} for more information. - */ -export enum ICU4XFixedDecimalSign { - /** - - * No sign (implicitly positive, e.g., 1729). - */ - None = 'None', - /** - - * A negative sign, e.g., -1729. - */ - Negative = 'Negative', - /** - - * An explicit positive sign, e.g., +1729. - */ - Positive = 'Positive', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSign.js b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSign.js deleted file mode 100644 index 407cf14d3397..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSign.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XFixedDecimalSign_js_to_rust = { - "None": 0, - "Negative": 1, - "Positive": 2, -}; - -export const ICU4XFixedDecimalSign_rust_to_js = { - [0]: "None", - [1]: "Negative", - [2]: "Positive", -}; - -export const ICU4XFixedDecimalSign = { - "None": "None", - "Negative": "Negative", - "Positive": "Positive", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSignDisplay.d.ts b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSignDisplay.d.ts deleted file mode 100644 index d3302911a170..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSignDisplay.d.ts +++ /dev/null @@ -1,24 +0,0 @@ - -/** - - * ECMA-402 compatible sign display preference. - - * See the {@link https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.SignDisplay.html Rust documentation for `SignDisplay`} for more information. - */ -export enum ICU4XFixedDecimalSignDisplay { - /** - */ - Auto = 'Auto', - /** - */ - Never = 'Never', - /** - */ - Always = 'Always', - /** - */ - ExceptZero = 'ExceptZero', - /** - */ - Negative = 'Negative', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSignDisplay.js b/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSignDisplay.js deleted file mode 100644 index 21bd180800b4..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XFixedDecimalSignDisplay.js +++ /dev/null @@ -1,26 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XFixedDecimalSignDisplay_js_to_rust = { - "Auto": 0, - "Never": 1, - "Always": 2, - "ExceptZero": 3, - "Negative": 4, -}; - -export const ICU4XFixedDecimalSignDisplay_rust_to_js = { - [0]: "Auto", - [1]: "Never", - [2]: "Always", - [3]: "ExceptZero", - [4]: "Negative", -}; - -export const ICU4XFixedDecimalSignDisplay = { - "Auto": "Auto", - "Never": "Never", - "Always": "Always", - "ExceptZero": "ExceptZero", - "Negative": "Negative", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XGeneralCategoryNameToMaskMapper.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGeneralCategoryNameToMaskMapper.d.ts deleted file mode 100644 index b5cfef9cab95..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGeneralCategoryNameToMaskMapper.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * A type capable of looking up General Category mask values from a string name. - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapper.html Rust documentation for `PropertyValueNameToEnumMapper`} for more information. - */ -export class ICU4XGeneralCategoryNameToMaskMapper { - - /** - - * Get the mask value matching the given name, using strict matching - - * Returns 0 if the name is unknown for this property - */ - get_strict(name: string): u32; - - /** - - * Get the mask value matching the given name, using loose matching - - * Returns 0 if the name is unknown for this property - */ - get_loose(name: string): u32; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load(provider: ICU4XDataProvider): ICU4XGeneralCategoryNameToMaskMapper | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGeneralCategoryNameToMaskMapper.js b/third_party/rust/icu_capi/js/include/ICU4XGeneralCategoryNameToMaskMapper.js deleted file mode 100644 index 4f3319123a9c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGeneralCategoryNameToMaskMapper.js +++ /dev/null @@ -1,49 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XGeneralCategoryNameToMaskMapper_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGeneralCategoryNameToMaskMapper_destroy(underlying); -}); - -export class ICU4XGeneralCategoryNameToMaskMapper { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGeneralCategoryNameToMaskMapper_box_destroy_registry.register(this, underlying); - } - } - - get_strict(arg_name) { - const buf_arg_name = diplomatRuntime.DiplomatBuf.str(wasm, arg_name); - const diplomat_out = wasm.ICU4XGeneralCategoryNameToMaskMapper_get_strict(this.underlying, buf_arg_name.ptr, buf_arg_name.size); - buf_arg_name.free(); - return diplomat_out; - } - - get_loose(arg_name) { - const buf_arg_name = diplomatRuntime.DiplomatBuf.str(wasm, arg_name); - const diplomat_out = wasm.ICU4XGeneralCategoryNameToMaskMapper_get_loose(this.underlying, buf_arg_name.ptr, buf_arg_name.size); - buf_arg_name.free(); - return diplomat_out; - } - - static load(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGeneralCategoryNameToMaskMapper_load(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XGeneralCategoryNameToMaskMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorLatin1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorLatin1.d.ts deleted file mode 100644 index 5022d4baa70f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorLatin1.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html Rust documentation for `GraphemeClusterBreakIterator`} for more information. - */ -export class ICU4XGraphemeClusterBreakIteratorLatin1 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorLatin1.js b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorLatin1.js deleted file mode 100644 index a50df59feb44..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorLatin1.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XGraphemeClusterBreakIteratorLatin1_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGraphemeClusterBreakIteratorLatin1_destroy(underlying); -}); - -export class ICU4XGraphemeClusterBreakIteratorLatin1 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGraphemeClusterBreakIteratorLatin1_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XGraphemeClusterBreakIteratorLatin1_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf16.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf16.d.ts deleted file mode 100644 index 95d21da695c9..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf16.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html Rust documentation for `GraphemeClusterBreakIterator`} for more information. - */ -export class ICU4XGraphemeClusterBreakIteratorUtf16 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf16.js b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf16.js deleted file mode 100644 index cc997daa057e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf16.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XGraphemeClusterBreakIteratorUtf16_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGraphemeClusterBreakIteratorUtf16_destroy(underlying); -}); - -export class ICU4XGraphemeClusterBreakIteratorUtf16 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGraphemeClusterBreakIteratorUtf16_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XGraphemeClusterBreakIteratorUtf16_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf8.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf8.d.ts deleted file mode 100644 index cb78596153eb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf8.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html Rust documentation for `GraphemeClusterBreakIterator`} for more information. - */ -export class ICU4XGraphemeClusterBreakIteratorUtf8 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf8.js b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf8.js deleted file mode 100644 index 2a16170dfe0c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterBreakIteratorUtf8.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XGraphemeClusterBreakIteratorUtf8_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGraphemeClusterBreakIteratorUtf8_destroy(underlying); -}); - -export class ICU4XGraphemeClusterBreakIteratorUtf8 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGraphemeClusterBreakIteratorUtf8_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XGraphemeClusterBreakIteratorUtf8_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterSegmenter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterSegmenter.d.ts deleted file mode 100644 index 173955f4e41e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterSegmenter.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XGraphemeClusterBreakIteratorLatin1 } from "./ICU4XGraphemeClusterBreakIteratorLatin1"; -import { ICU4XGraphemeClusterBreakIteratorUtf16 } from "./ICU4XGraphemeClusterBreakIteratorUtf16"; -import { ICU4XGraphemeClusterBreakIteratorUtf8 } from "./ICU4XGraphemeClusterBreakIteratorUtf8"; - -/** - - * An ICU4X grapheme-cluster-break segmenter, capable of finding grapheme cluster breakpoints in strings. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html Rust documentation for `GraphemeClusterSegmenter`} for more information. - */ -export class ICU4XGraphemeClusterSegmenter { - - /** - - * Construct an {@link ICU4XGraphemeClusterSegmenter `ICU4XGraphemeClusterSegmenter`}. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XGraphemeClusterSegmenter | never; - - /** - - * Segments a (potentially ill-formed) UTF-8 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_utf8 Rust documentation for `segment_utf8`} for more information. - */ - segment_utf8(input: string): ICU4XGraphemeClusterBreakIteratorUtf8; - - /** - - * Segments a UTF-16 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_utf16 Rust documentation for `segment_utf16`} for more information. - */ - segment_utf16(input: Uint16Array): ICU4XGraphemeClusterBreakIteratorUtf16; - - /** - - * Segments a Latin-1 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.GraphemeClusterSegmenter.html#method.segment_latin1 Rust documentation for `segment_latin1`} for more information. - */ - segment_latin1(input: Uint8Array): ICU4XGraphemeClusterBreakIteratorLatin1; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterSegmenter.js b/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterSegmenter.js deleted file mode 100644 index 91dfea1ba51a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGraphemeClusterSegmenter.js +++ /dev/null @@ -1,53 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XGraphemeClusterBreakIteratorLatin1 } from "./ICU4XGraphemeClusterBreakIteratorLatin1.js" -import { ICU4XGraphemeClusterBreakIteratorUtf16 } from "./ICU4XGraphemeClusterBreakIteratorUtf16.js" -import { ICU4XGraphemeClusterBreakIteratorUtf8 } from "./ICU4XGraphemeClusterBreakIteratorUtf8.js" - -const ICU4XGraphemeClusterSegmenter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGraphemeClusterSegmenter_destroy(underlying); -}); - -export class ICU4XGraphemeClusterSegmenter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGraphemeClusterSegmenter_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGraphemeClusterSegmenter_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XGraphemeClusterSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - segment_utf8(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.str(wasm, arg_input); - return new ICU4XGraphemeClusterBreakIteratorUtf8(wasm.ICU4XGraphemeClusterSegmenter_segment_utf8(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_utf16(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 2); - return new ICU4XGraphemeClusterBreakIteratorUtf16(wasm.ICU4XGraphemeClusterSegmenter_segment_utf16(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_latin1(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 1); - return new ICU4XGraphemeClusterBreakIteratorLatin1(wasm.ICU4XGraphemeClusterSegmenter_segment_latin1(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGregorianDateFormatter.d.ts deleted file mode 100644 index c5f205761413..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateFormatter.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDateLength } from "./ICU4XDateLength"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDate } from "./ICU4XIsoDate"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * An ICU4X TypedDateFormatter object capable of formatting a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} as a string, using the Gregorian Calendar. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html Rust documentation for `TypedDateFormatter`} for more information. - */ -export class ICU4XGregorianDateFormatter { - - /** - - * Creates a new {@link ICU4XGregorianDateFormatter `ICU4XGregorianDateFormatter`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.try_new_with_length_unstable Rust documentation for `try_new_with_length_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, length: ICU4XDateLength): ICU4XGregorianDateFormatter | never; - - /** - - * Formats a {@link ICU4XIsoDate `ICU4XIsoDate`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_date(value: ICU4XIsoDate): string | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime(value: ICU4XIsoDateTime): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XGregorianDateFormatter.js deleted file mode 100644 index c9bb1b329f4e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateFormatter.js +++ /dev/null @@ -1,74 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateLength_js_to_rust, ICU4XDateLength_rust_to_js } from "./ICU4XDateLength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XGregorianDateFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGregorianDateFormatter_destroy(underlying); -}); - -export class ICU4XGregorianDateFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGregorianDateFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_length(arg_provider, arg_locale, arg_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianDateFormatter_create_with_length(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XGregorianDateFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_iso_date(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianDateFormatter_format_iso_date(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_iso_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianDateFormatter_format_iso_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateTimeFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGregorianDateTimeFormatter.d.ts deleted file mode 100644 index e7952ff06072..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateTimeFormatter.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDateLength } from "./ICU4XDateLength"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTimeLength } from "./ICU4XTimeLength"; - -/** - - * An ICU4X TypedDateTimeFormatter object capable of formatting a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} as a string, using the Gregorian Calendar. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html Rust documentation for `TypedDateTimeFormatter`} for more information. - */ -export class ICU4XGregorianDateTimeFormatter { - - /** - - * Creates a new {@link ICU4XGregorianDateFormatter `ICU4XGregorianDateFormatter`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_lengths(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength): ICU4XGregorianDateTimeFormatter | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime(value: ICU4XIsoDateTime): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateTimeFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XGregorianDateTimeFormatter.js deleted file mode 100644 index 5315ad4c145d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGregorianDateTimeFormatter.js +++ /dev/null @@ -1,56 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateLength_js_to_rust, ICU4XDateLength_rust_to_js } from "./ICU4XDateLength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XTimeLength_js_to_rust, ICU4XTimeLength_rust_to_js } from "./ICU4XTimeLength.js" - -const ICU4XGregorianDateTimeFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGregorianDateTimeFormatter_destroy(underlying); -}); - -export class ICU4XGregorianDateTimeFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGregorianDateTimeFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_lengths(arg_provider, arg_locale, arg_date_length, arg_time_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianDateTimeFormatter_create_with_lengths(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length], ICU4XTimeLength_js_to_rust[arg_time_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XGregorianDateTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_iso_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianDateTimeFormatter_format_iso_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGregorianZonedDateTimeFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XGregorianZonedDateTimeFormatter.d.ts deleted file mode 100644 index 93c2a42eddc5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGregorianZonedDateTimeFormatter.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XCustomTimeZone } from "./ICU4XCustomTimeZone"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDateLength } from "./ICU4XDateLength"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XIsoTimeZoneOptions } from "./ICU4XIsoTimeZoneOptions"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTimeLength } from "./ICU4XTimeLength"; - -/** - - * An object capable of formatting a date time with time zone to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html Rust documentation for `TypedZonedDateTimeFormatter`} for more information. - */ -export class ICU4XGregorianZonedDateTimeFormatter { - - /** - - * Creates a new {@link ICU4XGregorianZonedDateTimeFormatter `ICU4XGregorianZonedDateTimeFormatter`} from locale data. - - * This function has `date_length` and `time_length` arguments and uses default options for the time zone. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_lengths(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength): ICU4XGregorianZonedDateTimeFormatter | never; - - /** - - * Creates a new {@link ICU4XGregorianZonedDateTimeFormatter `ICU4XGregorianZonedDateTimeFormatter`} from locale data. - - * This function has `date_length` and `time_length` arguments and uses an ISO-8601 style fallback for the time zone with the given configurations. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_lengths_and_iso_8601_time_zone_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength, zone_options: ICU4XIsoTimeZoneOptions): ICU4XGregorianZonedDateTimeFormatter | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} and {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime_with_custom_time_zone(datetime: ICU4XIsoDateTime, time_zone: ICU4XCustomTimeZone): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XGregorianZonedDateTimeFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XGregorianZonedDateTimeFormatter.js deleted file mode 100644 index 3e5fa8007ba7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XGregorianZonedDateTimeFormatter.js +++ /dev/null @@ -1,79 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateLength_js_to_rust, ICU4XDateLength_rust_to_js } from "./ICU4XDateLength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoTimeZoneFormat_js_to_rust, ICU4XIsoTimeZoneFormat_rust_to_js } from "./ICU4XIsoTimeZoneFormat.js" -import { ICU4XIsoTimeZoneMinuteDisplay_js_to_rust, ICU4XIsoTimeZoneMinuteDisplay_rust_to_js } from "./ICU4XIsoTimeZoneMinuteDisplay.js" -import { ICU4XIsoTimeZoneSecondDisplay_js_to_rust, ICU4XIsoTimeZoneSecondDisplay_rust_to_js } from "./ICU4XIsoTimeZoneSecondDisplay.js" -import { ICU4XTimeLength_js_to_rust, ICU4XTimeLength_rust_to_js } from "./ICU4XTimeLength.js" - -const ICU4XGregorianZonedDateTimeFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XGregorianZonedDateTimeFormatter_destroy(underlying); -}); - -export class ICU4XGregorianZonedDateTimeFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XGregorianZonedDateTimeFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_lengths(arg_provider, arg_locale, arg_date_length, arg_time_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length], ICU4XTimeLength_js_to_rust[arg_time_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XGregorianZonedDateTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_with_lengths_and_iso_8601_time_zone_fallback(arg_provider, arg_locale, arg_date_length, arg_time_length, arg_zone_options) { - const field_format_arg_zone_options = arg_zone_options["format"]; - const field_minutes_arg_zone_options = arg_zone_options["minutes"]; - const field_seconds_arg_zone_options = arg_zone_options["seconds"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length], ICU4XTimeLength_js_to_rust[arg_time_length], ICU4XIsoTimeZoneFormat_js_to_rust[field_format_arg_zone_options], ICU4XIsoTimeZoneMinuteDisplay_js_to_rust[field_minutes_arg_zone_options], ICU4XIsoTimeZoneSecondDisplay_js_to_rust[field_seconds_arg_zone_options]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XGregorianZonedDateTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_iso_datetime_with_custom_time_zone(arg_datetime, arg_time_zone) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(diplomat_receive_buffer, this.underlying, arg_datetime.underlying, arg_time_zone.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoDate.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoDate.d.ts deleted file mode 100644 index a9ce0c2e04ae..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoDate.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { u8, i32, u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XCalendar } from "./ICU4XCalendar"; -import { ICU4XDate } from "./ICU4XDate"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday"; -import { ICU4XWeekCalculator } from "./ICU4XWeekCalculator"; -import { ICU4XWeekOf } from "./ICU4XWeekOf"; - -/** - - * An ICU4X Date object capable of containing a ISO-8601 date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html Rust documentation for `Date`} for more information. - */ -export class ICU4XIsoDate { - - /** - - * Creates a new {@link ICU4XIsoDate `ICU4XIsoDate`} from the specified date and time. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_iso_date Rust documentation for `try_new_iso_date`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(year: i32, month: u8, day: u8): ICU4XIsoDate | never; - - /** - - * Convert this date to one in a different calendar - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar Rust documentation for `to_calendar`} for more information. - */ - to_calendar(calendar: ICU4XCalendar): ICU4XDate; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_any Rust documentation for `to_any`} for more information. - */ - to_any(): ICU4XDate; - - /** - - * Returns the 1-indexed day in the month for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month Rust documentation for `day_of_month`} for more information. - */ - day_of_month(): u32; - - /** - - * Returns the day in the week for this day - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week Rust documentation for `day_of_week`} for more information. - */ - day_of_week(): ICU4XIsoWeekday; - - /** - - * Returns the week number in this month, 1-indexed, based on what is considered the first day of the week (often a locale preference). - - * `first_weekday` can be obtained via `first_weekday()` on {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month Rust documentation for `week_of_month`} for more information. - */ - week_of_month(first_weekday: ICU4XIsoWeekday): u32; - - /** - - * Returns the week number in this year, using week data - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year Rust documentation for `week_of_year`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - week_of_year(calculator: ICU4XWeekCalculator): ICU4XWeekOf | never; - - /** - - * Returns 1-indexed number of the month of this date in its year - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month Rust documentation for `month`} for more information. - */ - month(): u32; - - /** - - * Returns the year number for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year Rust documentation for `year`} for more information. - */ - year(): i32; - - /** - - * Returns the number of months in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year Rust documentation for `months_in_year`} for more information. - */ - months_in_year(): u8; - - /** - - * Returns the number of days in the month represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month Rust documentation for `days_in_month`} for more information. - */ - days_in_month(): u8; - - /** - - * Returns the number of days in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year Rust documentation for `days_in_year`} for more information. - */ - days_in_year(): u32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoDate.js b/third_party/rust/icu_capi/js/include/ICU4XIsoDate.js deleted file mode 100644 index e2f4a7df662b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoDate.js +++ /dev/null @@ -1,96 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDate } from "./ICU4XDate.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoWeekday_js_to_rust, ICU4XIsoWeekday_rust_to_js } from "./ICU4XIsoWeekday.js" -import { ICU4XWeekOf } from "./ICU4XWeekOf.js" -import { ICU4XWeekRelativeUnit_js_to_rust, ICU4XWeekRelativeUnit_rust_to_js } from "./ICU4XWeekRelativeUnit.js" - -const ICU4XIsoDate_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XIsoDate_destroy(underlying); -}); - -export class ICU4XIsoDate { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XIsoDate_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_year, arg_month, arg_day) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XIsoDate_create(diplomat_receive_buffer, arg_year, arg_month, arg_day); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XIsoDate(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - to_calendar(arg_calendar) { - return new ICU4XDate(wasm.ICU4XIsoDate_to_calendar(this.underlying, arg_calendar.underlying), true, []); - } - - to_any() { - return new ICU4XDate(wasm.ICU4XIsoDate_to_any(this.underlying), true, []); - } - - day_of_month() { - return wasm.ICU4XIsoDate_day_of_month(this.underlying); - } - - day_of_week() { - return ICU4XIsoWeekday_rust_to_js[wasm.ICU4XIsoDate_day_of_week(this.underlying)]; - } - - week_of_month(arg_first_weekday) { - return wasm.ICU4XIsoDate_week_of_month(this.underlying, ICU4XIsoWeekday_js_to_rust[arg_first_weekday]); - } - - week_of_year(arg_calculator) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(9, 4); - wasm.ICU4XIsoDate_week_of_year(diplomat_receive_buffer, this.underlying, arg_calculator.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 8); - if (is_ok) { - const ok_value = new ICU4XWeekOf(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - month() { - return wasm.ICU4XIsoDate_month(this.underlying); - } - - year() { - return wasm.ICU4XIsoDate_year(this.underlying); - } - - months_in_year() { - return wasm.ICU4XIsoDate_months_in_year(this.underlying); - } - - days_in_month() { - return wasm.ICU4XIsoDate_days_in_month(this.underlying); - } - - days_in_year() { - return wasm.ICU4XIsoDate_days_in_year(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoDateTime.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoDateTime.d.ts deleted file mode 100644 index 6140631bba77..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoDateTime.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import { u8, i32, u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XCalendar } from "./ICU4XCalendar"; -import { ICU4XDateTime } from "./ICU4XDateTime"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDate } from "./ICU4XIsoDate"; -import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday"; -import { ICU4XTime } from "./ICU4XTime"; -import { ICU4XWeekCalculator } from "./ICU4XWeekCalculator"; -import { ICU4XWeekOf } from "./ICU4XWeekOf"; - -/** - - * An ICU4X DateTime object capable of containing a ISO-8601 date and time. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html Rust documentation for `DateTime`} for more information. - */ -export class ICU4XIsoDateTime { - - /** - - * Creates a new {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} from the specified date and time. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_iso_datetime Rust documentation for `try_new_iso_datetime`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(year: i32, month: u8, day: u8, hour: u8, minute: u8, second: u8, nanosecond: u32): ICU4XIsoDateTime | never; - - /** - - * Creates a new {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} from an {@link ICU4XIsoDate `ICU4XIsoDate`} and {@link ICU4XTime `ICU4XTime`} object - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new Rust documentation for `new`} for more information. - */ - static crate_from_date_and_time(date: ICU4XIsoDate, time: ICU4XTime): ICU4XIsoDateTime; - - /** - - * Construct from the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.from_minutes_since_local_unix_epoch Rust documentation for `from_minutes_since_local_unix_epoch`} for more information. - */ - static create_from_minutes_since_local_unix_epoch(minutes: i32): ICU4XIsoDateTime; - - /** - - * Gets the date contained in this object - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date Rust documentation for `date`} for more information. - */ - date(): ICU4XIsoDate; - - /** - - * Gets the time contained in this object - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time Rust documentation for `time`} for more information. - */ - time(): ICU4XTime; - - /** - - * Converts this to an {@link ICU4XDateTime `ICU4XDateTime`} capable of being mixed with dates of other calendars - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_any Rust documentation for `to_any`} for more information. - */ - to_any(): ICU4XDateTime; - - /** - - * Gets the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.minutes_since_local_unix_epoch Rust documentation for `minutes_since_local_unix_epoch`} for more information. - */ - minutes_since_local_unix_epoch(): i32; - - /** - - * Convert this datetime to one in a different calendar - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar Rust documentation for `to_calendar`} for more information. - */ - to_calendar(calendar: ICU4XCalendar): ICU4XDateTime; - - /** - - * Returns the hour in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour Rust documentation for `hour`} for more information. - */ - hour(): u8; - - /** - - * Returns the minute in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute Rust documentation for `minute`} for more information. - */ - minute(): u8; - - /** - - * Returns the second in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second Rust documentation for `second`} for more information. - */ - second(): u8; - - /** - - * Returns the nanosecond in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond Rust documentation for `nanosecond`} for more information. - */ - nanosecond(): u32; - - /** - - * Returns the 1-indexed day in the month for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month Rust documentation for `day_of_month`} for more information. - */ - day_of_month(): u32; - - /** - - * Returns the day in the week for this day - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week Rust documentation for `day_of_week`} for more information. - */ - day_of_week(): ICU4XIsoWeekday; - - /** - - * Returns the week number in this month, 1-indexed, based on what is considered the first day of the week (often a locale preference). - - * `first_weekday` can be obtained via `first_weekday()` on {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_month Rust documentation for `week_of_month`} for more information. - */ - week_of_month(first_weekday: ICU4XIsoWeekday): u32; - - /** - - * Returns the week number in this year, using week data - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year Rust documentation for `week_of_year`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - week_of_year(calculator: ICU4XWeekCalculator): ICU4XWeekOf | never; - - /** - - * Returns 1-indexed number of the month of this date in its year - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month Rust documentation for `month`} for more information. - */ - month(): u32; - - /** - - * Returns the year number for this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year Rust documentation for `year`} for more information. - */ - year(): i32; - - /** - - * Returns the number of months in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year Rust documentation for `months_in_year`} for more information. - */ - months_in_year(): u8; - - /** - - * Returns the number of days in the month represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month Rust documentation for `days_in_month`} for more information. - */ - days_in_month(): u8; - - /** - - * Returns the number of days in the year represented by this date - - * See the {@link https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year Rust documentation for `days_in_year`} for more information. - */ - days_in_year(): u32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoDateTime.js b/third_party/rust/icu_capi/js/include/ICU4XIsoDateTime.js deleted file mode 100644 index f188bb4f2b51..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoDateTime.js +++ /dev/null @@ -1,134 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateTime } from "./ICU4XDateTime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoDate } from "./ICU4XIsoDate.js" -import { ICU4XIsoWeekday_js_to_rust, ICU4XIsoWeekday_rust_to_js } from "./ICU4XIsoWeekday.js" -import { ICU4XTime } from "./ICU4XTime.js" -import { ICU4XWeekOf } from "./ICU4XWeekOf.js" -import { ICU4XWeekRelativeUnit_js_to_rust, ICU4XWeekRelativeUnit_rust_to_js } from "./ICU4XWeekRelativeUnit.js" - -const ICU4XIsoDateTime_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XIsoDateTime_destroy(underlying); -}); - -export class ICU4XIsoDateTime { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XIsoDateTime_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_year, arg_month, arg_day, arg_hour, arg_minute, arg_second, arg_nanosecond) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XIsoDateTime_create(diplomat_receive_buffer, arg_year, arg_month, arg_day, arg_hour, arg_minute, arg_second, arg_nanosecond); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XIsoDateTime(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static crate_from_date_and_time(arg_date, arg_time) { - return new ICU4XIsoDateTime(wasm.ICU4XIsoDateTime_crate_from_date_and_time(arg_date.underlying, arg_time.underlying), true, []); - } - - static create_from_minutes_since_local_unix_epoch(arg_minutes) { - return new ICU4XIsoDateTime(wasm.ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(arg_minutes), true, []); - } - - date() { - return new ICU4XIsoDate(wasm.ICU4XIsoDateTime_date(this.underlying), true, []); - } - - time() { - return new ICU4XTime(wasm.ICU4XIsoDateTime_time(this.underlying), true, []); - } - - to_any() { - return new ICU4XDateTime(wasm.ICU4XIsoDateTime_to_any(this.underlying), true, []); - } - - minutes_since_local_unix_epoch() { - return wasm.ICU4XIsoDateTime_minutes_since_local_unix_epoch(this.underlying); - } - - to_calendar(arg_calendar) { - return new ICU4XDateTime(wasm.ICU4XIsoDateTime_to_calendar(this.underlying, arg_calendar.underlying), true, []); - } - - hour() { - return wasm.ICU4XIsoDateTime_hour(this.underlying); - } - - minute() { - return wasm.ICU4XIsoDateTime_minute(this.underlying); - } - - second() { - return wasm.ICU4XIsoDateTime_second(this.underlying); - } - - nanosecond() { - return wasm.ICU4XIsoDateTime_nanosecond(this.underlying); - } - - day_of_month() { - return wasm.ICU4XIsoDateTime_day_of_month(this.underlying); - } - - day_of_week() { - return ICU4XIsoWeekday_rust_to_js[wasm.ICU4XIsoDateTime_day_of_week(this.underlying)]; - } - - week_of_month(arg_first_weekday) { - return wasm.ICU4XIsoDateTime_week_of_month(this.underlying, ICU4XIsoWeekday_js_to_rust[arg_first_weekday]); - } - - week_of_year(arg_calculator) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(9, 4); - wasm.ICU4XIsoDateTime_week_of_year(diplomat_receive_buffer, this.underlying, arg_calculator.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 8); - if (is_ok) { - const ok_value = new ICU4XWeekOf(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 9, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - month() { - return wasm.ICU4XIsoDateTime_month(this.underlying); - } - - year() { - return wasm.ICU4XIsoDateTime_year(this.underlying); - } - - months_in_year() { - return wasm.ICU4XIsoDateTime_months_in_year(this.underlying); - } - - days_in_month() { - return wasm.ICU4XIsoDateTime_days_in_month(this.underlying); - } - - days_in_year() { - return wasm.ICU4XIsoDateTime_days_in_year(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneFormat.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneFormat.d.ts deleted file mode 100644 index 8889318a02c5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneFormat.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoFormat.html Rust documentation for `IsoFormat`} for more information. - */ -export enum ICU4XIsoTimeZoneFormat { - /** - */ - Basic = 'Basic', - /** - */ - Extended = 'Extended', - /** - */ - UtcBasic = 'UtcBasic', - /** - */ - UtcExtended = 'UtcExtended', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneFormat.js b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneFormat.js deleted file mode 100644 index aae553da7766..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneFormat.js +++ /dev/null @@ -1,23 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XIsoTimeZoneFormat_js_to_rust = { - "Basic": 0, - "Extended": 1, - "UtcBasic": 2, - "UtcExtended": 3, -}; - -export const ICU4XIsoTimeZoneFormat_rust_to_js = { - [0]: "Basic", - [1]: "Extended", - [2]: "UtcBasic", - [3]: "UtcExtended", -}; - -export const ICU4XIsoTimeZoneFormat = { - "Basic": "Basic", - "Extended": "Extended", - "UtcBasic": "UtcBasic", - "UtcExtended": "UtcExtended", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneMinuteDisplay.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneMinuteDisplay.d.ts deleted file mode 100644 index 07ed133c1858..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneMinuteDisplay.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoMinutes.html Rust documentation for `IsoMinutes`} for more information. - */ -export enum ICU4XIsoTimeZoneMinuteDisplay { - /** - */ - Required = 'Required', - /** - */ - Optional = 'Optional', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneMinuteDisplay.js b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneMinuteDisplay.js deleted file mode 100644 index f6daf3ef46c0..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneMinuteDisplay.js +++ /dev/null @@ -1,17 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XIsoTimeZoneMinuteDisplay_js_to_rust = { - "Required": 0, - "Optional": 1, -}; - -export const ICU4XIsoTimeZoneMinuteDisplay_rust_to_js = { - [0]: "Required", - [1]: "Optional", -}; - -export const ICU4XIsoTimeZoneMinuteDisplay = { - "Required": "Required", - "Optional": "Optional", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneOptions.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneOptions.d.ts deleted file mode 100644 index d150b2d2e586..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneOptions.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ICU4XIsoTimeZoneFormat } from "./ICU4XIsoTimeZoneFormat"; -import { ICU4XIsoTimeZoneMinuteDisplay } from "./ICU4XIsoTimeZoneMinuteDisplay"; -import { ICU4XIsoTimeZoneSecondDisplay } from "./ICU4XIsoTimeZoneSecondDisplay"; - -/** - */ -export class ICU4XIsoTimeZoneOptions { - format: ICU4XIsoTimeZoneFormat; - minutes: ICU4XIsoTimeZoneMinuteDisplay; - seconds: ICU4XIsoTimeZoneSecondDisplay; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneOptions.js b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneOptions.js deleted file mode 100644 index 5e9e8f16a799..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneOptions.js +++ /dev/null @@ -1,13 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XIsoTimeZoneFormat_js_to_rust, ICU4XIsoTimeZoneFormat_rust_to_js } from "./ICU4XIsoTimeZoneFormat.js" -import { ICU4XIsoTimeZoneMinuteDisplay_js_to_rust, ICU4XIsoTimeZoneMinuteDisplay_rust_to_js } from "./ICU4XIsoTimeZoneMinuteDisplay.js" -import { ICU4XIsoTimeZoneSecondDisplay_js_to_rust, ICU4XIsoTimeZoneSecondDisplay_rust_to_js } from "./ICU4XIsoTimeZoneSecondDisplay.js" - -export class ICU4XIsoTimeZoneOptions { - constructor(underlying) { - this.format = ICU4XIsoTimeZoneFormat_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying)]; - this.minutes = ICU4XIsoTimeZoneMinuteDisplay_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 4)]; - this.seconds = ICU4XIsoTimeZoneSecondDisplay_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 8)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneSecondDisplay.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneSecondDisplay.d.ts deleted file mode 100644 index 77f1c9e8b761..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneSecondDisplay.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.IsoSeconds.html Rust documentation for `IsoSeconds`} for more information. - */ -export enum ICU4XIsoTimeZoneSecondDisplay { - /** - */ - Optional = 'Optional', - /** - */ - Never = 'Never', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneSecondDisplay.js b/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneSecondDisplay.js deleted file mode 100644 index d57b7139e17a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoTimeZoneSecondDisplay.js +++ /dev/null @@ -1,17 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XIsoTimeZoneSecondDisplay_js_to_rust = { - "Optional": 0, - "Never": 1, -}; - -export const ICU4XIsoTimeZoneSecondDisplay_rust_to_js = { - [0]: "Optional", - [1]: "Never", -}; - -export const ICU4XIsoTimeZoneSecondDisplay = { - "Optional": "Optional", - "Never": "Never", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoWeekday.d.ts b/third_party/rust/icu_capi/js/include/ICU4XIsoWeekday.d.ts deleted file mode 100644 index 873f20a55f86..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoWeekday.d.ts +++ /dev/null @@ -1,26 +0,0 @@ - -/** - */ -export enum ICU4XIsoWeekday { - /** - */ - Monday = 'Monday', - /** - */ - Tuesday = 'Tuesday', - /** - */ - Wednesday = 'Wednesday', - /** - */ - Thursday = 'Thursday', - /** - */ - Friday = 'Friday', - /** - */ - Saturday = 'Saturday', - /** - */ - Sunday = 'Sunday', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XIsoWeekday.js b/third_party/rust/icu_capi/js/include/ICU4XIsoWeekday.js deleted file mode 100644 index 71912bd0e36c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XIsoWeekday.js +++ /dev/null @@ -1,32 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XIsoWeekday_js_to_rust = { - "Monday": 1, - "Tuesday": 2, - "Wednesday": 3, - "Thursday": 4, - "Friday": 5, - "Saturday": 6, - "Sunday": 7, -}; - -export const ICU4XIsoWeekday_rust_to_js = { - [1]: "Monday", - [2]: "Tuesday", - [3]: "Wednesday", - [4]: "Thursday", - [5]: "Friday", - [6]: "Saturday", - [7]: "Sunday", -}; - -export const ICU4XIsoWeekday = { - "Monday": "Monday", - "Tuesday": "Tuesday", - "Wednesday": "Wednesday", - "Thursday": "Thursday", - "Friday": "Friday", - "Saturday": "Saturday", - "Sunday": "Sunday", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XLanguageDisplay.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLanguageDisplay.d.ts deleted file mode 100644 index 8c391e8ebb3f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLanguageDisplay.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/options/enum.LanguageDisplay.html Rust documentation for `LanguageDisplay`} for more information. - */ -export enum ICU4XLanguageDisplay { - /** - */ - Dialect = 'Dialect', - /** - */ - Standard = 'Standard', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XLanguageDisplay.js b/third_party/rust/icu_capi/js/include/ICU4XLanguageDisplay.js deleted file mode 100644 index abac8082e076..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLanguageDisplay.js +++ /dev/null @@ -1,17 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XLanguageDisplay_js_to_rust = { - "Dialect": 0, - "Standard": 1, -}; - -export const ICU4XLanguageDisplay_rust_to_js = { - [0]: "Dialect", - [1]: "Standard", -}; - -export const ICU4XLanguageDisplay = { - "Dialect": "Dialect", - "Standard": "Standard", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorLatin1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorLatin1.d.ts deleted file mode 100644 index e8dfe70b589c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorLatin1.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html Rust documentation for `LineBreakIterator`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorLatin1.html 1} - */ -export class ICU4XLineBreakIteratorLatin1 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorLatin1.js b/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorLatin1.js deleted file mode 100644 index 7bd8f131538c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorLatin1.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XLineBreakIteratorLatin1_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLineBreakIteratorLatin1_destroy(underlying); -}); - -export class ICU4XLineBreakIteratorLatin1 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLineBreakIteratorLatin1_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XLineBreakIteratorLatin1_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf16.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf16.d.ts deleted file mode 100644 index 4a1b41ba9d3c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf16.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html Rust documentation for `LineBreakIterator`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorUtf16.html 1} - */ -export class ICU4XLineBreakIteratorUtf16 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf16.js b/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf16.js deleted file mode 100644 index 3ac2f871ace5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf16.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XLineBreakIteratorUtf16_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLineBreakIteratorUtf16_destroy(underlying); -}); - -export class ICU4XLineBreakIteratorUtf16 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLineBreakIteratorUtf16_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XLineBreakIteratorUtf16_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf8.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf8.d.ts deleted file mode 100644 index 9a576f122442..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf8.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html Rust documentation for `LineBreakIterator`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/segmenter/type.LineBreakIteratorPotentiallyIllFormedUtf8.html 1} - */ -export class ICU4XLineBreakIteratorUtf8 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf8.js b/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf8.js deleted file mode 100644 index a9802d00332f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakIteratorUtf8.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XLineBreakIteratorUtf8_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLineBreakIteratorUtf8_destroy(underlying); -}); - -export class ICU4XLineBreakIteratorUtf8 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLineBreakIteratorUtf8_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XLineBreakIteratorUtf8_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakOptionsV1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineBreakOptionsV1.d.ts deleted file mode 100644 index 9dd3f2e841ec..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakOptionsV1.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ICU4XLineBreakStrictness } from "./ICU4XLineBreakStrictness"; -import { ICU4XLineBreakWordOption } from "./ICU4XLineBreakWordOption"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineBreakOptions.html Rust documentation for `LineBreakOptions`} for more information. - */ -export class ICU4XLineBreakOptionsV1 { - strictness: ICU4XLineBreakStrictness; - word_option: ICU4XLineBreakWordOption; - ja_zh: boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakOptionsV1.js b/third_party/rust/icu_capi/js/include/ICU4XLineBreakOptionsV1.js deleted file mode 100644 index ee3a48175fa5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakOptionsV1.js +++ /dev/null @@ -1,12 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XLineBreakStrictness_js_to_rust, ICU4XLineBreakStrictness_rust_to_js } from "./ICU4XLineBreakStrictness.js" -import { ICU4XLineBreakWordOption_js_to_rust, ICU4XLineBreakWordOption_rust_to_js } from "./ICU4XLineBreakWordOption.js" - -export class ICU4XLineBreakOptionsV1 { - constructor(underlying) { - this.strictness = ICU4XLineBreakStrictness_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying)]; - this.word_option = ICU4XLineBreakWordOption_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 4)]; - this.ja_zh = (new Uint8Array(wasm.memory.buffer, underlying + 8, 1))[0] == 1; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakStrictness.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineBreakStrictness.d.ts deleted file mode 100644 index f92e35a751c4..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakStrictness.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakStrictness.html Rust documentation for `LineBreakStrictness`} for more information. - */ -export enum ICU4XLineBreakStrictness { - /** - */ - Loose = 'Loose', - /** - */ - Normal = 'Normal', - /** - */ - Strict = 'Strict', - /** - */ - Anywhere = 'Anywhere', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakStrictness.js b/third_party/rust/icu_capi/js/include/ICU4XLineBreakStrictness.js deleted file mode 100644 index c52030b79fc9..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakStrictness.js +++ /dev/null @@ -1,23 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XLineBreakStrictness_js_to_rust = { - "Loose": 0, - "Normal": 1, - "Strict": 2, - "Anywhere": 3, -}; - -export const ICU4XLineBreakStrictness_rust_to_js = { - [0]: "Loose", - [1]: "Normal", - [2]: "Strict", - [3]: "Anywhere", -}; - -export const ICU4XLineBreakStrictness = { - "Loose": "Loose", - "Normal": "Normal", - "Strict": "Strict", - "Anywhere": "Anywhere", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakWordOption.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineBreakWordOption.d.ts deleted file mode 100644 index 256ddb0e08dd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakWordOption.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakWordOption.html Rust documentation for `LineBreakWordOption`} for more information. - */ -export enum ICU4XLineBreakWordOption { - /** - */ - Normal = 'Normal', - /** - */ - BreakAll = 'BreakAll', - /** - */ - KeepAll = 'KeepAll', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineBreakWordOption.js b/third_party/rust/icu_capi/js/include/ICU4XLineBreakWordOption.js deleted file mode 100644 index 60094fdafde1..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineBreakWordOption.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XLineBreakWordOption_js_to_rust = { - "Normal": 0, - "BreakAll": 1, - "KeepAll": 2, -}; - -export const ICU4XLineBreakWordOption_rust_to_js = { - [0]: "Normal", - [1]: "BreakAll", - [2]: "KeepAll", -}; - -export const ICU4XLineBreakWordOption = { - "Normal": "Normal", - "BreakAll": "BreakAll", - "KeepAll": "KeepAll", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineSegmenter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLineSegmenter.d.ts deleted file mode 100644 index aac2412ae63b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineSegmenter.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLineBreakIteratorLatin1 } from "./ICU4XLineBreakIteratorLatin1"; -import { ICU4XLineBreakIteratorUtf16 } from "./ICU4XLineBreakIteratorUtf16"; -import { ICU4XLineBreakIteratorUtf8 } from "./ICU4XLineBreakIteratorUtf8"; -import { ICU4XLineBreakOptionsV1 } from "./ICU4XLineBreakOptionsV1"; - -/** - - * An ICU4X line-break segmenter, capable of finding breakpoints in strings. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html Rust documentation for `LineSegmenter`} for more information. - */ -export class ICU4XLineSegmenter { - - /** - - * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with default options. It automatically loads the best available payload data for Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_auto_unstable Rust documentation for `try_new_auto_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_auto(provider: ICU4XDataProvider): ICU4XLineSegmenter | never; - - /** - - * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with default options and LSTM payload data for Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_lstm_unstable Rust documentation for `try_new_lstm_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_lstm(provider: ICU4XDataProvider): ICU4XLineSegmenter | never; - - /** - - * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with default options and dictionary payload data for Burmese, Khmer, Lao, and Thai.. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_dictionary_unstable Rust documentation for `try_new_dictionary_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_dictionary(provider: ICU4XDataProvider): ICU4XLineSegmenter | never; - - /** - - * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with custom options. It automatically loads the best available payload data for Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_auto_with_options_unstable Rust documentation for `try_new_auto_with_options_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_auto_with_options_v1(provider: ICU4XDataProvider, options: ICU4XLineBreakOptionsV1): ICU4XLineSegmenter | never; - - /** - - * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with custom options and LSTM payload data for Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_lstm_with_options_unstable Rust documentation for `try_new_lstm_with_options_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_lstm_with_options_v1(provider: ICU4XDataProvider, options: ICU4XLineBreakOptionsV1): ICU4XLineSegmenter | never; - - /** - - * Construct a {@link ICU4XLineSegmenter `ICU4XLineSegmenter`} with custom options and dictionary payload data for Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.try_new_dictionary_with_options_unstable Rust documentation for `try_new_dictionary_with_options_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_dictionary_with_options_v1(provider: ICU4XDataProvider, options: ICU4XLineBreakOptionsV1): ICU4XLineSegmenter | never; - - /** - - * Segments a (potentially ill-formed) UTF-8 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf8 Rust documentation for `segment_utf8`} for more information. - */ - segment_utf8(input: string): ICU4XLineBreakIteratorUtf8; - - /** - - * Segments a UTF-16 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_utf16 Rust documentation for `segment_utf16`} for more information. - */ - segment_utf16(input: Uint16Array): ICU4XLineBreakIteratorUtf16; - - /** - - * Segments a Latin-1 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.LineSegmenter.html#method.segment_latin1 Rust documentation for `segment_latin1`} for more information. - */ - segment_latin1(input: Uint8Array): ICU4XLineBreakIteratorLatin1; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLineSegmenter.js b/third_party/rust/icu_capi/js/include/ICU4XLineSegmenter.js deleted file mode 100644 index eabb317515c8..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLineSegmenter.js +++ /dev/null @@ -1,149 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XLineBreakIteratorLatin1 } from "./ICU4XLineBreakIteratorLatin1.js" -import { ICU4XLineBreakIteratorUtf16 } from "./ICU4XLineBreakIteratorUtf16.js" -import { ICU4XLineBreakIteratorUtf8 } from "./ICU4XLineBreakIteratorUtf8.js" -import { ICU4XLineBreakStrictness_js_to_rust, ICU4XLineBreakStrictness_rust_to_js } from "./ICU4XLineBreakStrictness.js" -import { ICU4XLineBreakWordOption_js_to_rust, ICU4XLineBreakWordOption_rust_to_js } from "./ICU4XLineBreakWordOption.js" - -const ICU4XLineSegmenter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLineSegmenter_destroy(underlying); -}); - -export class ICU4XLineSegmenter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLineSegmenter_box_destroy_registry.register(this, underlying); - } - } - - static create_auto(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLineSegmenter_create_auto(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLineSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_lstm(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLineSegmenter_create_lstm(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLineSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_dictionary(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLineSegmenter_create_dictionary(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLineSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_auto_with_options_v1(arg_provider, arg_options) { - const field_strictness_arg_options = arg_options["strictness"]; - const field_word_option_arg_options = arg_options["word_option"]; - const field_ja_zh_arg_options = arg_options["ja_zh"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLineSegmenter_create_auto_with_options_v1(diplomat_receive_buffer, arg_provider.underlying, ICU4XLineBreakStrictness_js_to_rust[field_strictness_arg_options], ICU4XLineBreakWordOption_js_to_rust[field_word_option_arg_options], field_ja_zh_arg_options); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLineSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_lstm_with_options_v1(arg_provider, arg_options) { - const field_strictness_arg_options = arg_options["strictness"]; - const field_word_option_arg_options = arg_options["word_option"]; - const field_ja_zh_arg_options = arg_options["ja_zh"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLineSegmenter_create_lstm_with_options_v1(diplomat_receive_buffer, arg_provider.underlying, ICU4XLineBreakStrictness_js_to_rust[field_strictness_arg_options], ICU4XLineBreakWordOption_js_to_rust[field_word_option_arg_options], field_ja_zh_arg_options); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLineSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_dictionary_with_options_v1(arg_provider, arg_options) { - const field_strictness_arg_options = arg_options["strictness"]; - const field_word_option_arg_options = arg_options["word_option"]; - const field_ja_zh_arg_options = arg_options["ja_zh"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLineSegmenter_create_dictionary_with_options_v1(diplomat_receive_buffer, arg_provider.underlying, ICU4XLineBreakStrictness_js_to_rust[field_strictness_arg_options], ICU4XLineBreakWordOption_js_to_rust[field_word_option_arg_options], field_ja_zh_arg_options); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLineSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - segment_utf8(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.str(wasm, arg_input); - return new ICU4XLineBreakIteratorUtf8(wasm.ICU4XLineSegmenter_segment_utf8(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_utf16(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 2); - return new ICU4XLineBreakIteratorUtf16(wasm.ICU4XLineSegmenter_segment_utf16(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_latin1(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 1); - return new ICU4XLineBreakIteratorLatin1(wasm.ICU4XLineSegmenter_segment_latin1(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XList.d.ts b/third_party/rust/icu_capi/js/include/ICU4XList.d.ts deleted file mode 100644 index facf54a8cb41..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XList.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { usize } from "./diplomat-runtime" - -/** - - * A list of strings - */ -export class ICU4XList { - - /** - - * Create a new list of strings - */ - static create(): ICU4XList; - - /** - - * Create a new list of strings with preallocated space to hold at least `capacity` elements - */ - static create_with_capacity(capacity: usize): ICU4XList; - - /** - - * Push a string to the list - - * For C++ users, potentially invalid UTF8 will be handled via REPLACEMENT CHARACTERs - */ - push(val: string): void; - - /** - - * The number of elements in this list - */ - len(): usize; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XList.js b/third_party/rust/icu_capi/js/include/ICU4XList.js deleted file mode 100644 index 55475df4dba5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XList.js +++ /dev/null @@ -1,35 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XList_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XList_destroy(underlying); -}); - -export class ICU4XList { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XList_box_destroy_registry.register(this, underlying); - } - } - - static create() { - return new ICU4XList(wasm.ICU4XList_create(), true, []); - } - - static create_with_capacity(arg_capacity) { - return new ICU4XList(wasm.ICU4XList_create_with_capacity(arg_capacity), true, []); - } - - push(arg_val) { - const buf_arg_val = diplomatRuntime.DiplomatBuf.str(wasm, arg_val); - wasm.ICU4XList_push(this.underlying, buf_arg_val.ptr, buf_arg_val.size); - buf_arg_val.free(); - } - - len() { - return wasm.ICU4XList_len(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XListFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XListFormatter.d.ts deleted file mode 100644 index 744527bfe43f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XListFormatter.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XList } from "./ICU4XList"; -import { ICU4XListLength } from "./ICU4XListLength"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html Rust documentation for `ListFormatter`} for more information. - */ -export class ICU4XListFormatter { - - /** - - * Construct a new ICU4XListFormatter instance for And patterns - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.try_new_and_with_length_unstable Rust documentation for `try_new_and_with_length_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_and_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, length: ICU4XListLength): ICU4XListFormatter | never; - - /** - - * Construct a new ICU4XListFormatter instance for And patterns - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.try_new_or_with_length_unstable Rust documentation for `try_new_or_with_length_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_or_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, length: ICU4XListLength): ICU4XListFormatter | never; - - /** - - * Construct a new ICU4XListFormatter instance for And patterns - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.try_new_unit_with_length_unstable Rust documentation for `try_new_unit_with_length_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_unit_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, length: ICU4XListLength): ICU4XListFormatter | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ListFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format(list: ICU4XList): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XListFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XListFormatter.js deleted file mode 100644 index 63ef80b23fba..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XListFormatter.js +++ /dev/null @@ -1,89 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XListLength_js_to_rust, ICU4XListLength_rust_to_js } from "./ICU4XListLength.js" - -const ICU4XListFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XListFormatter_destroy(underlying); -}); - -export class ICU4XListFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XListFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_and_with_length(arg_provider, arg_locale, arg_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XListFormatter_create_and_with_length(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XListLength_js_to_rust[arg_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XListFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_or_with_length(arg_provider, arg_locale, arg_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XListFormatter_create_or_with_length(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XListLength_js_to_rust[arg_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XListFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_unit_with_length(arg_provider, arg_locale, arg_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XListFormatter_create_unit_with_length(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XListLength_js_to_rust[arg_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XListFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format(arg_list) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XListFormatter_format(diplomat_receive_buffer, this.underlying, arg_list.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XListLength.d.ts b/third_party/rust/icu_capi/js/include/ICU4XListLength.d.ts deleted file mode 100644 index 4aa3e3b4d5ec..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XListLength.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/list/enum.ListLength.html Rust documentation for `ListLength`} for more information. - */ -export enum ICU4XListLength { - /** - */ - Wide = 'Wide', - /** - */ - Short = 'Short', - /** - */ - Narrow = 'Narrow', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XListLength.js b/third_party/rust/icu_capi/js/include/ICU4XListLength.js deleted file mode 100644 index 171e851b4d98..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XListLength.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XListLength_js_to_rust = { - "Wide": 0, - "Short": 1, - "Narrow": 2, -}; - -export const ICU4XListLength_rust_to_js = { - [0]: "Wide", - [1]: "Short", - [2]: "Narrow", -}; - -export const ICU4XListLength = { - "Wide": "Wide", - "Short": "Short", - "Narrow": "Narrow", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocale.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocale.d.ts deleted file mode 100644 index 935d45961f72..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocale.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; -import { ICU4XOrdering } from "./ICU4XOrdering"; - -/** - - * An ICU4X Locale, capable of representing strings like `"en-US"`. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html Rust documentation for `Locale`} for more information. - */ -export class ICU4XLocale { - - /** - - * Construct an {@link ICU4XLocale `ICU4XLocale`} from an locale identifier. - - * This will run the complete locale parsing algorithm. If code size and performance are critical and the locale is of a known shape (such as `aa-BB`) use `create_und`, `set_language`, `set_script`, and `set_region`. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes Rust documentation for `try_from_bytes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_string(name: string): ICU4XLocale | never; - - /** - - * Construct a default undefined {@link ICU4XLocale `ICU4XLocale`} "und". - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#associatedconstant.UND Rust documentation for `UND`} for more information. - */ - static create_und(): ICU4XLocale; - - /** - - * Clones the {@link ICU4XLocale `ICU4XLocale`}. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html Rust documentation for `Locale`} for more information. - */ - clone(): ICU4XLocale; - - /** - - * Write a string representation of the `LanguageIdentifier` part of {@link ICU4XLocale `ICU4XLocale`} to `write`. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id Rust documentation for `id`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - basename(): string | never; - - /** - - * Write a string representation of the unicode extension to `write` - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.extensions Rust documentation for `extensions`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - get_unicode_extension(bytes: string): string | never; - - /** - - * Write a string representation of {@link ICU4XLocale `ICU4XLocale`} language to `write` - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id Rust documentation for `id`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - language(): string | never; - - /** - - * Set the language part of the {@link ICU4XLocale `ICU4XLocale`}. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes Rust documentation for `try_from_bytes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - set_language(bytes: string): void | never; - - /** - - * Write a string representation of {@link ICU4XLocale `ICU4XLocale`} region to `write` - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id Rust documentation for `id`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - region(): string | never; - - /** - - * Set the region part of the {@link ICU4XLocale `ICU4XLocale`}. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes Rust documentation for `try_from_bytes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - set_region(bytes: string): void | never; - - /** - - * Write a string representation of {@link ICU4XLocale `ICU4XLocale`} script to `write` - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id Rust documentation for `id`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - script(): string | never; - - /** - - * Set the script part of the {@link ICU4XLocale `ICU4XLocale`}. Pass an empty string to remove the script. - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes Rust documentation for `try_from_bytes`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - set_script(bytes: string): void | never; - - /** - - * Best effort locale canonicalizer that doesn't need any data - - * Use ICU4XLocaleCanonicalizer for better control and functionality - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.canonicalize Rust documentation for `canonicalize`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static canonicalize(bytes: string): string | never; - - /** - - * Write a string representation of {@link ICU4XLocale `ICU4XLocale`} to `write` - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.write_to Rust documentation for `write_to`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - to_string(): string | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.normalizing_eq Rust documentation for `normalizing_eq`} for more information. - */ - normalizing_eq(other: string): boolean; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.strict_cmp Rust documentation for `strict_cmp`} for more information. - */ - strict_cmp(other: string): ICU4XOrdering; - - /** - - * Construct an {@link ICU4XLocale `ICU4XLocale`} for the English language. - - * This convenience constructor is intended for testing only and requires the `provider_test` feature. - */ - static create_en(): ICU4XLocale; - - /** - - * Construct an {@link ICU4XLocale `ICU4XLocale`} for the Bangla language. - - * This convenience constructor is intended for testing only and requires the `provider_test` feature. - */ - static create_bn(): ICU4XLocale; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocale.js b/third_party/rust/icu_capi/js/include/ICU4XLocale.js deleted file mode 100644 index b3cb1398424f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocale.js +++ /dev/null @@ -1,268 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XOrdering_js_to_rust, ICU4XOrdering_rust_to_js } from "./ICU4XOrdering.js" - -const ICU4XLocale_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocale_destroy(underlying); -}); - -export class ICU4XLocale { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocale_box_destroy_registry.register(this, underlying); - } - } - - static create_from_string(arg_name) { - const buf_arg_name = diplomatRuntime.DiplomatBuf.str(wasm, arg_name); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_create_from_string(diplomat_receive_buffer, buf_arg_name.ptr, buf_arg_name.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocale(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_name.free(); - return diplomat_out; - } - - static create_und() { - return new ICU4XLocale(wasm.ICU4XLocale_create_und(), true, []); - } - - clone() { - return new ICU4XLocale(wasm.ICU4XLocale_clone(this.underlying), true, []); - } - - basename() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_basename(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - get_unicode_extension(arg_bytes) { - const buf_arg_bytes = diplomatRuntime.DiplomatBuf.str(wasm, arg_bytes); - const diplomat_out = diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_get_unicode_extension(diplomat_receive_buffer, this.underlying, buf_arg_bytes.ptr, buf_arg_bytes.size, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - buf_arg_bytes.free(); - return diplomat_out; - } - - language() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_language(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - set_language(arg_bytes) { - const buf_arg_bytes = diplomatRuntime.DiplomatBuf.str(wasm, arg_bytes); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_set_language(diplomat_receive_buffer, this.underlying, buf_arg_bytes.ptr, buf_arg_bytes.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_bytes.free(); - return diplomat_out; - } - - region() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_region(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - set_region(arg_bytes) { - const buf_arg_bytes = diplomatRuntime.DiplomatBuf.str(wasm, arg_bytes); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_set_region(diplomat_receive_buffer, this.underlying, buf_arg_bytes.ptr, buf_arg_bytes.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_bytes.free(); - return diplomat_out; - } - - script() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_script(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - set_script(arg_bytes) { - const buf_arg_bytes = diplomatRuntime.DiplomatBuf.str(wasm, arg_bytes); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_set_script(diplomat_receive_buffer, this.underlying, buf_arg_bytes.ptr, buf_arg_bytes.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_bytes.free(); - return diplomat_out; - } - - static canonicalize(arg_bytes) { - const buf_arg_bytes = diplomatRuntime.DiplomatBuf.str(wasm, arg_bytes); - const diplomat_out = diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_canonicalize(diplomat_receive_buffer, buf_arg_bytes.ptr, buf_arg_bytes.size, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - buf_arg_bytes.free(); - return diplomat_out; - } - - to_string() { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocale_to_string(diplomat_receive_buffer, this.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - normalizing_eq(arg_other) { - const buf_arg_other = diplomatRuntime.DiplomatBuf.str(wasm, arg_other); - const diplomat_out = wasm.ICU4XLocale_normalizing_eq(this.underlying, buf_arg_other.ptr, buf_arg_other.size); - buf_arg_other.free(); - return diplomat_out; - } - - strict_cmp(arg_other) { - const buf_arg_other = diplomatRuntime.DiplomatBuf.str(wasm, arg_other); - const diplomat_out = ICU4XOrdering_rust_to_js[wasm.ICU4XLocale_strict_cmp(this.underlying, buf_arg_other.ptr, buf_arg_other.size)]; - buf_arg_other.free(); - return diplomat_out; - } - - static create_en() { - return new ICU4XLocale(wasm.ICU4XLocale_create_en(), true, []); - } - - static create_bn() { - return new ICU4XLocale(wasm.ICU4XLocale_create_bn(), true, []); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleCanonicalizer.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleCanonicalizer.d.ts deleted file mode 100644 index 120053d9993c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleCanonicalizer.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTransformResult } from "./ICU4XTransformResult"; - -/** - - * A locale canonicalizer. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html Rust documentation for `LocaleCanonicalizer`} for more information. - */ -export class ICU4XLocaleCanonicalizer { - - /** - - * Create a new {@link ICU4XLocaleCanonicalizer `ICU4XLocaleCanonicalizer`}. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XLocaleCanonicalizer | never; - - /** - - * Create a new {@link ICU4XLocaleCanonicalizer `ICU4XLocaleCanonicalizer`} with extended data. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.try_new_with_expander_unstable Rust documentation for `try_new_with_expander_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_extended(provider: ICU4XDataProvider): ICU4XLocaleCanonicalizer | never; - - /** - - * FFI version of `LocaleCanonicalizer::canonicalize()`. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.canonicalize Rust documentation for `canonicalize`} for more information. - */ - canonicalize(locale: ICU4XLocale): ICU4XTransformResult; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleCanonicalizer.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleCanonicalizer.js deleted file mode 100644 index 8a5a98da83cb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleCanonicalizer.js +++ /dev/null @@ -1,57 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XTransformResult_js_to_rust, ICU4XTransformResult_rust_to_js } from "./ICU4XTransformResult.js" - -const ICU4XLocaleCanonicalizer_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocaleCanonicalizer_destroy(underlying); -}); - -export class ICU4XLocaleCanonicalizer { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocaleCanonicalizer_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleCanonicalizer_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleCanonicalizer(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_extended(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleCanonicalizer_create_extended(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleCanonicalizer(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - canonicalize(arg_locale) { - return ICU4XTransformResult_rust_to_js[wasm.ICU4XLocaleCanonicalizer_canonicalize(this.underlying, arg_locale.underlying)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleDisplayNamesFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleDisplayNamesFormatter.d.ts deleted file mode 100644 index 8b0f9584cbb3..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleDisplayNamesFormatter.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDisplayNamesOptionsV1 } from "./ICU4XDisplayNamesOptionsV1"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html Rust documentation for `LocaleDisplayNamesFormatter`} for more information. - */ -export class ICU4XLocaleDisplayNamesFormatter { - - /** - - * Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag. - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static try_new_unstable(provider: ICU4XDataProvider, locale: ICU4XLocale, options: ICU4XDisplayNamesOptionsV1): ICU4XLocaleDisplayNamesFormatter | never; - - /** - - * Returns the locale-specific display name of a locale. - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.of Rust documentation for `of`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - of(locale: ICU4XLocale): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleDisplayNamesFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleDisplayNamesFormatter.js deleted file mode 100644 index f7d87ac0b621..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleDisplayNamesFormatter.js +++ /dev/null @@ -1,60 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDisplayNamesFallback_js_to_rust, ICU4XDisplayNamesFallback_rust_to_js } from "./ICU4XDisplayNamesFallback.js" -import { ICU4XDisplayNamesStyle_js_to_rust, ICU4XDisplayNamesStyle_rust_to_js } from "./ICU4XDisplayNamesStyle.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XLanguageDisplay_js_to_rust, ICU4XLanguageDisplay_rust_to_js } from "./ICU4XLanguageDisplay.js" - -const ICU4XLocaleDisplayNamesFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocaleDisplayNamesFormatter_destroy(underlying); -}); - -export class ICU4XLocaleDisplayNamesFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocaleDisplayNamesFormatter_box_destroy_registry.register(this, underlying); - } - } - - static try_new_unstable(arg_provider, arg_locale, arg_options) { - const field_style_arg_options = arg_options["style"]; - const field_fallback_arg_options = arg_options["fallback"]; - const field_language_display_arg_options = arg_options["language_display"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleDisplayNamesFormatter_try_new_unstable(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDisplayNamesStyle_js_to_rust[field_style_arg_options], ICU4XDisplayNamesFallback_js_to_rust[field_fallback_arg_options], ICU4XLanguageDisplay_js_to_rust[field_language_display_arg_options]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleDisplayNamesFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - of(arg_locale) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleDisplayNamesFormatter_of(diplomat_receive_buffer, this.underlying, arg_locale.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleExpander.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleExpander.d.ts deleted file mode 100644 index 8ac04e9bbd0b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleExpander.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTransformResult } from "./ICU4XTransformResult"; - -/** - - * A locale expander. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html Rust documentation for `LocaleExpander`} for more information. - */ -export class ICU4XLocaleExpander { - - /** - - * Create a new {@link ICU4XLocaleExpander `ICU4XLocaleExpander`}. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XLocaleExpander | never; - - /** - - * Create a new {@link ICU4XLocaleExpander `ICU4XLocaleExpander`} with extended data. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.try_new_extended_unstable Rust documentation for `try_new_extended_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_extended(provider: ICU4XDataProvider): ICU4XLocaleExpander | never; - - /** - - * FFI version of `LocaleExpander::maximize()`. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.maximize Rust documentation for `maximize`} for more information. - */ - maximize(locale: ICU4XLocale): ICU4XTransformResult; - - /** - - * FFI version of `LocaleExpander::minimize()`. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.minimize Rust documentation for `minimize`} for more information. - */ - minimize(locale: ICU4XLocale): ICU4XTransformResult; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleExpander.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleExpander.js deleted file mode 100644 index 439698b27e59..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleExpander.js +++ /dev/null @@ -1,61 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XTransformResult_js_to_rust, ICU4XTransformResult_rust_to_js } from "./ICU4XTransformResult.js" - -const ICU4XLocaleExpander_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocaleExpander_destroy(underlying); -}); - -export class ICU4XLocaleExpander { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocaleExpander_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleExpander_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleExpander(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_extended(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleExpander_create_extended(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleExpander(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - maximize(arg_locale) { - return ICU4XTransformResult_rust_to_js[wasm.ICU4XLocaleExpander_maximize(this.underlying, arg_locale.underlying)]; - } - - minimize(arg_locale) { - return ICU4XTransformResult_rust_to_js[wasm.ICU4XLocaleExpander_minimize(this.underlying, arg_locale.underlying)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackConfig.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackConfig.d.ts deleted file mode 100644 index a49ad3c74030..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackConfig.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ICU4XLocaleFallbackPriority } from "./ICU4XLocaleFallbackPriority"; - -/** - - * Collection of configurations for the ICU4X fallback algorithm. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackConfig.html Rust documentation for `LocaleFallbackConfig`} for more information. - */ -export class ICU4XLocaleFallbackConfig { - priority: ICU4XLocaleFallbackPriority; - extension_key: string; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackConfig.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackConfig.js deleted file mode 100644 index 56e883cdaea8..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackConfig.js +++ /dev/null @@ -1,13 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XLocaleFallbackPriority_js_to_rust, ICU4XLocaleFallbackPriority_rust_to_js } from "./ICU4XLocaleFallbackPriority.js" - -export class ICU4XLocaleFallbackConfig { - constructor(underlying, edges_a) { - this.priority = ICU4XLocaleFallbackPriority_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying)]; - this.extension_key = (() => { - const [ptr, size] = new Uint32Array(wasm.memory.buffer, underlying + 4, 2); - return diplomatRuntime.readString(wasm, ptr, size); - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackIterator.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackIterator.d.ts deleted file mode 100644 index 6f35f029823c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackIterator.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * An iterator over the locale under fallback. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackIterator.html Rust documentation for `LocaleFallbackIterator`} for more information. - */ -export class ICU4XLocaleFallbackIterator { - - /** - - * Gets a snapshot of the current state of the locale. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackIterator.html#method.get Rust documentation for `get`} for more information. - */ - get(): ICU4XLocale; - - /** - - * Performs one step of the fallback algorithm, mutating the locale. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackIterator.html#method.step Rust documentation for `step`} for more information. - */ - step(): void; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackIterator.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackIterator.js deleted file mode 100644 index 4540e3d7db26..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackIterator.js +++ /dev/null @@ -1,26 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XLocale } from "./ICU4XLocale.js" - -const ICU4XLocaleFallbackIterator_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocaleFallbackIterator_destroy(underlying); -}); - -export class ICU4XLocaleFallbackIterator { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocaleFallbackIterator_box_destroy_registry.register(this, underlying); - } - } - - get() { - return new ICU4XLocale(wasm.ICU4XLocaleFallbackIterator_get(this.underlying), true, []); - } - - step() { - wasm.ICU4XLocaleFallbackIterator_step(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackPriority.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackPriority.d.ts deleted file mode 100644 index 2867901f143a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackPriority.d.ts +++ /dev/null @@ -1,18 +0,0 @@ - -/** - - * Priority mode for the ICU4X fallback algorithm. - - * See the {@link https://docs.rs/icu_provider/latest/icu_provider/enum.FallbackPriority.html Rust documentation for `FallbackPriority`} for more information. - */ -export enum ICU4XLocaleFallbackPriority { - /** - */ - Language = 'Language', - /** - */ - Region = 'Region', - /** - */ - Collation = 'Collation', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackPriority.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackPriority.js deleted file mode 100644 index 421e73fb71c8..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackPriority.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XLocaleFallbackPriority_js_to_rust = { - "Language": 0, - "Region": 1, - "Collation": 2, -}; - -export const ICU4XLocaleFallbackPriority_rust_to_js = { - [0]: "Language", - [1]: "Region", - [2]: "Collation", -}; - -export const ICU4XLocaleFallbackPriority = { - "Language": "Language", - "Region": "Region", - "Collation": "Collation", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbacker.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbacker.d.ts deleted file mode 100644 index 145863834ebd..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbacker.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocaleFallbackConfig } from "./ICU4XLocaleFallbackConfig"; -import { ICU4XLocaleFallbackerWithConfig } from "./ICU4XLocaleFallbackerWithConfig"; - -/** - - * An object that runs the ICU4X locale fallback algorithm. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html Rust documentation for `LocaleFallbacker`} for more information. - */ -export class ICU4XLocaleFallbacker { - - /** - - * Creates a new `ICU4XLocaleFallbacker` from a data provider. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XLocaleFallbacker | never; - - /** - - * Creates a new `ICU4XLocaleFallbacker` without data for limited functionality. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html#method.new_without_data Rust documentation for `new_without_data`} for more information. - */ - static create_without_data(): ICU4XLocaleFallbacker; - - /** - - * Associates this `ICU4XLocaleFallbacker` with configuration options. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbacker.html#method.for_config Rust documentation for `for_config`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - for_config(config: ICU4XLocaleFallbackConfig): ICU4XLocaleFallbackerWithConfig | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbacker.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbacker.js deleted file mode 100644 index 0ec01f33f309..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbacker.js +++ /dev/null @@ -1,63 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XLocaleFallbackPriority_js_to_rust, ICU4XLocaleFallbackPriority_rust_to_js } from "./ICU4XLocaleFallbackPriority.js" -import { ICU4XLocaleFallbackerWithConfig } from "./ICU4XLocaleFallbackerWithConfig.js" - -const ICU4XLocaleFallbacker_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocaleFallbacker_destroy(underlying); -}); - -export class ICU4XLocaleFallbacker { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocaleFallbacker_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleFallbacker_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleFallbacker(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_without_data() { - return new ICU4XLocaleFallbacker(wasm.ICU4XLocaleFallbacker_create_without_data(), true, []); - } - - for_config(arg_config) { - const field_priority_arg_config = arg_config["priority"]; - const field_extension_key_arg_config = arg_config["extension_key"]; - const buf_field_extension_key_arg_config = diplomatRuntime.DiplomatBuf.str(wasm, field_extension_key_arg_config); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XLocaleFallbacker_for_config(diplomat_receive_buffer, this.underlying, ICU4XLocaleFallbackPriority_js_to_rust[field_priority_arg_config], buf_field_extension_key_arg_config.ptr, buf_field_extension_key_arg_config.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XLocaleFallbackerWithConfig(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, [this]); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_field_extension_key_arg_config.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackerWithConfig.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackerWithConfig.d.ts deleted file mode 100644 index f3d220238f6c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackerWithConfig.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XLocaleFallbackIterator } from "./ICU4XLocaleFallbackIterator"; - -/** - - * An object that runs the ICU4X locale fallback algorithm with specific configurations. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackerWithConfig.html Rust documentation for `LocaleFallbackerWithConfig`} for more information. - */ -export class ICU4XLocaleFallbackerWithConfig { - - /** - - * Creates an iterator from a locale with each step of fallback. - - * See the {@link https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackerWithConfig.html#method.fallback_for Rust documentation for `fallback_for`} for more information. - */ - fallback_for_locale(locale: ICU4XLocale): ICU4XLocaleFallbackIterator; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackerWithConfig.js b/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackerWithConfig.js deleted file mode 100644 index 632654df03b0..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLocaleFallbackerWithConfig.js +++ /dev/null @@ -1,22 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XLocaleFallbackIterator } from "./ICU4XLocaleFallbackIterator.js" - -const ICU4XLocaleFallbackerWithConfig_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLocaleFallbackerWithConfig_destroy(underlying); -}); - -export class ICU4XLocaleFallbackerWithConfig { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLocaleFallbackerWithConfig_box_destroy_registry.register(this, underlying); - } - } - - fallback_for_locale(arg_locale) { - return new ICU4XLocaleFallbackIterator(wasm.ICU4XLocaleFallbackerWithConfig_fallback_for_locale(this.underlying, arg_locale.underlying), true, [this]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLogger.d.ts b/third_party/rust/icu_capi/js/include/ICU4XLogger.d.ts deleted file mode 100644 index 2b33c03234b6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLogger.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - - * An object allowing control over the logging used - */ -export class ICU4XLogger { - - /** - - * Initialize the logger from the `simple_logger` crate, which simply logs to stdout. Returns `false` if there was already a logger set, or if logging has not been compiled into the platform - */ - static init_simple_logger(): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XLogger.js b/third_party/rust/icu_capi/js/include/ICU4XLogger.js deleted file mode 100644 index 03aaae2d3075..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XLogger.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XLogger_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XLogger_destroy(underlying); -}); - -export class ICU4XLogger { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XLogger_box_destroy_registry.register(this, underlying); - } - } - - static init_simple_logger() { - return wasm.ICU4XLogger_init_simple_logger(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XMetazoneCalculator.d.ts b/third_party/rust/icu_capi/js/include/ICU4XMetazoneCalculator.d.ts deleted file mode 100644 index 988f756e798a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XMetazoneCalculator.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * An object capable of computing the metazone from a timezone. - - * This can be used via `maybe_calculate_metazone()` on {@link crate::timezone::ffi::ICU4XCustomTimeZone; `ICU4XCustomTimeZone`}. - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html Rust documentation for `MetazoneCalculator`} for more information. - */ -export class ICU4XMetazoneCalculator { - - /** - - * See the {@link https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XMetazoneCalculator | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XMetazoneCalculator.js b/third_party/rust/icu_capi/js/include/ICU4XMetazoneCalculator.js deleted file mode 100644 index a72b56af0c23..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XMetazoneCalculator.js +++ /dev/null @@ -1,35 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XMetazoneCalculator_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XMetazoneCalculator_destroy(underlying); -}); - -export class ICU4XMetazoneCalculator { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XMetazoneCalculator_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XMetazoneCalculator_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XMetazoneCalculator(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XOrdering.d.ts b/third_party/rust/icu_capi/js/include/ICU4XOrdering.d.ts deleted file mode 100644 index 1567229a9b34..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XOrdering.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/core/latest/core/cmp/enum.Ordering.html Rust documentation for `Ordering`} for more information. - */ -export enum ICU4XOrdering { - /** - */ - Less = 'Less', - /** - */ - Equal = 'Equal', - /** - */ - Greater = 'Greater', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XOrdering.js b/third_party/rust/icu_capi/js/include/ICU4XOrdering.js deleted file mode 100644 index fb86968e7032..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XOrdering.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XOrdering_js_to_rust = { - "Less": -1, - "Equal": 0, - "Greater": 1, -}; - -export const ICU4XOrdering_rust_to_js = { - [-1]: "Less", - [0]: "Equal", - [1]: "Greater", -}; - -export const ICU4XOrdering = { - "Less": "Less", - "Equal": "Equal", - "Greater": "Greater", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralCategories.d.ts b/third_party/rust/icu_capi/js/include/ICU4XPluralCategories.d.ts deleted file mode 100644 index f74b1f4f935f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralCategories.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/** - - * FFI version of `PluralRules::categories()` data. - */ -export class ICU4XPluralCategories { - zero: boolean; - one: boolean; - two: boolean; - few: boolean; - many: boolean; - other: boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralCategories.js b/third_party/rust/icu_capi/js/include/ICU4XPluralCategories.js deleted file mode 100644 index 84e8fcf1ce17..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralCategories.js +++ /dev/null @@ -1,13 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export class ICU4XPluralCategories { - constructor(underlying) { - this.zero = (new Uint8Array(wasm.memory.buffer, underlying, 1))[0] == 1; - this.one = (new Uint8Array(wasm.memory.buffer, underlying + 1, 1))[0] == 1; - this.two = (new Uint8Array(wasm.memory.buffer, underlying + 2, 1))[0] == 1; - this.few = (new Uint8Array(wasm.memory.buffer, underlying + 3, 1))[0] == 1; - this.many = (new Uint8Array(wasm.memory.buffer, underlying + 4, 1))[0] == 1; - this.other = (new Uint8Array(wasm.memory.buffer, underlying + 5, 1))[0] == 1; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralCategory.d.ts b/third_party/rust/icu_capi/js/include/ICU4XPluralCategory.d.ts deleted file mode 100644 index 7b1a9831c098..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralCategory.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FFIError } from "./diplomat-runtime" - -/** - - * FFI version of `PluralCategory`. - - * See the {@link https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html Rust documentation for `PluralCategory`} for more information. - */ -export enum ICU4XPluralCategory { - /** - */ - Zero = 'Zero', - /** - */ - One = 'One', - /** - */ - Two = 'Two', - /** - */ - Few = 'Few', - /** - */ - Many = 'Many', - /** - */ - Other = 'Other', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralCategory.js b/third_party/rust/icu_capi/js/include/ICU4XPluralCategory.js deleted file mode 100644 index 299abbb4b0d7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralCategory.js +++ /dev/null @@ -1,29 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XPluralCategory_js_to_rust = { - "Zero": 0, - "One": 1, - "Two": 2, - "Few": 3, - "Many": 4, - "Other": 5, -}; - -export const ICU4XPluralCategory_rust_to_js = { - [0]: "Zero", - [1]: "One", - [2]: "Two", - [3]: "Few", - [4]: "Many", - [5]: "Other", -}; - -export const ICU4XPluralCategory = { - "Zero": "Zero", - "One": "One", - "Two": "Two", - "Few": "Few", - "Many": "Many", - "Other": "Other", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralOperands.d.ts b/third_party/rust/icu_capi/js/include/ICU4XPluralOperands.d.ts deleted file mode 100644 index a521100d17a8..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralOperands.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; - -/** - - * FFI version of `PluralOperands`. - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html Rust documentation for `PluralOperands`} for more information. - */ -export class ICU4XPluralOperands { - - /** - - * Construct for a given string representing a number - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html#method.from_str Rust documentation for `from_str`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_from_string(s: string): ICU4XPluralOperands | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralOperands.js b/third_party/rust/icu_capi/js/include/ICU4XPluralOperands.js deleted file mode 100644 index 6fdffaef2adb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralOperands.js +++ /dev/null @@ -1,38 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XPluralOperands_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XPluralOperands_destroy(underlying); -}); - -export class ICU4XPluralOperands { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XPluralOperands_box_destroy_registry.register(this, underlying); - } - } - - static create_from_string(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPluralOperands_create_from_string(diplomat_receive_buffer, buf_arg_s.ptr, buf_arg_s.size); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPluralOperands(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - buf_arg_s.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralRules.d.ts b/third_party/rust/icu_capi/js/include/ICU4XPluralRules.d.ts deleted file mode 100644 index 0d250e7beb6d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralRules.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XPluralCategories } from "./ICU4XPluralCategories"; -import { ICU4XPluralCategory } from "./ICU4XPluralCategory"; -import { ICU4XPluralOperands } from "./ICU4XPluralOperands"; - -/** - - * FFI version of `PluralRules`. - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html Rust documentation for `PluralRules`} for more information. - */ -export class ICU4XPluralRules { - - /** - - * Construct an {@link ICU4XPluralRules `ICU4XPluralRules`} for the given locale, for cardinal numbers - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal_unstable Rust documentation for `try_new_cardinal_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_cardinal(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XPluralRules | never; - - /** - - * Construct an {@link ICU4XPluralRules `ICU4XPluralRules`} for the given locale, for ordinal numbers - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal_unstable Rust documentation for `try_new_ordinal_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_ordinal(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XPluralRules | never; - - /** - - * Get the category for a given number represented as operands - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for Rust documentation for `category_for`} for more information. - */ - category_for(op: ICU4XPluralOperands): ICU4XPluralCategory; - - /** - - * Get all of the categories needed in the current locale - - * See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories Rust documentation for `categories`} for more information. - */ - categories(): ICU4XPluralCategories; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPluralRules.js b/third_party/rust/icu_capi/js/include/ICU4XPluralRules.js deleted file mode 100644 index bb78fd8ab51f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPluralRules.js +++ /dev/null @@ -1,68 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XPluralCategories } from "./ICU4XPluralCategories.js" -import { ICU4XPluralCategory_js_to_rust, ICU4XPluralCategory_rust_to_js } from "./ICU4XPluralCategory.js" - -const ICU4XPluralRules_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XPluralRules_destroy(underlying); -}); - -export class ICU4XPluralRules { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XPluralRules_box_destroy_registry.register(this, underlying); - } - } - - static create_cardinal(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPluralRules_create_cardinal(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPluralRules(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_ordinal(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPluralRules_create_ordinal(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPluralRules(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - category_for(arg_op) { - return ICU4XPluralCategory_rust_to_js[wasm.ICU4XPluralRules_category_for(this.underlying, arg_op.underlying)]; - } - - categories() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(6, 1); - wasm.ICU4XPluralRules_categories(diplomat_receive_buffer, this.underlying); - const out = new ICU4XPluralCategories(diplomat_receive_buffer); - wasm.diplomat_free(diplomat_receive_buffer, 6, 1); - return out; - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPropertyValueNameToEnumMapper.d.ts b/third_party/rust/icu_capi/js/include/ICU4XPropertyValueNameToEnumMapper.d.ts deleted file mode 100644 index fbb101a54b4c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPropertyValueNameToEnumMapper.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { i16 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; - -/** - - * A type capable of looking up a property value from a string name. - - * See the {@link https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapper.html Rust documentation for `PropertyValueNameToEnumMapper`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html Rust documentation for `PropertyValueNameToEnumMapperBorrowed`} for more information. - */ -export class ICU4XPropertyValueNameToEnumMapper { - - /** - - * Get the property value matching the given name, using strict matching - - * Returns -1 if the name is unknown for this property - - * See the {@link https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html#method.get_strict Rust documentation for `get_strict`} for more information. - */ - get_strict(name: string): i16; - - /** - - * Get the property value matching the given name, using loose matching - - * Returns -1 if the name is unknown for this property - - * See the {@link https://docs.rs/icu/latest/icu/properties/names/struct.PropertyValueNameToEnumMapperBorrowed.html#method.get_loose Rust documentation for `get_loose`} for more information. - */ - get_loose(name: string): i16; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.GeneralCategory.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_general_category(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.BidiClass.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_bidi_class(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.EastAsianWidth.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_east_asian_width(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.LineBreak.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_line_break(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.GraphemeClusterBreak.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_grapheme_cluster_break(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.WordBreak.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_word_break(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.SentenceBreak.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_sentence_break(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/struct.Script.html#method.get_name_to_enum_mapper Rust documentation for `get_name_to_enum_mapper`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_script(provider: ICU4XDataProvider): ICU4XPropertyValueNameToEnumMapper | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XPropertyValueNameToEnumMapper.js b/third_party/rust/icu_capi/js/include/ICU4XPropertyValueNameToEnumMapper.js deleted file mode 100644 index 2029aab5085a..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XPropertyValueNameToEnumMapper.js +++ /dev/null @@ -1,168 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XPropertyValueNameToEnumMapper_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XPropertyValueNameToEnumMapper_destroy(underlying); -}); - -export class ICU4XPropertyValueNameToEnumMapper { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XPropertyValueNameToEnumMapper_box_destroy_registry.register(this, underlying); - } - } - - get_strict(arg_name) { - const buf_arg_name = diplomatRuntime.DiplomatBuf.str(wasm, arg_name); - const diplomat_out = wasm.ICU4XPropertyValueNameToEnumMapper_get_strict(this.underlying, buf_arg_name.ptr, buf_arg_name.size); - buf_arg_name.free(); - return diplomat_out; - } - - get_loose(arg_name) { - const buf_arg_name = diplomatRuntime.DiplomatBuf.str(wasm, arg_name); - const diplomat_out = wasm.ICU4XPropertyValueNameToEnumMapper_get_loose(this.underlying, buf_arg_name.ptr, buf_arg_name.size); - buf_arg_name.free(); - return diplomat_out; - } - - static load_general_category(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_general_category(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_bidi_class(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_bidi_class(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_east_asian_width(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_line_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_line_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_grapheme_cluster_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_word_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_word_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_sentence_break(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_sentence_break(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_script(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XPropertyValueNameToEnumMapper_load_script(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XPropertyValueNameToEnumMapper(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XRegionDisplayNames.d.ts b/third_party/rust/icu_capi/js/include/ICU4XRegionDisplayNames.d.ts deleted file mode 100644 index 3bb733b416e4..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XRegionDisplayNames.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html Rust documentation for `RegionDisplayNames`} for more information. - */ -export class ICU4XRegionDisplayNames { - - /** - - * Creates a new `RegionDisplayNames` from locale data and an options bag. - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static try_new_unstable(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XRegionDisplayNames | never; - - /** - - * Returns the locale specific display name of a region. Note that the funtion returns an empty string in case the display name for a given region code is not found. - - * See the {@link https://docs.rs/icu/latest/icu/displaynames/struct.RegionDisplayNames.html#method.of Rust documentation for `of`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - of(region: string): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XRegionDisplayNames.js b/third_party/rust/icu_capi/js/include/ICU4XRegionDisplayNames.js deleted file mode 100644 index 76277a20a067..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XRegionDisplayNames.js +++ /dev/null @@ -1,57 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XRegionDisplayNames_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XRegionDisplayNames_destroy(underlying); -}); - -export class ICU4XRegionDisplayNames { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XRegionDisplayNames_box_destroy_registry.register(this, underlying); - } - } - - static try_new_unstable(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XRegionDisplayNames_try_new_unstable(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XRegionDisplayNames(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - of(arg_region) { - const buf_arg_region = diplomatRuntime.DiplomatBuf.str(wasm, arg_region); - const diplomat_out = diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XRegionDisplayNames_of(diplomat_receive_buffer, this.underlying, buf_arg_region.ptr, buf_arg_region.size, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - buf_arg_region.free(); - return diplomat_out; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XReorderedIndexMap.d.ts b/third_party/rust/icu_capi/js/include/ICU4XReorderedIndexMap.d.ts deleted file mode 100644 index ef6889f2ae61..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XReorderedIndexMap.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { usize } from "./diplomat-runtime" - -/** - - * Thin wrapper around a vector that maps visual indices to source indices - - * `map[visualIndex] = sourceIndex` - - * Produced by `reorder_visual()` on {@link ICU4XBidi `ICU4XBidi`}. - */ -export class ICU4XReorderedIndexMap { - - /** - - * Get this as a slice/array of indices - */ - as_slice(): Uint32Array; - - /** - - * The length of this map - */ - len(): usize; - - /** - - * Get element at `index`. Returns 0 when out of bounds (note that 0 is also a valid in-bounds value, please use `len()` to avoid out-of-bounds) - */ - get(index: usize): usize; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XReorderedIndexMap.js b/third_party/rust/icu_capi/js/include/ICU4XReorderedIndexMap.js deleted file mode 100644 index 46ad3060c1a9..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XReorderedIndexMap.js +++ /dev/null @@ -1,35 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XReorderedIndexMap_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XReorderedIndexMap_destroy(underlying); -}); - -export class ICU4XReorderedIndexMap { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XReorderedIndexMap_box_destroy_registry.register(this, underlying); - } - } - - as_slice() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(8, 4); - wasm.ICU4XReorderedIndexMap_as_slice(diplomat_receive_buffer, this.underlying); - const [ptr, size] = new Uint32Array(wasm.memory.buffer, diplomat_receive_buffer, 2); - wasm.diplomat_free(diplomat_receive_buffer, 8, 4); - return new Uint32Array(wasm.memory.buffer, ptr, size); - })(); - } - - len() { - return wasm.ICU4XReorderedIndexMap_len(this.underlying); - } - - get(arg_index) { - return wasm.ICU4XReorderedIndexMap_get(this.underlying, arg_index); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XScriptExtensionsSet.d.ts b/third_party/rust/icu_capi/js/include/ICU4XScriptExtensionsSet.d.ts deleted file mode 100644 index dcef951fcb94..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XScriptExtensionsSet.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { u16, usize } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" - -/** - - * An object that represents the Script_Extensions property for a single character - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html Rust documentation for `ScriptExtensionsSet`} for more information. - */ -export class ICU4XScriptExtensionsSet { - - /** - - * Check if the Script_Extensions property of the given code point covers the given script - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.contains Rust documentation for `contains`} for more information. - */ - contains(script: u16): boolean; - - /** - - * Get the number of scripts contained in here - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter Rust documentation for `iter`} for more information. - */ - count(): usize; - - /** - - * Get script at index, returning an error if out of bounds - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter Rust documentation for `iter`} for more information. - * @throws {@link FFIError} - */ - script_at(index: usize): u16 | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XScriptExtensionsSet.js b/third_party/rust/icu_capi/js/include/ICU4XScriptExtensionsSet.js deleted file mode 100644 index c0a95a662b09..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XScriptExtensionsSet.js +++ /dev/null @@ -1,42 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XScriptExtensionsSet_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XScriptExtensionsSet_destroy(underlying); -}); - -export class ICU4XScriptExtensionsSet { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XScriptExtensionsSet_box_destroy_registry.register(this, underlying); - } - } - - contains(arg_script) { - return wasm.ICU4XScriptExtensionsSet_contains(this.underlying, arg_script); - } - - count() { - return wasm.ICU4XScriptExtensionsSet_count(this.underlying); - } - - script_at(arg_index) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(3, 2); - wasm.ICU4XScriptExtensionsSet_script_at(diplomat_receive_buffer, this.underlying, arg_index); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 2); - if (is_ok) { - const ok_value = (new Uint16Array(wasm.memory.buffer, diplomat_receive_buffer, 1))[0]; - wasm.diplomat_free(diplomat_receive_buffer, 3, 2); - return ok_value; - } else { - const throw_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 3, 2); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensions.d.ts b/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensions.d.ts deleted file mode 100644 index 4b7dbe45f1bb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensions.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { u16, u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { CodePointRangeIterator } from "./CodePointRangeIterator"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XScriptWithExtensionsBorrowed } from "./ICU4XScriptWithExtensionsBorrowed"; - -/** - - * An ICU4X ScriptWithExtensions map object, capable of holding a map of codepoints to scriptextensions values - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html Rust documentation for `ScriptWithExtensions`} for more information. - */ -export class ICU4XScriptWithExtensions { - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/fn.load_script_with_extensions_unstable.html Rust documentation for `load_script_with_extensions_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XScriptWithExtensions | never; - - /** - - * Get the Script property value for a code point - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val Rust documentation for `get_script_val`} for more information. - */ - get_script_val(code_point: u32): u16; - - /** - - * Check if the Script_Extensions property of the given code point covers the given script - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script Rust documentation for `has_script`} for more information. - */ - has_script(code_point: u32, script: u16): boolean; - - /** - - * Borrow this object for a slightly faster variant with more operations - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html#method.as_borrowed Rust documentation for `as_borrowed`} for more information. - */ - as_borrowed(): ICU4XScriptWithExtensionsBorrowed; - - /** - - * Get a list of ranges of code points that contain this script in their Script_Extensions values - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_ranges Rust documentation for `get_script_extensions_ranges`} for more information. - */ - iter_ranges_for_script(script: u16): CodePointRangeIterator; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensions.js b/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensions.js deleted file mode 100644 index fc5be89c8726..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensions.js +++ /dev/null @@ -1,53 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { CodePointRangeIterator } from "./CodePointRangeIterator.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XScriptWithExtensionsBorrowed } from "./ICU4XScriptWithExtensionsBorrowed.js" - -const ICU4XScriptWithExtensions_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XScriptWithExtensions_destroy(underlying); -}); - -export class ICU4XScriptWithExtensions { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XScriptWithExtensions_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XScriptWithExtensions_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XScriptWithExtensions(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - get_script_val(arg_code_point) { - return wasm.ICU4XScriptWithExtensions_get_script_val(this.underlying, arg_code_point); - } - - has_script(arg_code_point, arg_script) { - return wasm.ICU4XScriptWithExtensions_has_script(this.underlying, arg_code_point, arg_script); - } - - as_borrowed() { - return new ICU4XScriptWithExtensionsBorrowed(wasm.ICU4XScriptWithExtensions_as_borrowed(this.underlying), true, [this]); - } - - iter_ranges_for_script(arg_script) { - return new CodePointRangeIterator(wasm.ICU4XScriptWithExtensions_iter_ranges_for_script(this.underlying, arg_script), true, [this]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensionsBorrowed.d.ts b/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensionsBorrowed.d.ts deleted file mode 100644 index 81d6f132f8c1..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensionsBorrowed.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { u16, u32 } from "./diplomat-runtime" -import { ICU4XScriptExtensionsSet } from "./ICU4XScriptExtensionsSet"; - -/** - - * A slightly faster ICU4XScriptWithExtensions object - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html Rust documentation for `ScriptWithExtensionsBorrowed`} for more information. - */ -export class ICU4XScriptWithExtensionsBorrowed { - - /** - - * Get the Script property value for a code point - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val Rust documentation for `get_script_val`} for more information. - */ - get_script_val(code_point: u32): u16; - - /** - - * Get the Script property value for a code point - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_val Rust documentation for `get_script_extensions_val`} for more information. - */ - get_script_extensions_val(code_point: u32): ICU4XScriptExtensionsSet; - - /** - - * Check if the Script_Extensions property of the given code point covers the given script - - * See the {@link https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script Rust documentation for `has_script`} for more information. - */ - has_script(code_point: u32, script: u16): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensionsBorrowed.js b/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensionsBorrowed.js deleted file mode 100644 index 235d387d8a4b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XScriptWithExtensionsBorrowed.js +++ /dev/null @@ -1,30 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XScriptExtensionsSet } from "./ICU4XScriptExtensionsSet.js" - -const ICU4XScriptWithExtensionsBorrowed_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XScriptWithExtensionsBorrowed_destroy(underlying); -}); - -export class ICU4XScriptWithExtensionsBorrowed { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XScriptWithExtensionsBorrowed_box_destroy_registry.register(this, underlying); - } - } - - get_script_val(arg_code_point) { - return wasm.ICU4XScriptWithExtensionsBorrowed_get_script_val(this.underlying, arg_code_point); - } - - get_script_extensions_val(arg_code_point) { - return new ICU4XScriptExtensionsSet(wasm.ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(this.underlying, arg_code_point), true, [this]); - } - - has_script(arg_code_point, arg_script) { - return wasm.ICU4XScriptWithExtensionsBorrowed_has_script(this.underlying, arg_code_point, arg_script); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSegmenterWordType.d.ts b/third_party/rust/icu_capi/js/include/ICU4XSegmenterWordType.d.ts deleted file mode 100644 index 35eae4becf08..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSegmenterWordType.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/enum.WordType.html Rust documentation for `WordType`} for more information. - */ -export enum ICU4XSegmenterWordType { - /** - */ - None = 'None', - /** - */ - Number = 'Number', - /** - */ - Letter = 'Letter', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XSegmenterWordType.js b/third_party/rust/icu_capi/js/include/ICU4XSegmenterWordType.js deleted file mode 100644 index 390fdb45ca42..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSegmenterWordType.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XSegmenterWordType_js_to_rust = { - "None": 0, - "Number": 1, - "Letter": 2, -}; - -export const ICU4XSegmenterWordType_rust_to_js = { - [0]: "None", - [1]: "Number", - [2]: "Letter", -}; - -export const ICU4XSegmenterWordType = { - "None": "None", - "Number": "Number", - "Letter": "Letter", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorLatin1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorLatin1.d.ts deleted file mode 100644 index 1601ae83ba05..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorLatin1.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html Rust documentation for `SentenceBreakIterator`} for more information. - */ -export class ICU4XSentenceBreakIteratorLatin1 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorLatin1.js b/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorLatin1.js deleted file mode 100644 index 674e015a7d06..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorLatin1.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XSentenceBreakIteratorLatin1_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XSentenceBreakIteratorLatin1_destroy(underlying); -}); - -export class ICU4XSentenceBreakIteratorLatin1 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XSentenceBreakIteratorLatin1_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XSentenceBreakIteratorLatin1_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf16.d.ts b/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf16.d.ts deleted file mode 100644 index 76b4e04d328c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf16.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html Rust documentation for `SentenceBreakIterator`} for more information. - */ -export class ICU4XSentenceBreakIteratorUtf16 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf16.js b/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf16.js deleted file mode 100644 index 8a69b6907ea0..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf16.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XSentenceBreakIteratorUtf16_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XSentenceBreakIteratorUtf16_destroy(underlying); -}); - -export class ICU4XSentenceBreakIteratorUtf16 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XSentenceBreakIteratorUtf16_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XSentenceBreakIteratorUtf16_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf8.d.ts b/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf8.d.ts deleted file mode 100644 index b4080e2112a6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf8.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { i32 } from "./diplomat-runtime" - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html Rust documentation for `SentenceBreakIterator`} for more information. - */ -export class ICU4XSentenceBreakIteratorUtf8 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf8.js b/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf8.js deleted file mode 100644 index cd140f513bc6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceBreakIteratorUtf8.js +++ /dev/null @@ -1,21 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -const ICU4XSentenceBreakIteratorUtf8_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XSentenceBreakIteratorUtf8_destroy(underlying); -}); - -export class ICU4XSentenceBreakIteratorUtf8 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XSentenceBreakIteratorUtf8_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XSentenceBreakIteratorUtf8_next(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceSegmenter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XSentenceSegmenter.d.ts deleted file mode 100644 index fb513c90e8c9..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceSegmenter.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XSentenceBreakIteratorLatin1 } from "./ICU4XSentenceBreakIteratorLatin1"; -import { ICU4XSentenceBreakIteratorUtf16 } from "./ICU4XSentenceBreakIteratorUtf16"; -import { ICU4XSentenceBreakIteratorUtf8 } from "./ICU4XSentenceBreakIteratorUtf8"; - -/** - - * An ICU4X sentence-break segmenter, capable of finding sentence breakpoints in strings. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html Rust documentation for `SentenceSegmenter`} for more information. - */ -export class ICU4XSentenceSegmenter { - - /** - - * Construct an {@link ICU4XSentenceSegmenter `ICU4XSentenceSegmenter`}. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider): ICU4XSentenceSegmenter | never; - - /** - - * Segments a (potentially ill-formed) UTF-8 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_utf8 Rust documentation for `segment_utf8`} for more information. - */ - segment_utf8(input: string): ICU4XSentenceBreakIteratorUtf8; - - /** - - * Segments a UTF-16 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_utf16 Rust documentation for `segment_utf16`} for more information. - */ - segment_utf16(input: Uint16Array): ICU4XSentenceBreakIteratorUtf16; - - /** - - * Segments a Latin-1 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.SentenceSegmenter.html#method.segment_latin1 Rust documentation for `segment_latin1`} for more information. - */ - segment_latin1(input: Uint8Array): ICU4XSentenceBreakIteratorLatin1; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XSentenceSegmenter.js b/third_party/rust/icu_capi/js/include/ICU4XSentenceSegmenter.js deleted file mode 100644 index de617070a29f..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XSentenceSegmenter.js +++ /dev/null @@ -1,53 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XSentenceBreakIteratorLatin1 } from "./ICU4XSentenceBreakIteratorLatin1.js" -import { ICU4XSentenceBreakIteratorUtf16 } from "./ICU4XSentenceBreakIteratorUtf16.js" -import { ICU4XSentenceBreakIteratorUtf8 } from "./ICU4XSentenceBreakIteratorUtf8.js" - -const ICU4XSentenceSegmenter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XSentenceSegmenter_destroy(underlying); -}); - -export class ICU4XSentenceSegmenter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XSentenceSegmenter_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XSentenceSegmenter_create(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XSentenceSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - segment_utf8(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.str(wasm, arg_input); - return new ICU4XSentenceBreakIteratorUtf8(wasm.ICU4XSentenceSegmenter_segment_utf8(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_utf16(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 2); - return new ICU4XSentenceBreakIteratorUtf16(wasm.ICU4XSentenceSegmenter_segment_utf16(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_latin1(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 1); - return new ICU4XSentenceBreakIteratorLatin1(wasm.ICU4XSentenceSegmenter_segment_latin1(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTime.d.ts b/third_party/rust/icu_capi/js/include/ICU4XTime.d.ts deleted file mode 100644 index 1578d6c65aba..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTime.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { u8, u32 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XError } from "./ICU4XError"; - -/** - - * An ICU4X Time object representing a time in terms of hour, minute, second, nanosecond - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html Rust documentation for `Time`} for more information. - */ -export class ICU4XTime { - - /** - - * Creates a new {@link ICU4XTime `ICU4XTime`} given field values - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html Rust documentation for `Time`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(hour: u8, minute: u8, second: u8, nanosecond: u32): ICU4XTime | never; - - /** - - * Returns the hour in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour Rust documentation for `hour`} for more information. - */ - hour(): u8; - - /** - - * Returns the minute in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute Rust documentation for `minute`} for more information. - */ - minute(): u8; - - /** - - * Returns the second in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second Rust documentation for `second`} for more information. - */ - second(): u8; - - /** - - * Returns the nanosecond in this time - - * See the {@link https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond Rust documentation for `nanosecond`} for more information. - */ - nanosecond(): u32; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTime.js b/third_party/rust/icu_capi/js/include/ICU4XTime.js deleted file mode 100644 index 9f9de19ab58c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTime.js +++ /dev/null @@ -1,51 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XTime_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XTime_destroy(underlying); -}); - -export class ICU4XTime { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XTime_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_hour, arg_minute, arg_second, arg_nanosecond) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTime_create(diplomat_receive_buffer, arg_hour, arg_minute, arg_second, arg_nanosecond); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XTime(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - hour() { - return wasm.ICU4XTime_hour(this.underlying); - } - - minute() { - return wasm.ICU4XTime_minute(this.underlying); - } - - second() { - return wasm.ICU4XTime_second(this.underlying); - } - - nanosecond() { - return wasm.ICU4XTime_nanosecond(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTimeFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XTimeFormatter.d.ts deleted file mode 100644 index 03f172fafc70..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTimeFormatter.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDateTime } from "./ICU4XDateTime"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTime } from "./ICU4XTime"; -import { ICU4XTimeLength } from "./ICU4XTimeLength"; - -/** - - * An ICU4X TimeFormatter object capable of formatting an {@link ICU4XTime `ICU4XTime`} type (and others) as a string - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html Rust documentation for `TimeFormatter`} for more information. - */ -export class ICU4XTimeFormatter { - - /** - - * Creates a new {@link ICU4XTimeFormatter `ICU4XTimeFormatter`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.try_new_with_length_unstable Rust documentation for `try_new_with_length_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_length(provider: ICU4XDataProvider, locale: ICU4XLocale, length: ICU4XTimeLength): ICU4XTimeFormatter | never; - - /** - - * Formats a {@link ICU4XTime `ICU4XTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_time(value: ICU4XTime): string | never; - - /** - - * Formats a {@link ICU4XDateTime `ICU4XDateTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_datetime(value: ICU4XDateTime): string | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime(value: ICU4XIsoDateTime): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTimeFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XTimeFormatter.js deleted file mode 100644 index 9b7fb7e1a886..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTimeFormatter.js +++ /dev/null @@ -1,93 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XTimeLength_js_to_rust, ICU4XTimeLength_rust_to_js } from "./ICU4XTimeLength.js" - -const ICU4XTimeFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XTimeFormatter_destroy(underlying); -}); - -export class ICU4XTimeFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XTimeFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_length(arg_provider, arg_locale, arg_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeFormatter_create_with_length(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XTimeLength_js_to_rust[arg_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_time(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeFormatter_format_time(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeFormatter_format_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_iso_datetime(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeFormatter_format_iso_datetime(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTimeLength.d.ts b/third_party/rust/icu_capi/js/include/ICU4XTimeLength.d.ts deleted file mode 100644 index ac90d6175beb..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTimeLength.d.ts +++ /dev/null @@ -1,19 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/datetime/options/length/enum.Time.html Rust documentation for `Time`} for more information. - */ -export enum ICU4XTimeLength { - /** - */ - Full = 'Full', - /** - */ - Long = 'Long', - /** - */ - Medium = 'Medium', - /** - */ - Short = 'Short', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XTimeLength.js b/third_party/rust/icu_capi/js/include/ICU4XTimeLength.js deleted file mode 100644 index f8a9c7e5f0b1..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTimeLength.js +++ /dev/null @@ -1,23 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XTimeLength_js_to_rust = { - "Full": 0, - "Long": 1, - "Medium": 2, - "Short": 3, -}; - -export const ICU4XTimeLength_rust_to_js = { - [0]: "Full", - [1]: "Long", - [2]: "Medium", - [3]: "Short", -}; - -export const ICU4XTimeLength = { - "Full": "Full", - "Long": "Long", - "Medium": "Medium", - "Short": "Short", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XTimeZoneFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XTimeZoneFormatter.d.ts deleted file mode 100644 index 076c135f0237..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTimeZoneFormatter.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XCustomTimeZone } from "./ICU4XCustomTimeZone"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoTimeZoneOptions } from "./ICU4XIsoTimeZoneOptions"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * An ICU4X TimeZoneFormatter object capable of formatting an {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} type (and others) as a string - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html Rust documentation for `TimeZoneFormatter`} for more information. - */ -export class ICU4XTimeZoneFormatter { - - /** - - * Creates a new {@link ICU4XTimeZoneFormatter `ICU4XTimeZoneFormatter`} from locale data. - - * Uses localized GMT as the fallback format. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_localized_gmt_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XTimeZoneFormatter | never; - - /** - - * Creates a new {@link ICU4XTimeZoneFormatter `ICU4XTimeZoneFormatter`} from locale data. - - * Uses ISO-8601 as the fallback format. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - - * Additional information: {@link https://docs.rs/icu/latest/icu/datetime/time_zone/enum.FallbackFormat.html 1} - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_iso_8601_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale, options: ICU4XIsoTimeZoneOptions): ICU4XTimeZoneFormatter | never; - - /** - - * Loads generic non-location long format. Example: "Pacific Time" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_generic_non_location_long Rust documentation for `load_generic_non_location_long`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_generic_non_location_long(provider: ICU4XDataProvider): void | never; - - /** - - * Loads generic non-location short format. Example: "PT" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_generic_non_location_short Rust documentation for `load_generic_non_location_short`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_generic_non_location_short(provider: ICU4XDataProvider): void | never; - - /** - - * Loads specific non-location long format. Example: "Pacific Standard Time" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_specific_non_location_long Rust documentation for `load_specific_non_location_long`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_specific_non_location_long(provider: ICU4XDataProvider): void | never; - - /** - - * Loads specific non-location short format. Example: "PST" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_specific_non_location_short Rust documentation for `load_specific_non_location_short`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_specific_non_location_short(provider: ICU4XDataProvider): void | never; - - /** - - * Loads generic location format. Example: "Los Angeles Time" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_generic_location_format Rust documentation for `load_generic_location_format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_generic_location_format(provider: ICU4XDataProvider): void | never; - - /** - - * Loads localized GMT format. Example: "GMT-07:00" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_localized_gmt_format Rust documentation for `load_localized_gmt_format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_localized_gmt_format(): void | never; - - /** - - * Loads ISO-8601 format. Example: "-07:00" - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.load_iso_8601_format Rust documentation for `load_iso_8601_format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - load_iso_8601_format(options: ICU4XIsoTimeZoneOptions): void | never; - - /** - - * Formats a {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format Rust documentation for `format`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format_to_string Rust documentation for `format_to_string`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_custom_time_zone(value: ICU4XCustomTimeZone): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTimeZoneFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XTimeZoneFormatter.js deleted file mode 100644 index 90bd4288d1d7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTimeZoneFormatter.js +++ /dev/null @@ -1,199 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoTimeZoneFormat_js_to_rust, ICU4XIsoTimeZoneFormat_rust_to_js } from "./ICU4XIsoTimeZoneFormat.js" -import { ICU4XIsoTimeZoneMinuteDisplay_js_to_rust, ICU4XIsoTimeZoneMinuteDisplay_rust_to_js } from "./ICU4XIsoTimeZoneMinuteDisplay.js" -import { ICU4XIsoTimeZoneSecondDisplay_js_to_rust, ICU4XIsoTimeZoneSecondDisplay_rust_to_js } from "./ICU4XIsoTimeZoneSecondDisplay.js" - -const ICU4XTimeZoneFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XTimeZoneFormatter_destroy(underlying); -}); - -export class ICU4XTimeZoneFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XTimeZoneFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_localized_gmt_fallback(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XTimeZoneFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_with_iso_8601_fallback(arg_provider, arg_locale, arg_options) { - const field_format_arg_options = arg_options["format"]; - const field_minutes_arg_options = arg_options["minutes"]; - const field_seconds_arg_options = arg_options["seconds"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XIsoTimeZoneFormat_js_to_rust[field_format_arg_options], ICU4XIsoTimeZoneMinuteDisplay_js_to_rust[field_minutes_arg_options], ICU4XIsoTimeZoneSecondDisplay_js_to_rust[field_seconds_arg_options]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XTimeZoneFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_generic_non_location_long(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_generic_non_location_long(diplomat_receive_buffer, this.underlying, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_generic_non_location_short(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_generic_non_location_short(diplomat_receive_buffer, this.underlying, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_specific_non_location_long(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_specific_non_location_long(diplomat_receive_buffer, this.underlying, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_specific_non_location_short(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_specific_non_location_short(diplomat_receive_buffer, this.underlying, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_generic_location_format(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_generic_location_format(diplomat_receive_buffer, this.underlying, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_localized_gmt_format() { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_localized_gmt_format(diplomat_receive_buffer, this.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - load_iso_8601_format(arg_options) { - const field_format_arg_options = arg_options["format"]; - const field_minutes_arg_options = arg_options["minutes"]; - const field_seconds_arg_options = arg_options["seconds"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_load_iso_8601_format(diplomat_receive_buffer, this.underlying, ICU4XIsoTimeZoneFormat_js_to_rust[field_format_arg_options], ICU4XIsoTimeZoneMinuteDisplay_js_to_rust[field_minutes_arg_options], ICU4XIsoTimeZoneSecondDisplay_js_to_rust[field_seconds_arg_options]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_custom_time_zone(arg_value) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XTimeZoneFormatter_format_custom_time_zone(diplomat_receive_buffer, this.underlying, arg_value.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XTransformResult.d.ts b/third_party/rust/icu_capi/js/include/ICU4XTransformResult.d.ts deleted file mode 100644 index e741659ea926..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTransformResult.d.ts +++ /dev/null @@ -1,15 +0,0 @@ - -/** - - * FFI version of `TransformResult`. - - * See the {@link https://docs.rs/icu/latest/icu/locid_transform/enum.TransformResult.html Rust documentation for `TransformResult`} for more information. - */ -export enum ICU4XTransformResult { - /** - */ - Modified = 'Modified', - /** - */ - Unmodified = 'Unmodified', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XTransformResult.js b/third_party/rust/icu_capi/js/include/ICU4XTransformResult.js deleted file mode 100644 index db68a34f0fe5..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XTransformResult.js +++ /dev/null @@ -1,17 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XTransformResult_js_to_rust = { - "Modified": 0, - "Unmodified": 1, -}; - -export const ICU4XTransformResult_rust_to_js = { - [0]: "Modified", - [1]: "Unmodified", -}; - -export const ICU4XTransformResult = { - "Modified": "Modified", - "Unmodified": "Unmodified", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XUnicodeSetData.d.ts b/third_party/rust/icu_capi/js/include/ICU4XUnicodeSetData.d.ts deleted file mode 100644 index b1fb3dfd6c8c..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XUnicodeSetData.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { u32, char } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * An ICU4X Unicode Set Property object, capable of querying whether a code point is contained in a set based on a Unicode property. - - * See the {@link https://docs.rs/icu/latest/icu/properties/index.html Rust documentation for `properties`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetData.html Rust documentation for `UnicodeSetData`} for more information. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html Rust documentation for `UnicodeSetDataBorrowed`} for more information. - */ -export class ICU4XUnicodeSetData { - - /** - - * Checks whether the string is in the set. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains Rust documentation for `contains`} for more information. - */ - contains(s: string): boolean; - - /** - - * Checks whether the code point is in the set. - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains_char Rust documentation for `contains_char`} for more information. - */ - contains_char(cp: char): boolean; - - /** - - * Checks whether the code point (specified as a 32 bit integer, in UTF-32) is in the set. - */ - contains32(cp: u32): boolean; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/sets/fn.load_basic_emoji.html Rust documentation for `load_basic_emoji`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_basic_emoji(provider: ICU4XDataProvider): ICU4XUnicodeSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_main.html Rust documentation for `load_exemplars_main`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_exemplars_main(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XUnicodeSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_auxiliary.html Rust documentation for `load_exemplars_auxiliary`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_exemplars_auxiliary(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XUnicodeSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_punctuation.html Rust documentation for `load_exemplars_punctuation`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_exemplars_punctuation(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XUnicodeSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_numbers.html Rust documentation for `load_exemplars_numbers`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_exemplars_numbers(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XUnicodeSetData | never; - - /** - - * See the {@link https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.load_exemplars_index.html Rust documentation for `load_exemplars_index`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static load_exemplars_index(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XUnicodeSetData | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XUnicodeSetData.js b/third_party/rust/icu_capi/js/include/ICU4XUnicodeSetData.js deleted file mode 100644 index b345a101237e..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XUnicodeSetData.js +++ /dev/null @@ -1,135 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" - -const ICU4XUnicodeSetData_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XUnicodeSetData_destroy(underlying); -}); - -export class ICU4XUnicodeSetData { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XUnicodeSetData_box_destroy_registry.register(this, underlying); - } - } - - contains(arg_s) { - const buf_arg_s = diplomatRuntime.DiplomatBuf.str(wasm, arg_s); - const diplomat_out = wasm.ICU4XUnicodeSetData_contains(this.underlying, buf_arg_s.ptr, buf_arg_s.size); - buf_arg_s.free(); - return diplomat_out; - } - - contains_char(arg_cp) { - return wasm.ICU4XUnicodeSetData_contains_char(this.underlying, diplomatRuntime.extractCodePoint(arg_cp, 'arg_cp')); - } - - contains32(arg_cp) { - return wasm.ICU4XUnicodeSetData_contains32(this.underlying, arg_cp); - } - - static load_basic_emoji(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XUnicodeSetData_load_basic_emoji(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XUnicodeSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_exemplars_main(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XUnicodeSetData_load_exemplars_main(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XUnicodeSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_exemplars_auxiliary(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XUnicodeSetData_load_exemplars_auxiliary(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XUnicodeSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_exemplars_punctuation(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XUnicodeSetData_load_exemplars_punctuation(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XUnicodeSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_exemplars_numbers(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XUnicodeSetData_load_exemplars_numbers(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XUnicodeSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static load_exemplars_index(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XUnicodeSetData_load_exemplars_index(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XUnicodeSetData(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWeekCalculator.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWeekCalculator.d.ts deleted file mode 100644 index bf69f94d056d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWeekCalculator.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { u8 } from "./diplomat-runtime" -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoWeekday } from "./ICU4XIsoWeekday"; -import { ICU4XLocale } from "./ICU4XLocale"; - -/** - - * A Week calculator, useful to be passed in to `week_of_year()` on Date and DateTime types - - * See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html Rust documentation for `WeekCalculator`} for more information. - */ -export class ICU4XWeekCalculator { - - /** - - * Creates a new {@link ICU4XWeekCalculator `ICU4XWeekCalculator`} from locale data. - - * See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XWeekCalculator | never; - - /** - - * Additional information: {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday 1}, {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days 2} - */ - static create_from_first_day_of_week_and_min_week_days(first_weekday: ICU4XIsoWeekday, min_week_days: u8): ICU4XWeekCalculator; - - /** - - * Returns the weekday that starts the week for this object's locale - - * See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday Rust documentation for `first_weekday`} for more information. - */ - first_weekday(): ICU4XIsoWeekday; - - /** - - * The minimum number of days overlapping a year required for a week to be considered part of that year - - * See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days Rust documentation for `min_week_days`} for more information. - */ - min_week_days(): u8; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWeekCalculator.js b/third_party/rust/icu_capi/js/include/ICU4XWeekCalculator.js deleted file mode 100644 index 7b3110538de2..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWeekCalculator.js +++ /dev/null @@ -1,48 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoWeekday_js_to_rust, ICU4XIsoWeekday_rust_to_js } from "./ICU4XIsoWeekday.js" - -const ICU4XWeekCalculator_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XWeekCalculator_destroy(underlying); -}); - -export class ICU4XWeekCalculator { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XWeekCalculator_box_destroy_registry.register(this, underlying); - } - } - - static create(arg_provider, arg_locale) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XWeekCalculator_create(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XWeekCalculator(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_from_first_day_of_week_and_min_week_days(arg_first_weekday, arg_min_week_days) { - return new ICU4XWeekCalculator(wasm.ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(ICU4XIsoWeekday_js_to_rust[arg_first_weekday], arg_min_week_days), true, []); - } - - first_weekday() { - return ICU4XIsoWeekday_rust_to_js[wasm.ICU4XWeekCalculator_first_weekday(this.underlying)]; - } - - min_week_days() { - return wasm.ICU4XWeekCalculator_min_week_days(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWeekOf.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWeekOf.d.ts deleted file mode 100644 index dfcf1eb97fbc..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWeekOf.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { u16 } from "./diplomat-runtime" -import { ICU4XWeekRelativeUnit } from "./ICU4XWeekRelativeUnit"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/calendar/week/struct.WeekOf.html Rust documentation for `WeekOf`} for more information. - */ -export class ICU4XWeekOf { - week: u16; - unit: ICU4XWeekRelativeUnit; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWeekOf.js b/third_party/rust/icu_capi/js/include/ICU4XWeekOf.js deleted file mode 100644 index 5f74b5d1a5ab..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWeekOf.js +++ /dev/null @@ -1,10 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XWeekRelativeUnit_js_to_rust, ICU4XWeekRelativeUnit_rust_to_js } from "./ICU4XWeekRelativeUnit.js" - -export class ICU4XWeekOf { - constructor(underlying) { - this.week = (new Uint16Array(wasm.memory.buffer, underlying, 1))[0]; - this.unit = ICU4XWeekRelativeUnit_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 4)]; - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWeekRelativeUnit.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWeekRelativeUnit.d.ts deleted file mode 100644 index 60a12eddb5f6..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWeekRelativeUnit.d.ts +++ /dev/null @@ -1,16 +0,0 @@ - -/** - - * See the {@link https://docs.rs/icu/latest/icu/calendar/week/enum.RelativeUnit.html Rust documentation for `RelativeUnit`} for more information. - */ -export enum ICU4XWeekRelativeUnit { - /** - */ - Previous = 'Previous', - /** - */ - Current = 'Current', - /** - */ - Next = 'Next', -} \ No newline at end of file diff --git a/third_party/rust/icu_capi/js/include/ICU4XWeekRelativeUnit.js b/third_party/rust/icu_capi/js/include/ICU4XWeekRelativeUnit.js deleted file mode 100644 index 685a296b2087..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWeekRelativeUnit.js +++ /dev/null @@ -1,20 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" - -export const ICU4XWeekRelativeUnit_js_to_rust = { - "Previous": 0, - "Current": 1, - "Next": 2, -}; - -export const ICU4XWeekRelativeUnit_rust_to_js = { - [0]: "Previous", - [1]: "Current", - [2]: "Next", -}; - -export const ICU4XWeekRelativeUnit = { - "Previous": "Previous", - "Current": "Current", - "Next": "Next", -}; diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorLatin1.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorLatin1.d.ts deleted file mode 100644 index 3bd6da522491..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorLatin1.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { i32 } from "./diplomat-runtime" -import { ICU4XSegmenterWordType } from "./ICU4XSegmenterWordType"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html Rust documentation for `WordBreakIterator`} for more information. - */ -export class ICU4XWordBreakIteratorLatin1 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; - - /** - - * Return the status value of break boundary. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type Rust documentation for `word_type`} for more information. - */ - word_type(): ICU4XSegmenterWordType; - - /** - - * Return true when break boundary is word-like such as letter/number/CJK - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like Rust documentation for `is_word_like`} for more information. - */ - is_word_like(): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorLatin1.js b/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorLatin1.js deleted file mode 100644 index bdeac9ae7167..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorLatin1.js +++ /dev/null @@ -1,30 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XSegmenterWordType_js_to_rust, ICU4XSegmenterWordType_rust_to_js } from "./ICU4XSegmenterWordType.js" - -const ICU4XWordBreakIteratorLatin1_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XWordBreakIteratorLatin1_destroy(underlying); -}); - -export class ICU4XWordBreakIteratorLatin1 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XWordBreakIteratorLatin1_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XWordBreakIteratorLatin1_next(this.underlying); - } - - word_type() { - return ICU4XSegmenterWordType_rust_to_js[wasm.ICU4XWordBreakIteratorLatin1_word_type(this.underlying)]; - } - - is_word_like() { - return wasm.ICU4XWordBreakIteratorLatin1_is_word_like(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf16.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf16.d.ts deleted file mode 100644 index d0f67acd2df7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf16.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { i32 } from "./diplomat-runtime" -import { ICU4XSegmenterWordType } from "./ICU4XSegmenterWordType"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html Rust documentation for `WordBreakIterator`} for more information. - */ -export class ICU4XWordBreakIteratorUtf16 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; - - /** - - * Return the status value of break boundary. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type Rust documentation for `word_type`} for more information. - */ - word_type(): ICU4XSegmenterWordType; - - /** - - * Return true when break boundary is word-like such as letter/number/CJK - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like Rust documentation for `is_word_like`} for more information. - */ - is_word_like(): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf16.js b/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf16.js deleted file mode 100644 index 7dd16d4ef07b..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf16.js +++ /dev/null @@ -1,30 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XSegmenterWordType_js_to_rust, ICU4XSegmenterWordType_rust_to_js } from "./ICU4XSegmenterWordType.js" - -const ICU4XWordBreakIteratorUtf16_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XWordBreakIteratorUtf16_destroy(underlying); -}); - -export class ICU4XWordBreakIteratorUtf16 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XWordBreakIteratorUtf16_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XWordBreakIteratorUtf16_next(this.underlying); - } - - word_type() { - return ICU4XSegmenterWordType_rust_to_js[wasm.ICU4XWordBreakIteratorUtf16_word_type(this.underlying)]; - } - - is_word_like() { - return wasm.ICU4XWordBreakIteratorUtf16_is_word_like(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf8.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf8.d.ts deleted file mode 100644 index 1a74af6d889d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf8.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { i32 } from "./diplomat-runtime" -import { ICU4XSegmenterWordType } from "./ICU4XSegmenterWordType"; - -/** - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html Rust documentation for `WordBreakIterator`} for more information. - */ -export class ICU4XWordBreakIteratorUtf8 { - - /** - - * Finds the next breakpoint. Returns -1 if at the end of the string or if the index is out of range of a 32-bit signed integer. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.next Rust documentation for `next`} for more information. - */ - next(): i32; - - /** - - * Return the status value of break boundary. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type Rust documentation for `word_type`} for more information. - */ - word_type(): ICU4XSegmenterWordType; - - /** - - * Return true when break boundary is word-like such as letter/number/CJK - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like Rust documentation for `is_word_like`} for more information. - */ - is_word_like(): boolean; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf8.js b/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf8.js deleted file mode 100644 index f4517683d205..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordBreakIteratorUtf8.js +++ /dev/null @@ -1,30 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XSegmenterWordType_js_to_rust, ICU4XSegmenterWordType_rust_to_js } from "./ICU4XSegmenterWordType.js" - -const ICU4XWordBreakIteratorUtf8_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XWordBreakIteratorUtf8_destroy(underlying); -}); - -export class ICU4XWordBreakIteratorUtf8 { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XWordBreakIteratorUtf8_box_destroy_registry.register(this, underlying); - } - } - - next() { - return wasm.ICU4XWordBreakIteratorUtf8_next(this.underlying); - } - - word_type() { - return ICU4XSegmenterWordType_rust_to_js[wasm.ICU4XWordBreakIteratorUtf8_word_type(this.underlying)]; - } - - is_word_like() { - return wasm.ICU4XWordBreakIteratorUtf8_is_word_like(this.underlying); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordSegmenter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XWordSegmenter.d.ts deleted file mode 100644 index 4c63e2df1732..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordSegmenter.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XWordBreakIteratorLatin1 } from "./ICU4XWordBreakIteratorLatin1"; -import { ICU4XWordBreakIteratorUtf16 } from "./ICU4XWordBreakIteratorUtf16"; -import { ICU4XWordBreakIteratorUtf8 } from "./ICU4XWordBreakIteratorUtf8"; - -/** - - * An ICU4X word-break segmenter, capable of finding word breakpoints in strings. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html Rust documentation for `WordSegmenter`} for more information. - */ -export class ICU4XWordSegmenter { - - /** - - * Construct an {@link ICU4XWordSegmenter `ICU4XWordSegmenter`} with automatically selecting the best available LSTM or dictionary payload data. - - * Note: currently, it uses dictionary for Chinese and Japanese, and LSTM for Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.try_new_auto_unstable Rust documentation for `try_new_auto_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_auto(provider: ICU4XDataProvider): ICU4XWordSegmenter | never; - - /** - - * Construct an {@link ICU4XWordSegmenter `ICU4XWordSegmenter`} with LSTM payload data for Burmese, Khmer, Lao, and Thai. - - * Warning: {@link ICU4XWordSegmenter `ICU4XWordSegmenter`} created by this function doesn't handle Chinese or Japanese. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.try_new_lstm_unstable Rust documentation for `try_new_lstm_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_lstm(provider: ICU4XDataProvider): ICU4XWordSegmenter | never; - - /** - - * Construct an {@link ICU4XWordSegmenter `ICU4XWordSegmenter`} with dictionary payload data for Chinese, Japanese, Burmese, Khmer, Lao, and Thai. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.try_new_dictionary_unstable Rust documentation for `try_new_dictionary_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_dictionary(provider: ICU4XDataProvider): ICU4XWordSegmenter | never; - - /** - - * Segments a (potentially ill-formed) UTF-8 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_utf8 Rust documentation for `segment_utf8`} for more information. - */ - segment_utf8(input: string): ICU4XWordBreakIteratorUtf8; - - /** - - * Segments a UTF-16 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_utf16 Rust documentation for `segment_utf16`} for more information. - */ - segment_utf16(input: Uint16Array): ICU4XWordBreakIteratorUtf16; - - /** - - * Segments a Latin-1 string. - - * See the {@link https://docs.rs/icu/latest/icu/segmenter/struct.WordSegmenter.html#method.segment_latin1 Rust documentation for `segment_latin1`} for more information. - */ - segment_latin1(input: Uint8Array): ICU4XWordBreakIteratorLatin1; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XWordSegmenter.js b/third_party/rust/icu_capi/js/include/ICU4XWordSegmenter.js deleted file mode 100644 index f1a1b263ee38..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XWordSegmenter.js +++ /dev/null @@ -1,87 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XWordBreakIteratorLatin1 } from "./ICU4XWordBreakIteratorLatin1.js" -import { ICU4XWordBreakIteratorUtf16 } from "./ICU4XWordBreakIteratorUtf16.js" -import { ICU4XWordBreakIteratorUtf8 } from "./ICU4XWordBreakIteratorUtf8.js" - -const ICU4XWordSegmenter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XWordSegmenter_destroy(underlying); -}); - -export class ICU4XWordSegmenter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XWordSegmenter_box_destroy_registry.register(this, underlying); - } - } - - static create_auto(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XWordSegmenter_create_auto(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XWordSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_lstm(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XWordSegmenter_create_lstm(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XWordSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_dictionary(arg_provider) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XWordSegmenter_create_dictionary(diplomat_receive_buffer, arg_provider.underlying); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XWordSegmenter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - segment_utf8(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.str(wasm, arg_input); - return new ICU4XWordBreakIteratorUtf8(wasm.ICU4XWordSegmenter_segment_utf8(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_utf16(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 2); - return new ICU4XWordBreakIteratorUtf16(wasm.ICU4XWordSegmenter_segment_utf16(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } - - segment_latin1(arg_input) { - const buf_arg_input = diplomatRuntime.DiplomatBuf.slice(wasm, arg_input, 1); - return new ICU4XWordBreakIteratorLatin1(wasm.ICU4XWordSegmenter_segment_latin1(this.underlying, buf_arg_input.ptr, buf_arg_input.size), true, [this, buf_arg_input]); - } -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XZonedDateTimeFormatter.d.ts b/third_party/rust/icu_capi/js/include/ICU4XZonedDateTimeFormatter.d.ts deleted file mode 100644 index f9c8fab16cb7..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XZonedDateTimeFormatter.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { FFIError } from "./diplomat-runtime" -import { ICU4XCustomTimeZone } from "./ICU4XCustomTimeZone"; -import { ICU4XDataProvider } from "./ICU4XDataProvider"; -import { ICU4XDateLength } from "./ICU4XDateLength"; -import { ICU4XDateTime } from "./ICU4XDateTime"; -import { ICU4XError } from "./ICU4XError"; -import { ICU4XIsoDateTime } from "./ICU4XIsoDateTime"; -import { ICU4XIsoTimeZoneOptions } from "./ICU4XIsoTimeZoneOptions"; -import { ICU4XLocale } from "./ICU4XLocale"; -import { ICU4XTimeLength } from "./ICU4XTimeLength"; - -/** - - * An object capable of formatting a date time with time zone to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html Rust documentation for `ZonedDateTimeFormatter`} for more information. - */ -export class ICU4XZonedDateTimeFormatter { - - /** - - * Creates a new {@link ICU4XZonedDateTimeFormatter `ICU4XZonedDateTimeFormatter`} from locale data. - - * This function has `date_length` and `time_length` arguments and uses default options for the time zone. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_lengths(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength): ICU4XZonedDateTimeFormatter | never; - - /** - - * Creates a new {@link ICU4XZonedDateTimeFormatter `ICU4XZonedDateTimeFormatter`} from locale data. - - * This function has `date_length` and `time_length` arguments and uses an ISO-8601 style fallback for the time zone with the given configurations. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.try_new_unstable Rust documentation for `try_new_unstable`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - static create_with_lengths_and_iso_8601_time_zone_fallback(provider: ICU4XDataProvider, locale: ICU4XLocale, date_length: ICU4XDateLength, time_length: ICU4XTimeLength, zone_options: ICU4XIsoTimeZoneOptions): ICU4XZonedDateTimeFormatter | never; - - /** - - * Formats a {@link ICU4XDateTime `ICU4XDateTime`} and {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_datetime_with_custom_time_zone(datetime: ICU4XDateTime, time_zone: ICU4XCustomTimeZone): string | never; - - /** - - * Formats a {@link ICU4XIsoDateTime `ICU4XIsoDateTime`} and {@link ICU4XCustomTimeZone `ICU4XCustomTimeZone`} to a string. - - * See the {@link https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format Rust documentation for `format`} for more information. - * @throws {@link FFIError}<{@link ICU4XError}> - */ - format_iso_datetime_with_custom_time_zone(datetime: ICU4XIsoDateTime, time_zone: ICU4XCustomTimeZone): string | never; -} diff --git a/third_party/rust/icu_capi/js/include/ICU4XZonedDateTimeFormatter.js b/third_party/rust/icu_capi/js/include/ICU4XZonedDateTimeFormatter.js deleted file mode 100644 index 3dab1732019d..000000000000 --- a/third_party/rust/icu_capi/js/include/ICU4XZonedDateTimeFormatter.js +++ /dev/null @@ -1,98 +0,0 @@ -import wasm from "./diplomat-wasm.mjs" -import * as diplomatRuntime from "./diplomat-runtime.js" -import { ICU4XDateLength_js_to_rust, ICU4XDateLength_rust_to_js } from "./ICU4XDateLength.js" -import { ICU4XError_js_to_rust, ICU4XError_rust_to_js } from "./ICU4XError.js" -import { ICU4XIsoTimeZoneFormat_js_to_rust, ICU4XIsoTimeZoneFormat_rust_to_js } from "./ICU4XIsoTimeZoneFormat.js" -import { ICU4XIsoTimeZoneMinuteDisplay_js_to_rust, ICU4XIsoTimeZoneMinuteDisplay_rust_to_js } from "./ICU4XIsoTimeZoneMinuteDisplay.js" -import { ICU4XIsoTimeZoneSecondDisplay_js_to_rust, ICU4XIsoTimeZoneSecondDisplay_rust_to_js } from "./ICU4XIsoTimeZoneSecondDisplay.js" -import { ICU4XTimeLength_js_to_rust, ICU4XTimeLength_rust_to_js } from "./ICU4XTimeLength.js" - -const ICU4XZonedDateTimeFormatter_box_destroy_registry = new FinalizationRegistry(underlying => { - wasm.ICU4XZonedDateTimeFormatter_destroy(underlying); -}); - -export class ICU4XZonedDateTimeFormatter { - #lifetimeEdges = []; - constructor(underlying, owned, edges) { - this.underlying = underlying; - this.#lifetimeEdges.push(...edges); - if (owned) { - ICU4XZonedDateTimeFormatter_box_destroy_registry.register(this, underlying); - } - } - - static create_with_lengths(arg_provider, arg_locale, arg_date_length, arg_time_length) { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XZonedDateTimeFormatter_create_with_lengths(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length], ICU4XTimeLength_js_to_rust[arg_time_length]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XZonedDateTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - static create_with_lengths_and_iso_8601_time_zone_fallback(arg_provider, arg_locale, arg_date_length, arg_time_length, arg_zone_options) { - const field_format_arg_zone_options = arg_zone_options["format"]; - const field_minutes_arg_zone_options = arg_zone_options["minutes"]; - const field_seconds_arg_zone_options = arg_zone_options["seconds"]; - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(diplomat_receive_buffer, arg_provider.underlying, arg_locale.underlying, ICU4XDateLength_js_to_rust[arg_date_length], ICU4XTimeLength_js_to_rust[arg_time_length], ICU4XIsoTimeZoneFormat_js_to_rust[field_format_arg_zone_options], ICU4XIsoTimeZoneMinuteDisplay_js_to_rust[field_minutes_arg_zone_options], ICU4XIsoTimeZoneSecondDisplay_js_to_rust[field_seconds_arg_zone_options]); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = new ICU4XZonedDateTimeFormatter(diplomatRuntime.ptrRead(wasm, diplomat_receive_buffer), true, []); - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - } - - format_datetime_with_custom_time_zone(arg_datetime, arg_time_zone) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(diplomat_receive_buffer, this.underlying, arg_datetime.underlying, arg_time_zone.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } - - format_iso_datetime_with_custom_time_zone(arg_datetime, arg_time_zone) { - return diplomatRuntime.withWriteable(wasm, (writeable) => { - return (() => { - const diplomat_receive_buffer = wasm.diplomat_alloc(5, 4); - wasm.ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(diplomat_receive_buffer, this.underlying, arg_datetime.underlying, arg_time_zone.underlying, writeable); - const is_ok = diplomatRuntime.resultFlag(wasm, diplomat_receive_buffer, 4); - if (is_ok) { - const ok_value = {}; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - return ok_value; - } else { - const throw_value = ICU4XError_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, diplomat_receive_buffer)]; - wasm.diplomat_free(diplomat_receive_buffer, 5, 4); - throw new diplomatRuntime.FFIError(throw_value); - } - })(); - }); - } -} diff --git a/third_party/rust/icu_capi/js/include/diplomat-runtime.d.ts b/third_party/rust/icu_capi/js/include/diplomat-runtime.d.ts deleted file mode 100644 index 8a8748b6a410..000000000000 --- a/third_party/rust/icu_capi/js/include/diplomat-runtime.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * An error that occurred in Rust. - */ -export class FFIError extends Error { - error_value: E; -} - -export type u8 = number; -export type i8 = number; -export type u16 = number; -export type i16 = number; -export type u32 = number; -export type i32 = number; -export type u64 = bigint; -export type i64 = bigint; -export type usize = number; -export type isize = number; -export type f32 = number; -export type f64 = number; -export type char = string; diff --git a/third_party/rust/icu_capi/js/include/diplomat-runtime.js b/third_party/rust/icu_capi/js/include/diplomat-runtime.js deleted file mode 100644 index 75317d4a7463..000000000000 --- a/third_party/rust/icu_capi/js/include/diplomat-runtime.js +++ /dev/null @@ -1,121 +0,0 @@ -export function readString(wasm, ptr, len) { - const buf = new Uint8Array(wasm.memory.buffer, ptr, len); - return (new TextDecoder("utf-8")).decode(buf) -} - -export function withWriteable(wasm, callback) { - const writeable = wasm.diplomat_buffer_writeable_create(0); - try { - callback(writeable); - const outStringPtr = wasm.diplomat_buffer_writeable_get_bytes(writeable); - const outStringLen = wasm.diplomat_buffer_writeable_len(writeable); - return readString(wasm, outStringPtr, outStringLen); - } finally { - wasm.diplomat_buffer_writeable_destroy(writeable); - } -} - -export class FFIError extends Error { - constructor(error_value) { - super("Error over FFI"); - this.error_value = error_value; // (2) - } -} - -export function extractCodePoint(str, param) { - const cp = str.codePointAt?.(0); - if ((!cp && cp !== 0) || [...str]?.length != 1) { - throw new TypeError(`Expected single-character string for char parameter ${param}, found ${str}`); - } - return cp; -} - -// Get the pointer returned by an FFI function -// -// It's tempting to call `(new Uint32Array(wasm.memory.buffer, FFI_func(), 1))[0]`. -// However, there's a chance that `wasm.memory.buffer` will be resized between -// the time it's accessed and the time it's used, invalidating the view. -// This function ensures that the view into wasm memory is fresh. -// -// This is used for methods that return multiple types into a wasm buffer, where -// one of those types is another ptr. Call this method to get access to the returned -// ptr, so the return buffer can be freed. -export function ptrRead(wasm, ptr) { - return (new Uint32Array(wasm.memory.buffer, ptr, 1))[0]; -} - -// Get the flag of a result type. -export function resultFlag(wasm, ptr, offset) { - return (new Uint8Array(wasm.memory.buffer, ptr + offset, 1))[0]; -} - -// Get the discriminant of a Rust enum. -export function enumDiscriminant(wasm, ptr) { - return (new Int32Array(wasm.memory.buffer, ptr, 1))[0] -} - -// A wrapper around a slice of WASM memory that can be freed manually or -// automatically by the garbage collector. -// -// This type is necessary for Rust functions that take a `&str` or `&[T]`, since -// they can create an edge to this object if they borrow from the str/slice, -// or we can manually free the WASM memory if they don't. -export class DiplomatBuf { - static str = (wasm, string) => { - var utf8_len = 0; - for (const codepoint_string of string) { - let codepoint = codepoint_string.codePointAt(0); - if (codepoint < 0x80) { - utf8_len += 1 - } else if (codepoint < 0x800) { - utf8_len += 2 - } else if (codepoint < 0x10000) { - utf8_len += 3 - } else { - utf8_len += 4 - } - } - return new DiplomatBuf(wasm, utf8_len, 1, buf => { - const result = (new TextEncoder()).encodeInto(string, buf); - console.assert(string.length == result.read && utf8_len == result.written, "UTF-8 write error"); - }) -} - - static slice = (wasm, slice, align) => { - // If the slice is not a Uint8Array, we have to convert to one, as that's the only - // thing we can write into the wasm buffer. - const bytes = slice.constructor.name == "Uint8Array" ? slice : new Uint8Array(slice); - return new DiplomatBuf(wasm, bytes.length, align, buf => buf.set(bytes)); - } - - constructor(wasm, size, align, encodeCallback) { - const ptr = wasm.diplomat_alloc(size, align); - encodeCallback(new Uint8Array(wasm.memory.buffer, ptr, size)); - - this.ptr = ptr; - this.size = size; - this.free = () => { - const successfully_unregistered = DiplomatBuf_finalizer.unregister(this); - if (successfully_unregistered) { - wasm.diplomat_free(this.ptr, this.size, align); - } else { - console.error(`Failed to unregister DiplomatBuf at ${ptr}, this is a bug. Either it was never registered (leak), it was already unregistered (failed attempt to double free), or the unregister token was unrecognized (fallback to GC).`); - } - } - - DiplomatBuf_finalizer.register(this, { wasm, ptr, size, align }, this); - } - - leak = () => { - const successfully_unregistered = DiplomatBuf_finalizer.unregister(this); - if (successfully_unregistered) { - // leak - } else { - console.error(`Failed to unregister DiplomatBuf at ${this.ptr}, this is a bug. Either it was never registered (leak), it was already unregistered (failed attempt to double free), or the unregister token was unrecognized (fallback to GC).`); - } - } -} - -const DiplomatBuf_finalizer = new FinalizationRegistry(({ wasm, ptr, size, align }) => { - wasm.diplomat_free(ptr, size, align); -}); diff --git a/third_party/rust/icu_capi/js/include/diplomat-wasm.mjs b/third_party/rust/icu_capi/js/include/diplomat-wasm.mjs deleted file mode 100644 index 26eb32af4a8a..000000000000 --- a/third_party/rust/icu_capi/js/include/diplomat-wasm.mjs +++ /dev/null @@ -1,35 +0,0 @@ -import cfg from '../diplomat.config.js'; -import {readString} from './diplomat-runtime.js' - -let wasm; - -const imports = { - env: { - log_js(ptr, len) { - console.log(readString(wasm, ptr, len)); - }, - warn_js(ptr, len) { - console.warn(readString(wasm, ptr, len)); - }, - trace_js(ptr, len) { - throw new Error(readString(wasm, ptr, len)); - } - } -} - -if (typeof fetch === 'undefined') { // Node - const fs = await import("fs"); - const wasmFile = new Uint8Array(fs.readFileSync(cfg['wasm_path'])); - const loadedWasm = await WebAssembly.instantiate(wasmFile, imports); - wasm = loadedWasm.instance.exports; -} else { // Browser - const loadedWasm = await WebAssembly.instantiateStreaming(fetch(cfg['wasm_path']), imports); - wasm = loadedWasm.instance.exports; -} - -wasm.diplomat_init(); -if (cfg['init'] !== undefined) { - cfg['init'](wasm); -} - -export default wasm; diff --git a/third_party/rust/icu_capi/js/include/index.d.ts b/third_party/rust/icu_capi/js/include/index.d.ts deleted file mode 100644 index 3515d5fe666e..000000000000 --- a/third_party/rust/icu_capi/js/include/index.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -export { FFIError, i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, char } from './diplomat-runtime.js'; -export { CodePointRangeIterator } from './CodePointRangeIterator.js'; -export { CodePointRangeIteratorResult } from './CodePointRangeIteratorResult.js'; -export { ICU4XAnyCalendarKind } from './ICU4XAnyCalendarKind.js'; -export { ICU4XBidi } from './ICU4XBidi.js'; -export { ICU4XBidiDirection } from './ICU4XBidiDirection.js'; -export { ICU4XBidiInfo } from './ICU4XBidiInfo.js'; -export { ICU4XBidiParagraph } from './ICU4XBidiParagraph.js'; -export { ICU4XCalendar } from './ICU4XCalendar.js'; -export { ICU4XCanonicalCombiningClassMap } from './ICU4XCanonicalCombiningClassMap.js'; -export { ICU4XCanonicalComposition } from './ICU4XCanonicalComposition.js'; -export { ICU4XCanonicalDecomposition } from './ICU4XCanonicalDecomposition.js'; -export { ICU4XCodePointMapData16 } from './ICU4XCodePointMapData16.js'; -export { ICU4XCodePointMapData8 } from './ICU4XCodePointMapData8.js'; -export { ICU4XCodePointSetData } from './ICU4XCodePointSetData.js'; -export { ICU4XCollator } from './ICU4XCollator.js'; -export { ICU4XCollatorAlternateHandling } from './ICU4XCollatorAlternateHandling.js'; -export { ICU4XCollatorBackwardSecondLevel } from './ICU4XCollatorBackwardSecondLevel.js'; -export { ICU4XCollatorCaseFirst } from './ICU4XCollatorCaseFirst.js'; -export { ICU4XCollatorCaseLevel } from './ICU4XCollatorCaseLevel.js'; -export { ICU4XCollatorMaxVariable } from './ICU4XCollatorMaxVariable.js'; -export { ICU4XCollatorNumeric } from './ICU4XCollatorNumeric.js'; -export { ICU4XCollatorOptionsV1 } from './ICU4XCollatorOptionsV1.js'; -export { ICU4XCollatorStrength } from './ICU4XCollatorStrength.js'; -export { ICU4XComposingNormalizer } from './ICU4XComposingNormalizer.js'; -export { ICU4XCustomTimeZone } from './ICU4XCustomTimeZone.js'; -export { ICU4XDataProvider } from './ICU4XDataProvider.js'; -export { ICU4XDataStruct } from './ICU4XDataStruct.js'; -export { ICU4XDate } from './ICU4XDate.js'; -export { ICU4XDateFormatter } from './ICU4XDateFormatter.js'; -export { ICU4XDateLength } from './ICU4XDateLength.js'; -export { ICU4XDateTime } from './ICU4XDateTime.js'; -export { ICU4XDateTimeFormatter } from './ICU4XDateTimeFormatter.js'; -export { ICU4XDecomposed } from './ICU4XDecomposed.js'; -export { ICU4XDecomposingNormalizer } from './ICU4XDecomposingNormalizer.js'; -export { ICU4XDisplayNamesFallback } from './ICU4XDisplayNamesFallback.js'; -export { ICU4XDisplayNamesOptionsV1 } from './ICU4XDisplayNamesOptionsV1.js'; -export { ICU4XDisplayNamesStyle } from './ICU4XDisplayNamesStyle.js'; -export { ICU4XError } from './ICU4XError.js'; -export { ICU4XFixedDecimal } from './ICU4XFixedDecimal.js'; -export { ICU4XFixedDecimalFormatter } from './ICU4XFixedDecimalFormatter.js'; -export { ICU4XFixedDecimalGroupingStrategy } from './ICU4XFixedDecimalGroupingStrategy.js'; -export { ICU4XFixedDecimalSign } from './ICU4XFixedDecimalSign.js'; -export { ICU4XFixedDecimalSignDisplay } from './ICU4XFixedDecimalSignDisplay.js'; -export { ICU4XGeneralCategoryNameToMaskMapper } from './ICU4XGeneralCategoryNameToMaskMapper.js'; -export { ICU4XGraphemeClusterBreakIteratorLatin1 } from './ICU4XGraphemeClusterBreakIteratorLatin1.js'; -export { ICU4XGraphemeClusterBreakIteratorUtf16 } from './ICU4XGraphemeClusterBreakIteratorUtf16.js'; -export { ICU4XGraphemeClusterBreakIteratorUtf8 } from './ICU4XGraphemeClusterBreakIteratorUtf8.js'; -export { ICU4XGraphemeClusterSegmenter } from './ICU4XGraphemeClusterSegmenter.js'; -export { ICU4XGregorianDateFormatter } from './ICU4XGregorianDateFormatter.js'; -export { ICU4XGregorianDateTimeFormatter } from './ICU4XGregorianDateTimeFormatter.js'; -export { ICU4XGregorianZonedDateTimeFormatter } from './ICU4XGregorianZonedDateTimeFormatter.js'; -export { ICU4XIsoDate } from './ICU4XIsoDate.js'; -export { ICU4XIsoDateTime } from './ICU4XIsoDateTime.js'; -export { ICU4XIsoTimeZoneFormat } from './ICU4XIsoTimeZoneFormat.js'; -export { ICU4XIsoTimeZoneMinuteDisplay } from './ICU4XIsoTimeZoneMinuteDisplay.js'; -export { ICU4XIsoTimeZoneOptions } from './ICU4XIsoTimeZoneOptions.js'; -export { ICU4XIsoTimeZoneSecondDisplay } from './ICU4XIsoTimeZoneSecondDisplay.js'; -export { ICU4XIsoWeekday } from './ICU4XIsoWeekday.js'; -export { ICU4XLanguageDisplay } from './ICU4XLanguageDisplay.js'; -export { ICU4XLineBreakIteratorLatin1 } from './ICU4XLineBreakIteratorLatin1.js'; -export { ICU4XLineBreakIteratorUtf16 } from './ICU4XLineBreakIteratorUtf16.js'; -export { ICU4XLineBreakIteratorUtf8 } from './ICU4XLineBreakIteratorUtf8.js'; -export { ICU4XLineBreakOptionsV1 } from './ICU4XLineBreakOptionsV1.js'; -export { ICU4XLineBreakStrictness } from './ICU4XLineBreakStrictness.js'; -export { ICU4XLineBreakWordOption } from './ICU4XLineBreakWordOption.js'; -export { ICU4XLineSegmenter } from './ICU4XLineSegmenter.js'; -export { ICU4XList } from './ICU4XList.js'; -export { ICU4XListFormatter } from './ICU4XListFormatter.js'; -export { ICU4XListLength } from './ICU4XListLength.js'; -export { ICU4XLocale } from './ICU4XLocale.js'; -export { ICU4XLocaleCanonicalizer } from './ICU4XLocaleCanonicalizer.js'; -export { ICU4XLocaleDisplayNamesFormatter } from './ICU4XLocaleDisplayNamesFormatter.js'; -export { ICU4XLocaleExpander } from './ICU4XLocaleExpander.js'; -export { ICU4XLocaleFallbackConfig } from './ICU4XLocaleFallbackConfig.js'; -export { ICU4XLocaleFallbackIterator } from './ICU4XLocaleFallbackIterator.js'; -export { ICU4XLocaleFallbackPriority } from './ICU4XLocaleFallbackPriority.js'; -export { ICU4XLocaleFallbacker } from './ICU4XLocaleFallbacker.js'; -export { ICU4XLocaleFallbackerWithConfig } from './ICU4XLocaleFallbackerWithConfig.js'; -export { ICU4XLogger } from './ICU4XLogger.js'; -export { ICU4XMetazoneCalculator } from './ICU4XMetazoneCalculator.js'; -export { ICU4XOrdering } from './ICU4XOrdering.js'; -export { ICU4XPluralCategories } from './ICU4XPluralCategories.js'; -export { ICU4XPluralCategory } from './ICU4XPluralCategory.js'; -export { ICU4XPluralOperands } from './ICU4XPluralOperands.js'; -export { ICU4XPluralRules } from './ICU4XPluralRules.js'; -export { ICU4XPropertyValueNameToEnumMapper } from './ICU4XPropertyValueNameToEnumMapper.js'; -export { ICU4XRegionDisplayNames } from './ICU4XRegionDisplayNames.js'; -export { ICU4XReorderedIndexMap } from './ICU4XReorderedIndexMap.js'; -export { ICU4XScriptExtensionsSet } from './ICU4XScriptExtensionsSet.js'; -export { ICU4XScriptWithExtensions } from './ICU4XScriptWithExtensions.js'; -export { ICU4XScriptWithExtensionsBorrowed } from './ICU4XScriptWithExtensionsBorrowed.js'; -export { ICU4XSegmenterWordType } from './ICU4XSegmenterWordType.js'; -export { ICU4XSentenceBreakIteratorLatin1 } from './ICU4XSentenceBreakIteratorLatin1.js'; -export { ICU4XSentenceBreakIteratorUtf16 } from './ICU4XSentenceBreakIteratorUtf16.js'; -export { ICU4XSentenceBreakIteratorUtf8 } from './ICU4XSentenceBreakIteratorUtf8.js'; -export { ICU4XSentenceSegmenter } from './ICU4XSentenceSegmenter.js'; -export { ICU4XTime } from './ICU4XTime.js'; -export { ICU4XTimeFormatter } from './ICU4XTimeFormatter.js'; -export { ICU4XTimeLength } from './ICU4XTimeLength.js'; -export { ICU4XTimeZoneFormatter } from './ICU4XTimeZoneFormatter.js'; -export { ICU4XTransformResult } from './ICU4XTransformResult.js'; -export { ICU4XUnicodeSetData } from './ICU4XUnicodeSetData.js'; -export { ICU4XWeekCalculator } from './ICU4XWeekCalculator.js'; -export { ICU4XWeekOf } from './ICU4XWeekOf.js'; -export { ICU4XWeekRelativeUnit } from './ICU4XWeekRelativeUnit.js'; -export { ICU4XWordBreakIteratorLatin1 } from './ICU4XWordBreakIteratorLatin1.js'; -export { ICU4XWordBreakIteratorUtf16 } from './ICU4XWordBreakIteratorUtf16.js'; -export { ICU4XWordBreakIteratorUtf8 } from './ICU4XWordBreakIteratorUtf8.js'; -export { ICU4XWordSegmenter } from './ICU4XWordSegmenter.js'; -export { ICU4XZonedDateTimeFormatter } from './ICU4XZonedDateTimeFormatter.js'; diff --git a/third_party/rust/icu_capi/js/include/index.js b/third_party/rust/icu_capi/js/include/index.js deleted file mode 100644 index ba954b2d4011..000000000000 --- a/third_party/rust/icu_capi/js/include/index.js +++ /dev/null @@ -1,111 +0,0 @@ -export { FFIError } from './diplomat-runtime.js'; -export { CodePointRangeIterator } from './CodePointRangeIterator.js'; -export { CodePointRangeIteratorResult } from './CodePointRangeIteratorResult.js'; -export { ICU4XAnyCalendarKind } from './ICU4XAnyCalendarKind.js'; -export { ICU4XBidi } from './ICU4XBidi.js'; -export { ICU4XBidiDirection } from './ICU4XBidiDirection.js'; -export { ICU4XBidiInfo } from './ICU4XBidiInfo.js'; -export { ICU4XBidiParagraph } from './ICU4XBidiParagraph.js'; -export { ICU4XCalendar } from './ICU4XCalendar.js'; -export { ICU4XCanonicalCombiningClassMap } from './ICU4XCanonicalCombiningClassMap.js'; -export { ICU4XCanonicalComposition } from './ICU4XCanonicalComposition.js'; -export { ICU4XCanonicalDecomposition } from './ICU4XCanonicalDecomposition.js'; -export { ICU4XCodePointMapData16 } from './ICU4XCodePointMapData16.js'; -export { ICU4XCodePointMapData8 } from './ICU4XCodePointMapData8.js'; -export { ICU4XCodePointSetData } from './ICU4XCodePointSetData.js'; -export { ICU4XCollator } from './ICU4XCollator.js'; -export { ICU4XCollatorAlternateHandling } from './ICU4XCollatorAlternateHandling.js'; -export { ICU4XCollatorBackwardSecondLevel } from './ICU4XCollatorBackwardSecondLevel.js'; -export { ICU4XCollatorCaseFirst } from './ICU4XCollatorCaseFirst.js'; -export { ICU4XCollatorCaseLevel } from './ICU4XCollatorCaseLevel.js'; -export { ICU4XCollatorMaxVariable } from './ICU4XCollatorMaxVariable.js'; -export { ICU4XCollatorNumeric } from './ICU4XCollatorNumeric.js'; -export { ICU4XCollatorOptionsV1 } from './ICU4XCollatorOptionsV1.js'; -export { ICU4XCollatorStrength } from './ICU4XCollatorStrength.js'; -export { ICU4XComposingNormalizer } from './ICU4XComposingNormalizer.js'; -export { ICU4XCustomTimeZone } from './ICU4XCustomTimeZone.js'; -export { ICU4XDataProvider } from './ICU4XDataProvider.js'; -export { ICU4XDataStruct } from './ICU4XDataStruct.js'; -export { ICU4XDate } from './ICU4XDate.js'; -export { ICU4XDateFormatter } from './ICU4XDateFormatter.js'; -export { ICU4XDateLength } from './ICU4XDateLength.js'; -export { ICU4XDateTime } from './ICU4XDateTime.js'; -export { ICU4XDateTimeFormatter } from './ICU4XDateTimeFormatter.js'; -export { ICU4XDecomposed } from './ICU4XDecomposed.js'; -export { ICU4XDecomposingNormalizer } from './ICU4XDecomposingNormalizer.js'; -export { ICU4XDisplayNamesFallback } from './ICU4XDisplayNamesFallback.js'; -export { ICU4XDisplayNamesOptionsV1 } from './ICU4XDisplayNamesOptionsV1.js'; -export { ICU4XDisplayNamesStyle } from './ICU4XDisplayNamesStyle.js'; -export { ICU4XError } from './ICU4XError.js'; -export { ICU4XFixedDecimal } from './ICU4XFixedDecimal.js'; -export { ICU4XFixedDecimalFormatter } from './ICU4XFixedDecimalFormatter.js'; -export { ICU4XFixedDecimalGroupingStrategy } from './ICU4XFixedDecimalGroupingStrategy.js'; -export { ICU4XFixedDecimalSign } from './ICU4XFixedDecimalSign.js'; -export { ICU4XFixedDecimalSignDisplay } from './ICU4XFixedDecimalSignDisplay.js'; -export { ICU4XGeneralCategoryNameToMaskMapper } from './ICU4XGeneralCategoryNameToMaskMapper.js'; -export { ICU4XGraphemeClusterBreakIteratorLatin1 } from './ICU4XGraphemeClusterBreakIteratorLatin1.js'; -export { ICU4XGraphemeClusterBreakIteratorUtf16 } from './ICU4XGraphemeClusterBreakIteratorUtf16.js'; -export { ICU4XGraphemeClusterBreakIteratorUtf8 } from './ICU4XGraphemeClusterBreakIteratorUtf8.js'; -export { ICU4XGraphemeClusterSegmenter } from './ICU4XGraphemeClusterSegmenter.js'; -export { ICU4XGregorianDateFormatter } from './ICU4XGregorianDateFormatter.js'; -export { ICU4XGregorianDateTimeFormatter } from './ICU4XGregorianDateTimeFormatter.js'; -export { ICU4XGregorianZonedDateTimeFormatter } from './ICU4XGregorianZonedDateTimeFormatter.js'; -export { ICU4XIsoDate } from './ICU4XIsoDate.js'; -export { ICU4XIsoDateTime } from './ICU4XIsoDateTime.js'; -export { ICU4XIsoTimeZoneFormat } from './ICU4XIsoTimeZoneFormat.js'; -export { ICU4XIsoTimeZoneMinuteDisplay } from './ICU4XIsoTimeZoneMinuteDisplay.js'; -export { ICU4XIsoTimeZoneOptions } from './ICU4XIsoTimeZoneOptions.js'; -export { ICU4XIsoTimeZoneSecondDisplay } from './ICU4XIsoTimeZoneSecondDisplay.js'; -export { ICU4XIsoWeekday } from './ICU4XIsoWeekday.js'; -export { ICU4XLanguageDisplay } from './ICU4XLanguageDisplay.js'; -export { ICU4XLineBreakIteratorLatin1 } from './ICU4XLineBreakIteratorLatin1.js'; -export { ICU4XLineBreakIteratorUtf16 } from './ICU4XLineBreakIteratorUtf16.js'; -export { ICU4XLineBreakIteratorUtf8 } from './ICU4XLineBreakIteratorUtf8.js'; -export { ICU4XLineBreakOptionsV1 } from './ICU4XLineBreakOptionsV1.js'; -export { ICU4XLineBreakStrictness } from './ICU4XLineBreakStrictness.js'; -export { ICU4XLineBreakWordOption } from './ICU4XLineBreakWordOption.js'; -export { ICU4XLineSegmenter } from './ICU4XLineSegmenter.js'; -export { ICU4XList } from './ICU4XList.js'; -export { ICU4XListFormatter } from './ICU4XListFormatter.js'; -export { ICU4XListLength } from './ICU4XListLength.js'; -export { ICU4XLocale } from './ICU4XLocale.js'; -export { ICU4XLocaleCanonicalizer } from './ICU4XLocaleCanonicalizer.js'; -export { ICU4XLocaleDisplayNamesFormatter } from './ICU4XLocaleDisplayNamesFormatter.js'; -export { ICU4XLocaleExpander } from './ICU4XLocaleExpander.js'; -export { ICU4XLocaleFallbackConfig } from './ICU4XLocaleFallbackConfig.js'; -export { ICU4XLocaleFallbackIterator } from './ICU4XLocaleFallbackIterator.js'; -export { ICU4XLocaleFallbackPriority } from './ICU4XLocaleFallbackPriority.js'; -export { ICU4XLocaleFallbacker } from './ICU4XLocaleFallbacker.js'; -export { ICU4XLocaleFallbackerWithConfig } from './ICU4XLocaleFallbackerWithConfig.js'; -export { ICU4XLogger } from './ICU4XLogger.js'; -export { ICU4XMetazoneCalculator } from './ICU4XMetazoneCalculator.js'; -export { ICU4XOrdering } from './ICU4XOrdering.js'; -export { ICU4XPluralCategories } from './ICU4XPluralCategories.js'; -export { ICU4XPluralCategory } from './ICU4XPluralCategory.js'; -export { ICU4XPluralOperands } from './ICU4XPluralOperands.js'; -export { ICU4XPluralRules } from './ICU4XPluralRules.js'; -export { ICU4XPropertyValueNameToEnumMapper } from './ICU4XPropertyValueNameToEnumMapper.js'; -export { ICU4XRegionDisplayNames } from './ICU4XRegionDisplayNames.js'; -export { ICU4XReorderedIndexMap } from './ICU4XReorderedIndexMap.js'; -export { ICU4XScriptExtensionsSet } from './ICU4XScriptExtensionsSet.js'; -export { ICU4XScriptWithExtensions } from './ICU4XScriptWithExtensions.js'; -export { ICU4XScriptWithExtensionsBorrowed } from './ICU4XScriptWithExtensionsBorrowed.js'; -export { ICU4XSegmenterWordType } from './ICU4XSegmenterWordType.js'; -export { ICU4XSentenceBreakIteratorLatin1 } from './ICU4XSentenceBreakIteratorLatin1.js'; -export { ICU4XSentenceBreakIteratorUtf16 } from './ICU4XSentenceBreakIteratorUtf16.js'; -export { ICU4XSentenceBreakIteratorUtf8 } from './ICU4XSentenceBreakIteratorUtf8.js'; -export { ICU4XSentenceSegmenter } from './ICU4XSentenceSegmenter.js'; -export { ICU4XTime } from './ICU4XTime.js'; -export { ICU4XTimeFormatter } from './ICU4XTimeFormatter.js'; -export { ICU4XTimeLength } from './ICU4XTimeLength.js'; -export { ICU4XTimeZoneFormatter } from './ICU4XTimeZoneFormatter.js'; -export { ICU4XTransformResult } from './ICU4XTransformResult.js'; -export { ICU4XUnicodeSetData } from './ICU4XUnicodeSetData.js'; -export { ICU4XWeekCalculator } from './ICU4XWeekCalculator.js'; -export { ICU4XWeekOf } from './ICU4XWeekOf.js'; -export { ICU4XWeekRelativeUnit } from './ICU4XWeekRelativeUnit.js'; -export { ICU4XWordBreakIteratorLatin1 } from './ICU4XWordBreakIteratorLatin1.js'; -export { ICU4XWordBreakIteratorUtf16 } from './ICU4XWordBreakIteratorUtf16.js'; -export { ICU4XWordBreakIteratorUtf8 } from './ICU4XWordBreakIteratorUtf8.js'; -export { ICU4XWordSegmenter } from './ICU4XWordSegmenter.js'; -export { ICU4XZonedDateTimeFormatter } from './ICU4XZonedDateTimeFormatter.js'; diff --git a/third_party/rust/icu_capi/src/bidi.rs b/third_party/rust/icu_capi/src/bidi.rs deleted file mode 100644 index c5b3d0fe0047..000000000000 --- a/third_party/rust/icu_capi/src/bidi.rs +++ /dev/null @@ -1,262 +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] -pub mod ffi { - use alloc::boxed::Box; - use alloc::vec::Vec; - use diplomat_runtime::DiplomatWriteable; - - use core::fmt::Write; - use icu_properties::bidi::BidiClassAdapter; - use icu_properties::maps; - use icu_properties::BidiClass; - use unicode_bidi::BidiInfo; - use unicode_bidi::Level; - use unicode_bidi::Paragraph; - - use crate::errors::ffi::ICU4XError; - use crate::provider::ffi::ICU4XDataProvider; - - pub enum ICU4XBidiDirection { - Ltr, - Rtl, - Mixed, - } - - #[diplomat::opaque] - /// An ICU4X Bidi object, containing loaded bidi data - #[diplomat::rust_link(icu::properties::bidi::BidiClassAdapter, Struct)] - // #[diplomat::rust_link(icu::properties::maps::load_bidi_class, Struct)] - pub struct ICU4XBidi(pub maps::CodePointMapData); - - impl ICU4XBidi { - /// Creates a new [`ICU4XBidi`] from locale data. - #[diplomat::rust_link(icu::properties::bidi::BidiClassAdapter::new, FnInStruct)] - pub fn create(provider: &ICU4XDataProvider) -> Result, ICU4XError> { - Ok(Box::new(ICU4XBidi(maps::load_bidi_class(&provider.0)?))) - } - - /// Use the data loaded in this object to process a string and calculate bidi information - /// - /// Takes in a Level for the default level, if it is an invalid value it will default to LTR - #[diplomat::rust_link(unicode_bidi::BidiInfo::new_with_data_source, FnInStruct)] - #[diplomat::rust_link( - icu::properties::bidi::BidiClassAdapter::bidi_class, - FnInStruct, - hidden - )] - pub fn for_text<'text>( - &self, - text: &'text str, - default_level: u8, - ) -> Box> { - let data = self.0.as_borrowed(); - let adapter = BidiClassAdapter::new(data); - - Box::new(ICU4XBidiInfo(BidiInfo::new_with_data_source( - &adapter, - text, - Level::new(default_level).ok(), - ))) - } - /// Utility function for producing reorderings given a list of levels - /// - /// Produces a map saying which visual index maps to which source index. - /// - /// The levels array must not have values greater than 126 (this is the - /// Bidi maximum explicit depth plus one). - /// Failure to follow this invariant may lead to incorrect results, - /// but is still safe. - #[diplomat::rust_link(unicode_bidi::BidiInfo::reorder_visual, FnInStruct)] - pub fn reorder_visual(&self, levels: &[u8]) -> Box { - let levels = Level::from_slice_unchecked(levels); - Box::new(ICU4XReorderedIndexMap(BidiInfo::reorder_visual(levels))) - } - - /// Check if a Level returned by level_at is an RTL level. - /// - /// Invalid levels (numbers greater than 125) will be assumed LTR - #[diplomat::rust_link(unicode_bidi::Level::is_rtl, FnInStruct)] - pub fn level_is_rtl(level: u8) -> bool { - Level::new(level).unwrap_or_else(|_| Level::ltr()).is_rtl() - } - - /// Check if a Level returned by level_at is an LTR level. - /// - /// Invalid levels (numbers greater than 125) will be assumed LTR - #[diplomat::rust_link(unicode_bidi::Level::is_ltr, FnInStruct)] - pub fn level_is_ltr(level: u8) -> bool { - Level::new(level).unwrap_or_else(|_| Level::ltr()).is_ltr() - } - - /// Get a basic RTL Level value - #[diplomat::rust_link(unicode_bidi::Level::rtl, FnInStruct)] - pub fn level_rtl() -> u8 { - Level::rtl().number() - } - - /// Get a simple LTR Level value - #[diplomat::rust_link(unicode_bidi::Level::ltr, FnInStruct)] - pub fn level_ltr() -> u8 { - Level::ltr().number() - } - } - - /// Thin wrapper around a vector that maps visual indices to source indices - /// - /// `map[visualIndex] = sourceIndex` - /// - /// Produced by `reorder_visual()` on [`ICU4XBidi`]. - #[diplomat::opaque] - pub struct ICU4XReorderedIndexMap(pub Vec); - - impl ICU4XReorderedIndexMap { - /// Get this as a slice/array of indices - pub fn as_slice<'a>(&'a self) -> &'a [usize] { - &self.0 - } - - /// The length of this map - #[allow(clippy::len_without_is_empty)] - pub fn len(&self) -> usize { - self.0.len() - } - - /// Get element at `index`. Returns 0 when out of bounds - /// (note that 0 is also a valid in-bounds value, please use `len()` - /// to avoid out-of-bounds) - pub fn get(&self, index: usize) -> usize { - self.0.get(index).copied().unwrap_or(0) - } - } - - /// An object containing bidi information for a given string, produced by `for_text()` on `ICU4XBidi` - #[diplomat::rust_link(unicode_bidi::BidiInfo, Struct)] - #[diplomat::opaque] - pub struct ICU4XBidiInfo<'text>(pub BidiInfo<'text>); - - impl<'text> ICU4XBidiInfo<'text> { - /// The number of paragraphs contained here - pub fn paragraph_count(&self) -> usize { - self.0.paragraphs.len() - } - - /// Get the nth paragraph, returning None if out of bounds - pub fn paragraph_at(&'text self, n: usize) -> Option>> { - self.0 - .paragraphs - .get(n) - .map(|p| Box::new(ICU4XBidiParagraph(Paragraph::new(&self.0, p)))) - } - - /// The number of bytes in this full text - pub fn size(&self) -> usize { - self.0.levels.len() - } - - /// Get the BIDI level at a particular byte index in the full text. - /// This integer is conceptually a `unicode_bidi::Level`, - /// and can be further inspected using the static methods on ICU4XBidi. - /// - /// Returns 0 (equivalent to `Level::ltr()`) on error - pub fn level_at(&self, pos: usize) -> u8 { - if let Some(l) = self.0.levels.get(pos) { - l.number() - } else { - 0 - } - } - } - - /// Bidi information for a single processed paragraph - #[diplomat::opaque] - pub struct ICU4XBidiParagraph<'info>(pub Paragraph<'info, 'info>); - - impl<'info> ICU4XBidiParagraph<'info> { - /// Given a paragraph index `n` within the surrounding text, this sets this - /// object to the paragraph at that index. Returns `ICU4XError::OutOfBoundsError` when out of bounds. - /// - /// This is equivalent to calling `paragraph_at()` on `ICU4XBidiInfo` but doesn't - /// create a new object - pub fn set_paragraph_in_text(&mut self, n: usize) -> Result<(), ICU4XError> { - let para = self - .0 - .info - .paragraphs - .get(n) - .ok_or(ICU4XError::OutOfBoundsError)?; - self.0 = Paragraph::new(self.0.info, para); - Ok(()) - } - #[diplomat::rust_link(unicode_bidi::Paragraph::level_at, FnInStruct)] - /// The primary direction of this paragraph - pub fn direction(&self) -> ICU4XBidiDirection { - self.0.direction().into() - } - - /// The number of bytes in this paragraph - #[diplomat::rust_link(unicode_bidi::ParagraphInfo::len, FnInStruct)] - pub fn size(&self) -> usize { - self.0.para.len() - } - - /// The start index of this paragraph within the source text - pub fn range_start(&self) -> usize { - self.0.para.range.start - } - - /// The end index of this paragraph within the source text - pub fn range_end(&self) -> usize { - self.0.para.range.end - } - - /// Reorder a line based on display order. The ranges are specified relative to the source text and must be contained - /// within this paragraph's range. - #[diplomat::rust_link(unicode_bidi::Paragraph::level_at, FnInStruct)] - pub fn reorder_line( - &self, - range_start: usize, - range_end: usize, - out: &mut DiplomatWriteable, - ) -> Result<(), ICU4XError> { - if range_start < self.range_start() || range_end > self.range_end() { - return Err(ICU4XError::OutOfBoundsError); - } - - let info = self.0.info; - let para = self.0.para; - - let reordered = info.reorder_line(para, range_start..range_end); - - Ok(out.write_str(&reordered)?) - } - - /// Get the BIDI level at a particular byte index in this paragraph. - /// This integer is conceptually a `unicode_bidi::Level`, - /// and can be further inspected using the static methods on ICU4XBidi. - /// - /// Returns 0 (equivalent to `Level::ltr()`) on error - #[diplomat::rust_link(unicode_bidi::Paragraph::level_at, FnInStruct)] - pub fn level_at(&self, pos: usize) -> u8 { - if pos >= self.size() { - return 0; - } - - self.0.level_at(pos).number() - } - } -} - -use unicode_bidi::Direction; - -impl From for ffi::ICU4XBidiDirection { - fn from(other: Direction) -> Self { - match other { - Direction::Ltr => Self::Ltr, - Direction::Rtl => Self::Rtl, - Direction::Mixed => Self::Mixed, - } - } -} diff --git a/third_party/rust/icu_capi/src/calendar.rs b/third_party/rust/icu_capi/src/calendar.rs deleted file mode 100644 index 659dc6f63747..000000000000 --- a/third_party/rust/icu_capi/src/calendar.rs +++ /dev/null @@ -1,122 +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] -pub mod ffi { - use alloc::boxed::Box; - use alloc::sync::Arc; - - use core::fmt::Write; - use icu_calendar::{AnyCalendar, AnyCalendarKind}; - - use crate::errors::ffi::ICU4XError; - use crate::locale::ffi::ICU4XLocale; - use crate::provider::ffi::ICU4XDataProvider; - - /// The various calendar types currently supported by [`ICU4XCalendar`] - #[diplomat::enum_convert(AnyCalendarKind, needs_wildcard)] - #[diplomat::rust_link(icu::calendar::AnyCalendarKind, Enum)] - pub enum ICU4XAnyCalendarKind { - /// The kind of an Iso calendar - Iso = 0, - /// The kind of a Gregorian calendar - Gregorian = 1, - /// The kind of a Buddhist calendar - Buddhist = 2, - /// The kind of a Japanese calendar with modern eras - Japanese = 3, - /// The kind of a Japanese calendar with modern and historic eras - JapaneseExtended = 4, - /// The kind of an Ethiopian calendar, with Amete Mihret era - Ethiopian = 5, - /// The kind of an Ethiopian calendar, with Amete Alem era - EthiopianAmeteAlem = 6, - /// The kind of a Indian calendar - Indian = 7, - /// The kind of a Coptic calendar - Coptic = 8, - } - - impl ICU4XAnyCalendarKind { - /// Read the calendar type off of the -u-ca- extension on a locale. - /// - /// Errors if there is no calendar on the locale or if the locale's calendar - /// is not known or supported. - #[diplomat::rust_link(icu::calendar::AnyCalendarKind::get_for_locale, FnInEnum)] - pub fn get_for_locale(locale: &ICU4XLocale) -> Result { - AnyCalendarKind::get_for_locale(&locale.0) - .map(Into::into) - .ok_or(()) - } - - /// Obtain the calendar type given a BCP-47 -u-ca- extension string. - /// - /// Errors if the calendar is not known or supported. - #[diplomat::rust_link(icu::calendar::AnyCalendarKind::get_for_bcp47_value, FnInEnum)] - #[diplomat::rust_link( - icu::calendar::AnyCalendarKind::get_for_bcp47_string, - FnInEnum, - hidden - )] - #[diplomat::rust_link( - icu::calendar::AnyCalendarKind::get_for_bcp47_bytes, - FnInEnum, - hidden - )] - pub fn get_for_bcp47(s: &str) -> Result { - let s = s.as_bytes(); // #2520 - AnyCalendarKind::get_for_bcp47_bytes(s) - .map(Into::into) - .ok_or(()) - } - - /// Obtain the string suitable for use in the -u-ca- extension in a BCP47 locale. - #[diplomat::rust_link(icu::calendar::AnyCalendarKind::as_bcp47_string, FnInEnum)] - #[diplomat::rust_link(icu::calendar::AnyCalendarKind::as_bcp47_value, FnInEnum, hidden)] - pub fn bcp47( - self, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let kind = AnyCalendarKind::from(self); - Ok(write.write_str(kind.as_bcp47_string())?) - } - } - - #[diplomat::opaque] - #[diplomat::transparent_convert] - #[diplomat::rust_link(icu::calendar::AnyCalendar, Enum)] - pub struct ICU4XCalendar(pub Arc); - - impl ICU4XCalendar { - /// Creates a new [`ICU4XCalendar`] from the specified date and time. - #[diplomat::rust_link(icu::calendar::AnyCalendar::try_new_for_locale_unstable, FnInEnum)] - pub fn create_for_locale( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - - Ok(Box::new(ICU4XCalendar(Arc::new( - AnyCalendar::try_new_for_locale_unstable(&provider.0, &locale)?, - )))) - } - - /// Creates a new [`ICU4XCalendar`] from the specified date and time. - #[diplomat::rust_link(icu::calendar::AnyCalendar::try_new_unstable, FnInEnum)] - pub fn create_for_kind( - provider: &ICU4XDataProvider, - kind: ICU4XAnyCalendarKind, - ) -> Result, ICU4XError> { - Ok(Box::new(ICU4XCalendar(Arc::new( - AnyCalendar::try_new_unstable(&provider.0, kind.into())?, - )))) - } - - /// Returns the kind of this calendar - #[diplomat::rust_link(icu::calendar::AnyCalendar::kind, FnInEnum)] - pub fn kind(&self) -> ICU4XAnyCalendarKind { - self.0.kind().into() - } - } -} diff --git a/third_party/rust/icu_capi/src/collator.rs b/third_party/rust/icu_capi/src/collator.rs deleted file mode 100644 index ae42d30f83f7..000000000000 --- a/third_party/rust/icu_capi/src/collator.rs +++ /dev/null @@ -1,232 +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] -pub mod ffi { - use alloc::boxed::Box; - use icu_collator::{Collator, CollatorOptions}; - - use crate::{ - common::ffi::ICU4XOrdering, errors::ffi::ICU4XError, locale::ffi::ICU4XLocale, - provider::ffi::ICU4XDataProvider, - }; - - #[diplomat::opaque] - #[diplomat::rust_link(icu::collator::Collator, Struct)] - pub struct ICU4XCollator(pub Collator); - - #[diplomat::rust_link(icu::collator::CollatorOptions, Struct)] - #[diplomat::rust_link(icu::collator::CollatorOptions::new, FnInStruct, hidden)] - pub struct ICU4XCollatorOptionsV1 { - pub strength: ICU4XCollatorStrength, - pub alternate_handling: ICU4XCollatorAlternateHandling, - pub case_first: ICU4XCollatorCaseFirst, - pub max_variable: ICU4XCollatorMaxVariable, - pub case_level: ICU4XCollatorCaseLevel, - pub numeric: ICU4XCollatorNumeric, - pub backward_second_level: ICU4XCollatorBackwardSecondLevel, - } - - #[diplomat::rust_link(icu::collator::Strength, Enum)] - pub enum ICU4XCollatorStrength { - Auto = 0, - Primary = 1, - Secondary = 2, - Tertiary = 3, - Quaternary = 4, - Identical = 5, - } - - #[diplomat::rust_link(icu::collator::AlternateHandling, Enum)] - pub enum ICU4XCollatorAlternateHandling { - Auto = 0, - NonIgnorable = 1, - Shifted = 2, - } - - #[diplomat::rust_link(icu::collator::CaseFirst, Enum)] - pub enum ICU4XCollatorCaseFirst { - Auto = 0, - Off = 1, - LowerFirst = 2, - UpperFirst = 3, - } - - #[diplomat::rust_link(icu::collator::MaxVariable, Enum)] - pub enum ICU4XCollatorMaxVariable { - Auto = 0, - Space = 1, - Punctuation = 2, - Symbol = 3, - Currency = 4, - } - - #[diplomat::rust_link(icu::collator::CaseLevel, Enum)] - pub enum ICU4XCollatorCaseLevel { - Auto = 0, - Off = 1, - On = 2, - } - - #[diplomat::rust_link(icu::collator::Numeric, Enum)] - pub enum ICU4XCollatorNumeric { - Auto = 0, - Off = 1, - On = 2, - } - - #[diplomat::rust_link(icu::collator::BackwardSecondLevel, Enum)] - pub enum ICU4XCollatorBackwardSecondLevel { - Auto = 0, - Off = 1, - On = 2, - } - - impl ICU4XCollator { - /// Construct a new Collator instance. - #[diplomat::rust_link(icu::collator::Collator::try_new_unstable, FnInStruct)] - pub fn create_v1( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - options: ICU4XCollatorOptionsV1, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - let options = CollatorOptions::from(options); - - Ok(Box::new(ICU4XCollator(Collator::try_new_unstable( - &provider.0, - &locale, - options, - )?))) - } - - /// Compare potentially ill-formed UTF-8 strings. - /// - /// Ill-formed input is compared - /// as if errors had been replaced with REPLACEMENT CHARACTERs according - /// to the WHATWG Encoding Standard. - #[diplomat::rust_link(icu::collator::Collator::compare_utf8, FnInStruct)] - pub fn compare(&self, left: &str, right: &str) -> ICU4XOrdering { - let left = left.as_bytes(); // #2520 - let right = right.as_bytes(); // #2520 - self.0.compare_utf8(left, right).into() - } - - /// Compare guaranteed well-formed UTF-8 strings. - /// - /// Note: In C++, passing ill-formed UTF-8 strings is undefined behavior - /// (and may be memory-unsafe to do so, too). - #[diplomat::rust_link(icu::collator::Collator::compare, FnInStruct)] - pub fn compare_valid_utf8(&self, left: &str, right: &str) -> ICU4XOrdering { - self.0.compare(left, right).into() - } - - /// Compare potentially ill-formed UTF-16 strings, with unpaired surrogates - /// compared as REPLACEMENT CHARACTER. - #[diplomat::rust_link(icu::collator::Collator::compare_utf16, FnInStruct)] - pub fn compare_utf16(&self, left: &[u16], right: &[u16]) -> ICU4XOrdering { - self.0.compare_utf16(left, right).into() - } - } -} - -use icu_collator::{ - AlternateHandling, BackwardSecondLevel, CaseFirst, CaseLevel, CollatorOptions, MaxVariable, - Numeric, Strength, -}; - -impl From for Option { - fn from(strength: ffi::ICU4XCollatorStrength) -> Option { - match strength { - ffi::ICU4XCollatorStrength::Auto => None, - ffi::ICU4XCollatorStrength::Primary => Some(Strength::Primary), - ffi::ICU4XCollatorStrength::Secondary => Some(Strength::Secondary), - ffi::ICU4XCollatorStrength::Tertiary => Some(Strength::Tertiary), - ffi::ICU4XCollatorStrength::Quaternary => Some(Strength::Quaternary), - ffi::ICU4XCollatorStrength::Identical => Some(Strength::Identical), - } - } -} - -impl From for Option { - fn from(alternate_handling: ffi::ICU4XCollatorAlternateHandling) -> Option { - match alternate_handling { - ffi::ICU4XCollatorAlternateHandling::Auto => None, - ffi::ICU4XCollatorAlternateHandling::NonIgnorable => { - Some(AlternateHandling::NonIgnorable) - } - ffi::ICU4XCollatorAlternateHandling::Shifted => Some(AlternateHandling::Shifted), - } - } -} - -impl From for Option { - fn from(case_first: ffi::ICU4XCollatorCaseFirst) -> Option { - match case_first { - ffi::ICU4XCollatorCaseFirst::Auto => None, - ffi::ICU4XCollatorCaseFirst::Off => Some(CaseFirst::Off), - ffi::ICU4XCollatorCaseFirst::LowerFirst => Some(CaseFirst::LowerFirst), - ffi::ICU4XCollatorCaseFirst::UpperFirst => Some(CaseFirst::UpperFirst), - } - } -} - -impl From for Option { - fn from(max_variable: ffi::ICU4XCollatorMaxVariable) -> Option { - match max_variable { - ffi::ICU4XCollatorMaxVariable::Auto => None, - ffi::ICU4XCollatorMaxVariable::Space => Some(MaxVariable::Space), - ffi::ICU4XCollatorMaxVariable::Punctuation => Some(MaxVariable::Punctuation), - ffi::ICU4XCollatorMaxVariable::Symbol => Some(MaxVariable::Symbol), - ffi::ICU4XCollatorMaxVariable::Currency => Some(MaxVariable::Currency), - } - } -} - -impl From for Option { - fn from(case_level: ffi::ICU4XCollatorCaseLevel) -> Option { - match case_level { - ffi::ICU4XCollatorCaseLevel::Auto => None, - ffi::ICU4XCollatorCaseLevel::Off => Some(CaseLevel::Off), - ffi::ICU4XCollatorCaseLevel::On => Some(CaseLevel::On), - } - } -} - -impl From for Option { - fn from(numeric: ffi::ICU4XCollatorNumeric) -> Option { - match numeric { - ffi::ICU4XCollatorNumeric::Auto => None, - ffi::ICU4XCollatorNumeric::Off => Some(Numeric::Off), - ffi::ICU4XCollatorNumeric::On => Some(Numeric::On), - } - } -} - -impl From for Option { - fn from( - backward_second_level: ffi::ICU4XCollatorBackwardSecondLevel, - ) -> Option { - match backward_second_level { - ffi::ICU4XCollatorBackwardSecondLevel::Auto => None, - ffi::ICU4XCollatorBackwardSecondLevel::Off => Some(BackwardSecondLevel::Off), - ffi::ICU4XCollatorBackwardSecondLevel::On => Some(BackwardSecondLevel::On), - } - } -} - -impl From for CollatorOptions { - fn from(options: ffi::ICU4XCollatorOptionsV1) -> CollatorOptions { - let mut result = CollatorOptions::new(); - result.strength = options.strength.into(); - result.alternate_handling = options.alternate_handling.into(); - result.case_first = options.case_first.into(); - result.max_variable = options.max_variable.into(); - result.case_level = options.case_level.into(); - result.numeric = options.numeric.into(); - result.backward_second_level = options.backward_second_level.into(); - - result - } -} diff --git a/third_party/rust/icu_capi/src/common.rs b/third_party/rust/icu_capi/src/common.rs deleted file mode 100644 index d11ca260440a..000000000000 --- a/third_party/rust/icu_capi/src/common.rs +++ /dev/null @@ -1,16 +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] -pub mod ffi { - use alloc::boxed::Box; - - #[diplomat::enum_convert(core::cmp::Ordering)] - #[diplomat::rust_link(core::cmp::Ordering, Enum)] - pub enum ICU4XOrdering { - Less = -1, - Equal = 0, - Greater = 1, - } -} diff --git a/third_party/rust/icu_capi/src/data_struct.rs b/third_party/rust/icu_capi/src/data_struct.rs deleted file mode 100644 index b2213209cf4e..000000000000 --- a/third_party/rust/icu_capi/src/data_struct.rs +++ /dev/null @@ -1,87 +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 ). - -#[cfg(feature = "icu_decimal")] -use alloc::borrow::{Cow, ToOwned}; - -#[diplomat::bridge] -pub mod ffi { - - #[cfg(feature = "icu_decimal")] - use crate::errors::ffi::ICU4XError; - use alloc::boxed::Box; - use icu_provider::{AnyPayload, DataPayload}; - - #[diplomat::opaque] - /// A generic data struct to be used by ICU4X - /// - /// This can be used to construct a StructDataProvider. - pub struct ICU4XDataStruct(pub(crate) AnyPayload); - - impl ICU4XDataStruct { - /// Construct a new DecimalSymbolsV1 data struct. - /// - /// C++ users: All string arguments must be valid UTF8 - #[diplomat::rust_link(icu::decimal::provider::DecimalSymbolsV1, Struct)] - #[allow(clippy::too_many_arguments)] - #[cfg(feature = "icu_decimal")] - pub fn create_decimal_symbols_v1( - plus_sign_prefix: &str, - plus_sign_suffix: &str, - minus_sign_prefix: &str, - minus_sign_suffix: &str, - decimal_separator: &str, - grouping_separator: &str, - primary_group_size: u8, - secondary_group_size: u8, - min_group_size: u8, - digits: &[char], - ) -> Result, ICU4XError> { - use super::str_to_cow; - use icu_decimal::provider::{ - AffixesV1, DecimalSymbolsV1, DecimalSymbolsV1Marker, GroupingSizesV1, - }; - let digits = if digits.len() == 10 { - let mut new_digits = ['\0'; 10]; - new_digits.copy_from_slice(digits); - new_digits - } else { - return Err(ICU4XError::DataStructValidityError); - }; - let plus_sign_affixes = AffixesV1 { - prefix: str_to_cow(plus_sign_prefix), - suffix: str_to_cow(plus_sign_suffix), - }; - let minus_sign_affixes = AffixesV1 { - prefix: str_to_cow(minus_sign_prefix), - suffix: str_to_cow(minus_sign_suffix), - }; - let grouping_sizes = GroupingSizesV1 { - primary: primary_group_size, - secondary: secondary_group_size, - min_grouping: min_group_size, - }; - - let symbols = DecimalSymbolsV1 { - plus_sign_affixes, - minus_sign_affixes, - decimal_separator: str_to_cow(decimal_separator), - grouping_separator: str_to_cow(grouping_separator), - grouping_sizes, - digits, - }; - - let payload: DataPayload = DataPayload::from_owned(symbols); - Ok(Box::new(ICU4XDataStruct(payload.wrap_into_any_payload()))) - } - } -} -#[cfg(feature = "icu_decimal")] -fn str_to_cow(s: &str) -> Cow<'static, str> { - if s.is_empty() { - Cow::default() - } else { - Cow::from(s.to_owned()) - } -} diff --git a/third_party/rust/icu_capi/src/date.rs b/third_party/rust/icu_capi/src/date.rs deleted file mode 100644 index 87a6810b7b36..000000000000 --- a/third_party/rust/icu_capi/src/date.rs +++ /dev/null @@ -1,288 +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] -pub mod ffi { - use alloc::boxed::Box; - use alloc::sync::Arc; - use core::fmt::Write; - use icu_calendar::types::IsoWeekday; - use icu_calendar::AnyCalendar; - use icu_calendar::{Date, Iso}; - use tinystr::TinyAsciiStr; - - use crate::calendar::ffi::ICU4XCalendar; - use crate::errors::ffi::ICU4XError; - - #[cfg(feature = "icu_calendar")] - use crate::week::ffi::ICU4XWeekCalculator; - - #[diplomat::enum_convert(IsoWeekday)] - pub enum ICU4XIsoWeekday { - Monday = 1, - Tuesday, - Wednesday, - Thursday, - Friday, - Saturday, - Sunday, - } - #[diplomat::opaque] - #[diplomat::transparent_convert] - /// An ICU4X Date object capable of containing a ISO-8601 date - #[diplomat::rust_link(icu::calendar::Date, Struct)] - pub struct ICU4XIsoDate(pub Date); - - impl ICU4XIsoDate { - /// Creates a new [`ICU4XIsoDate`] from the specified date and time. - #[diplomat::rust_link(icu::calendar::Date::try_new_iso_date, FnInStruct)] - pub fn create(year: i32, month: u8, day: u8) -> Result, ICU4XError> { - Ok(Box::new(ICU4XIsoDate(Date::try_new_iso_date( - year, month, day, - )?))) - } - - /// Convert this date to one in a different calendar - #[diplomat::rust_link(icu::calendar::Date::to_calendar, FnInStruct)] - pub fn to_calendar(&self, calendar: &ICU4XCalendar) -> Box { - Box::new(ICU4XDate(self.0.to_calendar(calendar.0.clone()))) - } - - #[diplomat::rust_link(icu::calendar::Date::to_any, FnInStruct)] - pub fn to_any(&self) -> Box { - Box::new(ICU4XDate(self.0.to_any().wrap_calendar_in_arc())) - } - - /// Returns the 1-indexed day in the month for this date - #[diplomat::rust_link(icu::calendar::Date::day_of_month, FnInStruct)] - pub fn day_of_month(&self) -> u32 { - self.0.day_of_month().0 - } - - /// Returns the day in the week for this day - #[diplomat::rust_link(icu::calendar::Date::day_of_week, FnInStruct)] - pub fn day_of_week(&self) -> ICU4XIsoWeekday { - self.0.day_of_week().into() - } - - /// Returns the week number in this month, 1-indexed, based on what - /// is considered the first day of the week (often a locale preference). - /// - /// `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - #[diplomat::rust_link(icu::calendar::Date::week_of_month, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_month, - FnInStruct, - hidden - )] - pub fn week_of_month(&self, first_weekday: ICU4XIsoWeekday) -> u32 { - self.0.week_of_month(first_weekday.into()).0 - } - - /// Returns the week number in this year, using week data - #[diplomat::rust_link(icu::calendar::Date::week_of_year, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_year, - FnInStruct, - hidden - )] - #[cfg(feature = "icu_calendar")] - pub fn week_of_year( - &self, - calculator: &ICU4XWeekCalculator, - ) -> Result { - Ok(self.0.week_of_year(&calculator.0)?.into()) - } - - /// Returns 1-indexed number of the month of this date in its year - #[diplomat::rust_link(icu::calendar::Date::month, FnInStruct)] - pub fn month(&self) -> u32 { - self.0.month().ordinal - } - - /// Returns the year number for this date - #[diplomat::rust_link(icu::calendar::Date::year, FnInStruct)] - pub fn year(&self) -> i32 { - self.0.year().number - } - - /// Returns the number of months in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::months_in_year, FnInStruct)] - pub fn months_in_year(&self) -> u8 { - self.0.months_in_year() - } - - /// Returns the number of days in the month represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_month, FnInStruct)] - pub fn days_in_month(&self) -> u8 { - self.0.days_in_month() - } - - /// Returns the number of days in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_year, FnInStruct)] - pub fn days_in_year(&self) -> u32 { - self.0.days_in_year() - } - } - - #[diplomat::opaque] - #[diplomat::transparent_convert] - /// An ICU4X Date object capable of containing a date and time for any calendar. - #[diplomat::rust_link(icu::calendar::Date, Struct)] - pub struct ICU4XDate(pub Date>); - - impl ICU4XDate { - /// Creates a new [`ICU4XDate`] representing the ISO date and time - /// given but in a given calendar - #[diplomat::rust_link(icu::calendar::Date::new_from_iso, FnInStruct)] - pub fn create_from_iso_in_calendar( - year: i32, - month: u8, - day: u8, - calendar: &ICU4XCalendar, - ) -> Result, ICU4XError> { - let cal = calendar.0.clone(); - Ok(Box::new(ICU4XDate( - Date::try_new_iso_date(year, month, day)?.to_calendar(cal), - ))) - } - - /// Creates a new [`ICU4XDate`] from the given codes, which are interpreted in the given calendar system - #[diplomat::rust_link(icu::calendar::Date::try_new_from_codes, FnInStruct)] - pub fn create_from_codes_in_calendar( - era_code: &str, - year: i32, - month_code: &str, - day: u8, - calendar: &ICU4XCalendar, - ) -> Result, ICU4XError> { - let era_code = era_code.as_bytes(); // #2520 - let month_code = month_code.as_bytes(); // #2520 - let era = TinyAsciiStr::from_bytes(era_code)?.into(); - let month = TinyAsciiStr::from_bytes(month_code)?.into(); - let cal = calendar.0.clone(); - Ok(Box::new(ICU4XDate(Date::try_new_from_codes( - era, year, month, day, cal, - )?))) - } - - /// Convert this date to one in a different calendar - #[diplomat::rust_link(icu::calendar::Date::to_calendar, FnInStruct)] - pub fn to_calendar(&self, calendar: &ICU4XCalendar) -> Box { - Box::new(ICU4XDate(self.0.to_calendar(calendar.0.clone()))) - } - - /// Converts this date to ISO - #[diplomat::rust_link(icu::calendar::Date::to_iso, FnInStruct)] - pub fn to_iso(&self) -> Box { - Box::new(ICU4XIsoDate(self.0.to_iso())) - } - - /// Returns the 1-indexed day in the month for this date - #[diplomat::rust_link(icu::calendar::Date::day_of_month, FnInStruct)] - pub fn day_of_month(&self) -> u32 { - self.0.day_of_month().0 - } - - /// Returns the day in the week for this day - #[diplomat::rust_link(icu::calendar::Date::day_of_week, FnInStruct)] - pub fn day_of_week(&self) -> ICU4XIsoWeekday { - self.0.day_of_week().into() - } - - /// Returns the week number in this month, 1-indexed, based on what - /// is considered the first day of the week (often a locale preference). - /// - /// `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - #[diplomat::rust_link(icu::calendar::Date::week_of_month, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_month, - FnInStruct, - hidden - )] - pub fn week_of_month(&self, first_weekday: ICU4XIsoWeekday) -> u32 { - self.0.week_of_month(first_weekday.into()).0 - } - - /// Returns the week number in this year, using week data - #[diplomat::rust_link(icu::calendar::Date::week_of_year, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_year, - FnInStruct, - hidden - )] - #[cfg(feature = "icu_calendar")] - pub fn week_of_year( - &self, - calculator: &ICU4XWeekCalculator, - ) -> Result { - Ok(self.0.week_of_year(&calculator.0)?.into()) - } - - /// Returns 1-indexed number of the month of this date in its year - /// - /// Note that for lunar calendars this may not lead to the same month - /// having the same ordinal month across years; use month_code if you care - /// about month identity. - #[diplomat::rust_link(icu::calendar::Date::month, FnInStruct)] - pub fn ordinal_month(&self) -> u32 { - self.0.month().ordinal - } - - /// Returns the month code for this date. Typically something - /// like "M01", "M02", but can be more complicated for lunar calendars. - #[diplomat::rust_link(icu::calendar::Date::month, FnInStruct)] - pub fn month_code( - &self, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let code = self.0.month().code; - write.write_str(&code.0)?; - Ok(()) - } - - /// Returns the year number in the current era for this date - #[diplomat::rust_link(icu::calendar::Date::year, FnInStruct)] - pub fn year_in_era(&self) -> i32 { - self.0.year().number - } - - /// Returns the era for this date, - #[diplomat::rust_link(icu::Date::year, FnInStruct)] - #[diplomat::rust_link(icu::types::Era, Struct, compact)] - pub fn era( - &self, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let era = self.0.year().era; - write.write_str(&era.0)?; - Ok(()) - } - - /// Returns the number of months in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::months_in_year, FnInStruct)] - pub fn months_in_year(&self) -> u8 { - self.0.months_in_year() - } - - /// Returns the number of days in the month represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_month, FnInStruct)] - pub fn days_in_month(&self) -> u8 { - self.0.days_in_month() - } - - /// Returns the number of days in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_year, FnInStruct)] - pub fn days_in_year(&self) -> u32 { - self.0.days_in_year() - } - - /// Returns the [`ICU4XCalendar`] object backing this date - #[diplomat::rust_link(icu::calendar::Date::calendar, FnInStruct)] - #[diplomat::rust_link(icu::calendar::Date::calendar_wrapper, FnInStruct, hidden)] - pub fn calendar(&self) -> Box { - Box::new(ICU4XCalendar(self.0.calendar_wrapper().clone())) - } - } -} diff --git a/third_party/rust/icu_capi/src/datetime.rs b/third_party/rust/icu_capi/src/datetime.rs deleted file mode 100644 index 768d7c968f35..000000000000 --- a/third_party/rust/icu_capi/src/datetime.rs +++ /dev/null @@ -1,408 +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] -pub mod ffi { - use alloc::boxed::Box; - use alloc::sync::Arc; - use core::convert::TryInto; - use core::fmt::Write; - - use icu_calendar::types::Time; - use icu_calendar::AnyCalendar; - use icu_calendar::{DateTime, Iso}; - use tinystr::TinyAsciiStr; - - use crate::calendar::ffi::ICU4XCalendar; - use crate::date::ffi::{ICU4XDate, ICU4XIsoDate, ICU4XIsoWeekday}; - use crate::errors::ffi::ICU4XError; - use crate::time::ffi::ICU4XTime; - - #[cfg(feature = "icu_calendar")] - use crate::week::ffi::ICU4XWeekCalculator; - - #[diplomat::opaque] - /// An ICU4X DateTime object capable of containing a ISO-8601 date and time. - #[diplomat::rust_link(icu::calendar::DateTime, Struct)] - pub struct ICU4XIsoDateTime(pub DateTime); - - impl ICU4XIsoDateTime { - /// Creates a new [`ICU4XIsoDateTime`] from the specified date and time. - #[diplomat::rust_link(icu::calendar::DateTime::try_new_iso_datetime, FnInStruct)] - pub fn create( - year: i32, - month: u8, - day: u8, - hour: u8, - minute: u8, - second: u8, - nanosecond: u32, - ) -> Result, ICU4XError> { - let mut dt = DateTime::try_new_iso_datetime(year, month, day, hour, minute, second)?; - dt.time.nanosecond = nanosecond.try_into()?; - Ok(Box::new(ICU4XIsoDateTime(dt))) - } - - /// Creates a new [`ICU4XIsoDateTime`] from an [`ICU4XIsoDate`] and [`ICU4XTime`] object - #[diplomat::rust_link(icu::calendar::DateTime::new, FnInStruct)] - pub fn crate_from_date_and_time( - date: &ICU4XIsoDate, - time: &ICU4XTime, - ) -> Box { - let dt = DateTime::new(date.0, time.0); - Box::new(ICU4XIsoDateTime(dt)) - } - - /// Construct from the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) - #[diplomat::rust_link( - icu::calendar::DateTime::from_minutes_since_local_unix_epoch, - FnInStruct - )] - pub fn create_from_minutes_since_local_unix_epoch(minutes: i32) -> Box { - Box::new(ICU4XIsoDateTime( - DateTime::from_minutes_since_local_unix_epoch(minutes), - )) - } - - /// Gets the date contained in this object - #[diplomat::rust_link(icu::calendar::DateTime::date, StructField)] - pub fn date(&self) -> Box { - Box::new(ICU4XIsoDate(self.0.date)) - } - - /// Gets the time contained in this object - #[diplomat::rust_link(icu::calendar::DateTime::time, StructField)] - pub fn time(&self) -> Box { - Box::new(ICU4XTime(self.0.time)) - } - - /// Converts this to an [`ICU4XDateTime`] capable of being mixed with dates of - /// other calendars - #[diplomat::rust_link(icu::calendar::DateTime::to_any, FnInStruct)] - #[diplomat::rust_link(icu::calendar::DateTime::new_from_iso, FnInStruct, hidden)] - pub fn to_any(&self) -> Box { - Box::new(ICU4XDateTime(self.0.to_any().wrap_calendar_in_arc())) - } - - /// Gets the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) - #[diplomat::rust_link(icu::calendar::DateTime::minutes_since_local_unix_epoch, FnInStruct)] - pub fn minutes_since_local_unix_epoch(&self) -> i32 { - self.0.minutes_since_local_unix_epoch() - } - - /// Convert this datetime to one in a different calendar - #[diplomat::rust_link(icu::calendar::DateTime::to_calendar, FnInStruct)] - pub fn to_calendar(&self, calendar: &ICU4XCalendar) -> Box { - Box::new(ICU4XDateTime(self.0.to_calendar(calendar.0.clone()))) - } - - /// Returns the hour in this time - #[diplomat::rust_link(icu::calendar::types::Time::hour, StructField)] - pub fn hour(&self) -> u8 { - self.0.time.hour.into() - } - /// Returns the minute in this time - #[diplomat::rust_link(icu::calendar::types::Time::minute, StructField)] - pub fn minute(&self) -> u8 { - self.0.time.minute.into() - } - /// Returns the second in this time - #[diplomat::rust_link(icu::calendar::types::Time::second, StructField)] - pub fn second(&self) -> u8 { - self.0.time.second.into() - } - /// Returns the nanosecond in this time - #[diplomat::rust_link(icu::calendar::types::Time::nanosecond, StructField)] - pub fn nanosecond(&self) -> u32 { - self.0.time.nanosecond.into() - } - - /// Returns the 1-indexed day in the month for this date - #[diplomat::rust_link(icu::calendar::Date::day_of_month, FnInStruct)] - pub fn day_of_month(&self) -> u32 { - self.0.date.day_of_month().0 - } - - /// Returns the day in the week for this day - #[diplomat::rust_link(icu::calendar::Date::day_of_week, FnInStruct)] - pub fn day_of_week(&self) -> ICU4XIsoWeekday { - self.0.date.day_of_week().into() - } - - /// Returns the week number in this month, 1-indexed, based on what - /// is considered the first day of the week (often a locale preference). - /// - /// `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - #[diplomat::rust_link(icu::calendar::Date::week_of_month, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_month, - FnInStruct, - hidden - )] - pub fn week_of_month(&self, first_weekday: ICU4XIsoWeekday) -> u32 { - self.0.date.week_of_month(first_weekday.into()).0 - } - - /// Returns the week number in this year, using week data - #[diplomat::rust_link(icu::calendar::Date::week_of_year, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_year, - FnInStruct, - hidden - )] - #[cfg(feature = "icu_calendar")] - pub fn week_of_year( - &self, - calculator: &ICU4XWeekCalculator, - ) -> Result { - Ok(self.0.date.week_of_year(&calculator.0)?.into()) - } - - /// Returns 1-indexed number of the month of this date in its year - #[diplomat::rust_link(icu::calendar::Date::month, FnInStruct)] - pub fn month(&self) -> u32 { - self.0.date.month().ordinal - } - - /// Returns the year number for this date - #[diplomat::rust_link(icu::calendar::Date::year, FnInStruct)] - pub fn year(&self) -> i32 { - self.0.date.year().number - } - - /// Returns the number of months in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::months_in_year, FnInStruct)] - pub fn months_in_year(&self) -> u8 { - self.0.date.months_in_year() - } - - /// Returns the number of days in the month represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_month, FnInStruct)] - pub fn days_in_month(&self) -> u8 { - self.0.date.days_in_month() - } - - /// Returns the number of days in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_year, FnInStruct)] - pub fn days_in_year(&self) -> u32 { - self.0.date.days_in_year() - } - } - - #[diplomat::opaque] - /// An ICU4X DateTime object capable of containing a date and time for any calendar. - #[diplomat::rust_link(icu::calendar::DateTime, Struct)] - pub struct ICU4XDateTime(pub DateTime>); - - impl ICU4XDateTime { - /// Creates a new [`ICU4XDateTime`] representing the ISO date and time - /// given but in a given calendar - #[diplomat::rust_link(icu::DateTime::new_from_iso, FnInStruct)] - #[allow(clippy::too_many_arguments)] - pub fn create_from_iso_in_calendar( - year: i32, - month: u8, - day: u8, - hour: u8, - minute: u8, - second: u8, - nanosecond: u32, - calendar: &ICU4XCalendar, - ) -> Result, ICU4XError> { - let cal = calendar.0.clone(); - let mut dt = DateTime::try_new_iso_datetime(year, month, day, hour, minute, second)?; - dt.time.nanosecond = nanosecond.try_into()?; - Ok(Box::new(ICU4XDateTime(dt.to_calendar(cal)))) - } - /// Creates a new [`ICU4XDateTime`] from the given codes, which are interpreted in the given calendar system - #[diplomat::rust_link(icu::calendar::DateTime::try_new_from_codes, FnInStruct)] - #[allow(clippy::too_many_arguments)] - pub fn create_from_codes_in_calendar( - era_code: &str, - year: i32, - month_code: &str, - day: u8, - hour: u8, - minute: u8, - second: u8, - nanosecond: u32, - calendar: &ICU4XCalendar, - ) -> Result, ICU4XError> { - let era_code = era_code.as_bytes(); // #2520 - let month_code = month_code.as_bytes(); // #2520 - let era = TinyAsciiStr::from_bytes(era_code)?.into(); - let month = TinyAsciiStr::from_bytes(month_code)?.into(); - let cal = calendar.0.clone(); - let hour = hour.try_into()?; - let minute = minute.try_into()?; - let second = second.try_into()?; - let nanosecond = nanosecond.try_into()?; - let time = Time { - hour, - minute, - second, - nanosecond, - }; - Ok(Box::new(ICU4XDateTime(DateTime::try_new_from_codes( - era, year, month, day, time, cal, - )?))) - } - /// Creates a new [`ICU4XDateTime`] from an [`ICU4XDate`] and [`ICU4XTime`] object - #[diplomat::rust_link(icu::calendar::DateTime::new, FnInStruct)] - pub fn create_from_date_and_time(date: &ICU4XDate, time: &ICU4XTime) -> Box { - let dt = DateTime::new(date.0.clone(), time.0); - Box::new(ICU4XDateTime(dt)) - } - - /// Gets a copy of the date contained in this object - #[diplomat::rust_link(icu::calendar::DateTime::date, StructField)] - pub fn date(&self) -> Box { - Box::new(ICU4XDate(self.0.date.clone())) - } - - /// Gets the time contained in this object - #[diplomat::rust_link(icu::calendar::DateTime::time, StructField)] - pub fn time(&self) -> Box { - Box::new(ICU4XTime(self.0.time)) - } - - /// Converts this date to ISO - #[diplomat::rust_link(icu::calendar::DateTime::to_iso, FnInStruct)] - pub fn to_iso(&self) -> Box { - Box::new(ICU4XIsoDateTime(self.0.to_iso())) - } - - /// Convert this datetime to one in a different calendar - #[diplomat::rust_link(icu::calendar::DateTime::to_calendar, FnInStruct)] - pub fn to_calendar(&self, calendar: &ICU4XCalendar) -> Box { - Box::new(ICU4XDateTime(self.0.to_calendar(calendar.0.clone()))) - } - - /// Returns the hour in this time - #[diplomat::rust_link(icu::calendar::types::Time::hour, StructField)] - pub fn hour(&self) -> u8 { - self.0.time.hour.into() - } - /// Returns the minute in this time - #[diplomat::rust_link(icu::calendar::types::Time::minute, StructField)] - pub fn minute(&self) -> u8 { - self.0.time.minute.into() - } - /// Returns the second in this time - #[diplomat::rust_link(icu::calendar::types::Time::second, StructField)] - pub fn second(&self) -> u8 { - self.0.time.second.into() - } - /// Returns the nanosecond in this time - #[diplomat::rust_link(icu::calendar::types::Time::nanosecond, StructField)] - pub fn nanosecond(&self) -> u32 { - self.0.time.nanosecond.into() - } - - /// Returns the 1-indexed day in the month for this date - #[diplomat::rust_link(icu::calendar::Date::day_of_month, FnInStruct)] - pub fn day_of_month(&self) -> u32 { - self.0.date.day_of_month().0 - } - - /// Returns the day in the week for this day - #[diplomat::rust_link(icu::calendar::Date::day_of_week, FnInStruct)] - pub fn day_of_week(&self) -> ICU4XIsoWeekday { - self.0.date.day_of_week().into() - } - - /// Returns the week number in this month, 1-indexed, based on what - /// is considered the first day of the week (often a locale preference). - /// - /// `first_weekday` can be obtained via `first_weekday()` on [`ICU4XWeekCalculator`] - #[diplomat::rust_link(icu::calendar::Date::week_of_month, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_month, - FnInStruct, - hidden - )] - pub fn week_of_month(&self, first_weekday: ICU4XIsoWeekday) -> u32 { - self.0.date.week_of_month(first_weekday.into()).0 - } - - /// Returns the week number in this year, using week data - #[diplomat::rust_link(icu::calendar::Date::week_of_year, FnInStruct)] - #[diplomat::rust_link( - icu::calendar::week::WeekCalculator::week_of_year, - FnInStruct, - hidden - )] - #[cfg(feature = "icu_calendar")] - pub fn week_of_year( - &self, - calculator: &ICU4XWeekCalculator, - ) -> Result { - Ok(self.0.date.week_of_year(&calculator.0)?.into()) - } - - /// Returns 1-indexed number of the month of this date in its year - /// - /// Note that for lunar calendars this may not lead to the same month - /// having the same ordinal month across years; use month_code if you care - /// about month identity. - #[diplomat::rust_link(icu::calendar::Date::month, FnInStruct)] - pub fn ordinal_month(&self) -> u32 { - self.0.date.month().ordinal - } - - /// Returns the month code for this date. Typically something - /// like "M01", "M02", but can be more complicated for lunar calendars. - #[diplomat::rust_link(icu::calendar::Date::month, FnInStruct)] - pub fn month_code( - &self, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let code = self.0.date.month().code; - write.write_str(&code.0)?; - Ok(()) - } - - /// Returns the year number in the current era for this date - #[diplomat::rust_link(icu::calendar::Date::year, FnInStruct)] - pub fn year_in_era(&self) -> i32 { - self.0.date.year().number - } - - /// Returns the era for this date, - #[diplomat::rust_link(icu::calendar::Date::year, FnInStruct)] - pub fn era( - &self, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let era = self.0.date.year().era; - write.write_str(&era.0)?; - Ok(()) - } - - /// Returns the number of months in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::months_in_year, FnInStruct)] - pub fn months_in_year(&self) -> u8 { - self.0.date.months_in_year() - } - - /// Returns the number of days in the month represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_month, FnInStruct)] - pub fn days_in_month(&self) -> u8 { - self.0.date.days_in_month() - } - - /// Returns the number of days in the year represented by this date - #[diplomat::rust_link(icu::calendar::Date::days_in_year, FnInStruct)] - pub fn days_in_year(&self) -> u32 { - self.0.date.days_in_year() - } - - /// Returns the [`ICU4XCalendar`] object backing this date - #[diplomat::rust_link(icu::calendar::Date::calendar, FnInStruct)] - #[diplomat::rust_link(icu::calendar::Date::calendar_wrapper, FnInStruct, hidden)] - pub fn calendar(&self) -> Box { - Box::new(ICU4XCalendar(self.0.date.calendar_wrapper().clone())) - } - } -} diff --git a/third_party/rust/icu_capi/src/datetime_formatter.rs b/third_party/rust/icu_capi/src/datetime_formatter.rs deleted file mode 100644 index 7b65ee12c317..000000000000 --- a/third_party/rust/icu_capi/src/datetime_formatter.rs +++ /dev/null @@ -1,350 +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] -pub mod ffi { - use alloc::boxed::Box; - use icu_calendar::{Date, DateTime, Gregorian}; - use icu_datetime::{ - options::length, DateFormatter, DateTimeFormatter, TimeFormatter, TypedDateFormatter, - TypedDateTimeFormatter, - }; - - use crate::{ - date::ffi::{ICU4XDate, ICU4XIsoDate}, - datetime::ffi::ICU4XDateTime, - datetime::ffi::ICU4XIsoDateTime, - errors::ffi::ICU4XError, - locale::ffi::ICU4XLocale, - provider::ffi::ICU4XDataProvider, - time::ffi::ICU4XTime, - }; - use writeable::Writeable; - - #[diplomat::opaque] - /// An ICU4X TimeFormatter object capable of formatting an [`ICU4XTime`] type (and others) as a string - #[diplomat::rust_link(icu::datetime::TimeFormatter, Struct)] - // TODO(#2153) - Rename to ICU4XTimeFormatter when we remove the dependency on calendar - // from TimeFormatter. - pub struct ICU4XTimeFormatter(pub TimeFormatter); - - #[diplomat::enum_convert(length::Time, needs_wildcard)] - #[diplomat::rust_link(icu::datetime::options::length::Time, Enum)] - pub enum ICU4XTimeLength { - Full, - Long, - Medium, - Short, - } - - impl ICU4XTimeFormatter { - /// Creates a new [`ICU4XTimeFormatter`] from locale data. - #[diplomat::rust_link( - icu::datetime::TimeFormatter::try_new_with_length_unstable, - FnInStruct - )] - pub fn create_with_length( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - length: ICU4XTimeLength, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - - Ok(Box::new(ICU4XTimeFormatter( - TimeFormatter::try_new_with_length_unstable(&provider.0, &locale, length.into())?, - ))) - } - - /// Formats a [`ICU4XTime`] to a string. - #[diplomat::rust_link(icu::datetime::TimeFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::TimeFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_time( - &self, - value: &ICU4XTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0).write_to(write)?; - Ok(()) - } - - /// Formats a [`ICU4XDateTime`] to a string. - #[diplomat::rust_link(icu::datetime::TimeFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::TimeFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_datetime( - &self, - value: &ICU4XDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0).write_to(write)?; - Ok(()) - } - - /// Formats a [`ICU4XIsoDateTime`] to a string. - #[diplomat::rust_link(icu::datetime::TimeFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::TimeFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_iso_datetime( - &self, - value: &ICU4XIsoDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0).write_to(write)?; - Ok(()) - } - } - - #[diplomat::opaque] - /// An ICU4X TypedDateFormatter object capable of formatting a [`ICU4XIsoDateTime`] as a string, - /// using the Gregorian Calendar. - #[diplomat::rust_link(icu::datetime::TypedDateFormatter, Struct)] - pub struct ICU4XGregorianDateFormatter(pub TypedDateFormatter); - - #[diplomat::enum_convert(length::Date, needs_wildcard)] - #[diplomat::rust_link(icu::datetime::options::length::Date, Enum)] - pub enum ICU4XDateLength { - Full, - Long, - Medium, - Short, - } - - impl ICU4XGregorianDateFormatter { - /// Creates a new [`ICU4XGregorianDateFormatter`] from locale data. - #[diplomat::rust_link( - icu::datetime::TypedDateFormatter::try_new_with_length_unstable, - FnInStruct - )] - pub fn create_with_length( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - length: ICU4XDateLength, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - - Ok(Box::new(ICU4XGregorianDateFormatter( - TypedDateFormatter::try_new_with_length_unstable( - &provider.0, - &locale, - length.into(), - )?, - ))) - } - - /// Formats a [`ICU4XIsoDate`] to a string. - #[diplomat::rust_link(icu::datetime::TypedDateFormatter::format, FnInStruct)] - #[diplomat::rust_link( - icu::datetime::TypedDateFormatter::format_to_string, - FnInStruct, - hidden - )] - pub fn format_iso_date( - &self, - value: &ICU4XIsoDate, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let greg = Date::new_from_iso(value.0, Gregorian); - self.0.format(&greg).write_to(write)?; - Ok(()) - } - /// Formats a [`ICU4XIsoDateTime`] to a string. - #[diplomat::rust_link(icu::datetime::TypedDateFormatter::format, FnInStruct)] - #[diplomat::rust_link( - icu::datetime::TypedDateFormatter::format_to_string, - FnInStruct, - hidden - )] - pub fn format_iso_datetime( - &self, - value: &ICU4XIsoDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let greg = DateTime::new_from_iso(value.0, Gregorian); - self.0.format(&greg).write_to(write)?; - Ok(()) - } - } - - #[diplomat::opaque] - /// An ICU4X TypedDateTimeFormatter object capable of formatting a [`ICU4XIsoDateTime`] as a string, - /// using the Gregorian Calendar. - #[diplomat::rust_link(icu::datetime::TypedDateTimeFormatter, Struct)] - pub struct ICU4XGregorianDateTimeFormatter(pub TypedDateTimeFormatter); - - impl ICU4XGregorianDateTimeFormatter { - /// Creates a new [`ICU4XGregorianDateFormatter`] from locale data. - #[diplomat::rust_link(icu::datetime::TypedDateTimeFormatter::try_new_unstable, FnInStruct)] - pub fn create_with_lengths( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - date_length: ICU4XDateLength, - time_length: ICU4XTimeLength, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - - let options = length::Bag::from_date_time_style(date_length.into(), time_length.into()); - - Ok(Box::new(ICU4XGregorianDateTimeFormatter( - TypedDateTimeFormatter::try_new_unstable(&provider.0, &locale, options.into())?, - ))) - } - - /// Formats a [`ICU4XIsoDateTime`] to a string. - #[diplomat::rust_link(icu::datetime::TypedDateTimeFormatter::format, FnInStruct)] - #[diplomat::rust_link( - icu::datetime::TypedDateTimeFormatter::format_to_string, - FnInStruct, - hidden - )] - pub fn format_iso_datetime( - &self, - value: &ICU4XIsoDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let greg = DateTime::new_from_iso(value.0, Gregorian); - self.0.format(&greg).write_to(write)?; - Ok(()) - } - } - - #[diplomat::opaque] - /// An ICU4X DateFormatter object capable of formatting a [`ICU4XDate`] as a string, - /// using some calendar specified at runtime in the locale. - #[diplomat::rust_link(icu::datetime::DateFormatter, Struct)] - pub struct ICU4XDateFormatter(pub DateFormatter); - - impl ICU4XDateFormatter { - /// Creates a new [`ICU4XDateFormatter`] from locale data. - #[diplomat::rust_link( - icu::datetime::DateFormatter::try_new_with_length_unstable, - FnInStruct - )] - pub fn create_with_length( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - date_length: ICU4XDateLength, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - - Ok(Box::new(ICU4XDateFormatter( - DateFormatter::try_new_with_length_unstable( - &provider.0, - &locale, - date_length.into(), - )?, - ))) - } - - /// Formats a [`ICU4XDate`] to a string. - #[diplomat::rust_link(icu::datetime::DateFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::DateFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_date( - &self, - value: &ICU4XDate, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0)?.write_to(write)?; - Ok(()) - } - - /// Formats a [`ICU4XIsoDate`] to a string. - /// - /// Will convert to this formatter's calendar first - #[diplomat::rust_link(icu::datetime::DateFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::DateFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_iso_date( - &self, - value: &ICU4XIsoDate, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let any = value.0.to_any(); - self.0.format(&any)?.write_to(write)?; - Ok(()) - } - - /// Formats a [`ICU4XDateTime`] to a string. - #[diplomat::rust_link(icu::datetime::DateFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::DateFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_datetime( - &self, - value: &ICU4XDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0)?.write_to(write)?; - Ok(()) - } - - /// Formats a [`ICU4XIsoDateTime`] to a string. - /// - /// Will convert to this formatter's calendar first - #[diplomat::rust_link(icu::datetime::DateFormatter::format, FnInStruct)] - #[diplomat::rust_link(icu::datetime::DateFormatter::format_to_string, FnInStruct, hidden)] - pub fn format_iso_datetime( - &self, - value: &ICU4XIsoDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let any = value.0.to_any(); - self.0.format(&any)?.write_to(write)?; - Ok(()) - } - } - - #[diplomat::opaque] - /// An ICU4X DateFormatter object capable of formatting a [`ICU4XDateTime`] as a string, - /// using some calendar specified at runtime in the locale. - #[diplomat::rust_link(icu::datetime::DateTimeFormatter, Struct)] - pub struct ICU4XDateTimeFormatter(pub DateTimeFormatter); - - impl ICU4XDateTimeFormatter { - /// Creates a new [`ICU4XDateTimeFormatter`] from locale data. - #[diplomat::rust_link(icu::datetime::DateTimeFormatter::try_new_unstable, FnInStruct)] - pub fn create_with_lengths( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - date_length: ICU4XDateLength, - time_length: ICU4XTimeLength, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - let options = length::Bag::from_date_time_style(date_length.into(), time_length.into()); - - Ok(Box::new(ICU4XDateTimeFormatter( - DateTimeFormatter::try_new_unstable(&provider.0, &locale, options.into())?, - ))) - } - - /// Formats a [`ICU4XDateTime`] to a string. - #[diplomat::rust_link(icu::datetime::DateTimeFormatter::format, FnInStruct)] - #[diplomat::rust_link( - icu::datetime::DateTimeFormatter::format_to_string, - FnInStruct, - hidden - )] - pub fn format_datetime( - &self, - value: &ICU4XDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0)?.write_to(write)?; - Ok(()) - } - - /// Formats a [`ICU4XIsoDateTime`] to a string. - /// - /// Will convert to this formatter's calendar first - #[diplomat::rust_link(icu::datetime::DateTimeFormatter::format, FnInStruct)] - #[diplomat::rust_link( - icu::datetime::DateTimeFormatter::format_to_string, - FnInStruct, - hidden - )] - pub fn format_iso_datetime( - &self, - value: &ICU4XIsoDateTime, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - let any = value.0.to_any(); - self.0.format(&any)?.write_to(write)?; - Ok(()) - } - } -} diff --git a/third_party/rust/icu_capi/src/decimal.rs b/third_party/rust/icu_capi/src/decimal.rs deleted file mode 100644 index 7a55ad91629b..000000000000 --- a/third_party/rust/icu_capi/src/decimal.rs +++ /dev/null @@ -1,108 +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] -pub mod ffi { - use alloc::boxed::Box; - use icu_decimal::{ - options::{FixedDecimalFormatterOptions, GroupingStrategy}, - provider::DecimalSymbolsV1Marker, - FixedDecimalFormatter, - }; - use icu_locid::Locale; - use icu_provider::DataProvider; - use icu_provider_adapters::any_payload::AnyPayloadProvider; - use writeable::Writeable; - - use crate::{ - data_struct::ffi::ICU4XDataStruct, errors::ffi::ICU4XError, - fixed_decimal::ffi::ICU4XFixedDecimal, locale::ffi::ICU4XLocale, - provider::ffi::ICU4XDataProvider, - }; - - #[diplomat::opaque] - /// An ICU4X Fixed Decimal Format object, capable of formatting a [`ICU4XFixedDecimal`] as a string. - #[diplomat::rust_link(icu::decimal::FixedDecimalFormatter, Struct)] - pub struct ICU4XFixedDecimalFormatter(pub FixedDecimalFormatter); - - #[diplomat::rust_link(icu::decimal::options::GroupingStrategy, Enum)] - pub enum ICU4XFixedDecimalGroupingStrategy { - Auto, - Never, - Always, - Min2, - } - - impl ICU4XFixedDecimalFormatter { - /// Creates a new [`ICU4XFixedDecimalFormatter`] from locale data. - #[diplomat::rust_link(icu::decimal::FixedDecimalFormatter::try_new_unstable, FnInStruct)] - pub fn create_with_grouping_strategy( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - grouping_strategy: ICU4XFixedDecimalGroupingStrategy, - ) -> Result, ICU4XError> { - Self::try_new_impl(&provider.0, locale, grouping_strategy) - } - - /// Creates a new [`ICU4XFixedDecimalFormatter`] from preconstructed locale data in the form of an [`ICU4XDataStruct`] - /// constructed from `ICU4XDataStruct::create_decimal_symbols()`. - /// - /// The contents of the data struct will be consumed: if you wish to use the struct again it will have to be reconstructed. - /// Passing a consumed struct to this method will return an error. - pub fn create_with_decimal_symbols_v1( - data_struct: &ICU4XDataStruct, - grouping_strategy: ICU4XFixedDecimalGroupingStrategy, - ) -> Result, ICU4XError> { - use icu_provider::AsDowncastingAnyProvider; - let provider = AnyPayloadProvider::from_any_payload::( - // Note: This clone is free, since cloning AnyPayload is free. - data_struct.0.clone(), - ); - Self::try_new_impl( - &provider.as_downcasting(), - &ICU4XLocale(Locale::UND), - grouping_strategy, - ) - } - - fn try_new_impl( - provider: &D, - locale: &ICU4XLocale, - grouping_strategy: ICU4XFixedDecimalGroupingStrategy, - ) -> Result, ICU4XError> - where - D: DataProvider + ?Sized, - { - let locale = locale.to_datalocale(); - - let grouping_strategy = match grouping_strategy { - ICU4XFixedDecimalGroupingStrategy::Auto => GroupingStrategy::Auto, - ICU4XFixedDecimalGroupingStrategy::Never => GroupingStrategy::Never, - ICU4XFixedDecimalGroupingStrategy::Always => GroupingStrategy::Always, - ICU4XFixedDecimalGroupingStrategy::Min2 => GroupingStrategy::Min2, - }; - let mut options = FixedDecimalFormatterOptions::default(); - options.grouping_strategy = grouping_strategy; - Ok(Box::new(ICU4XFixedDecimalFormatter( - FixedDecimalFormatter::try_new_unstable(provider, &locale, options)?, - ))) - } - - /// Formats a [`ICU4XFixedDecimal`] to a string. - #[diplomat::rust_link(icu::decimal::FixedDecimalFormatter::format, FnInStruct)] - #[diplomat::rust_link( - icu::decimal::FixedDecimalFormatter::format_to_string, - FnInStruct, - hidden - )] - pub fn format( - &self, - value: &ICU4XFixedDecimal, - write: &mut diplomat_runtime::DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.format(&value.0).write_to(write)?; - Ok(()) - } - } -} diff --git a/third_party/rust/icu_capi/src/displaynames.rs b/third_party/rust/icu_capi/src/displaynames.rs deleted file mode 100644 index be320fbf0a9c..000000000000 --- a/third_party/rust/icu_capi/src/displaynames.rs +++ /dev/null @@ -1,147 +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] -pub mod ffi { - use crate::errors::ffi::ICU4XError; - use crate::locale::ffi::ICU4XLocale; - use crate::provider::ffi::ICU4XDataProvider; - use alloc::boxed::Box; - use diplomat_runtime::DiplomatWriteable; - #[allow(unused_imports)] // feature-specific - use icu_displaynames::{DisplayNamesOptions, Fallback, LanguageDisplay}; - use icu_displaynames::{LocaleDisplayNamesFormatter, RegionDisplayNames}; - use icu_locid::subtags::Region; - use writeable::Writeable; - - // FFI version of `LocaleDisplayNamesFormatter`. - #[diplomat::opaque] - #[diplomat::rust_link(icu::displaynames::LocaleDisplayNamesFormatter, Struct)] - pub struct ICU4XLocaleDisplayNamesFormatter(pub LocaleDisplayNamesFormatter); - - // FFI version of `RegionDisplayNames`. - #[diplomat::opaque] - #[diplomat::rust_link(icu::displaynames::RegionDisplayNames, Struct)] - pub struct ICU4XRegionDisplayNames(pub RegionDisplayNames); - - // FFI version of `DisplayNamesOptions`. - #[diplomat::rust_link(icu::displaynames::options::DisplayNamesOptions, Struct)] - pub struct ICU4XDisplayNamesOptionsV1 { - /// The optional formatting style to use for display name. - pub style: ICU4XDisplayNamesStyle, - /// The fallback return when the system does not have the - /// requested display name, defaults to "code". - pub fallback: ICU4XDisplayNamesFallback, - /// The language display kind, defaults to "dialect". - pub language_display: ICU4XLanguageDisplay, - } - - // FFI version of `Style` option for the display names. - #[diplomat::rust_link(icu::displaynames::options::Style, Enum)] - pub enum ICU4XDisplayNamesStyle { - Auto, - Narrow, - Short, - Long, - Menu, - } - - // FFI version of `Fallback` option for the display names. - #[diplomat::rust_link(icu::displaynames::options::Fallback, Enum)] - #[diplomat::enum_convert(Fallback, needs_wildcard)] - pub enum ICU4XDisplayNamesFallback { - Code, - None, - } - - // FFI version of `LanguageDisplay`. - #[diplomat::rust_link(icu::displaynames::options::LanguageDisplay, Enum)] - #[diplomat::enum_convert(LanguageDisplay, needs_wildcard)] - pub enum ICU4XLanguageDisplay { - Dialect, - Standard, - } - - impl ICU4XLocaleDisplayNamesFormatter { - /// Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag. - #[diplomat::rust_link( - icu::displaynames::LocaleDisplayNamesFormatter::try_new_unstable, - FnInStruct - )] - pub fn try_new_unstable( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - options: ICU4XDisplayNamesOptionsV1, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - let options = DisplayNamesOptions::from(options); - - Ok(Box::new(ICU4XLocaleDisplayNamesFormatter( - LocaleDisplayNamesFormatter::try_new_unstable(&provider.0, &locale, options)?, - ))) - } - - /// Returns the locale-specific display name of a locale. - #[diplomat::rust_link(icu::displaynames::LocaleDisplayNamesFormatter::of, FnInStruct)] - pub fn of( - &self, - locale: &ICU4XLocale, - write: &mut DiplomatWriteable, - ) -> Result<(), ICU4XError> { - self.0.of(&locale.0).write_to(write)?; - Ok(()) - } - } - - impl ICU4XRegionDisplayNames { - /// Creates a new `RegionDisplayNames` from locale data and an options bag. - #[diplomat::rust_link(icu::displaynames::RegionDisplayNames::try_new_unstable, FnInStruct)] - pub fn try_new_unstable( - provider: &ICU4XDataProvider, - locale: &ICU4XLocale, - ) -> Result, ICU4XError> { - let locale = locale.to_datalocale(); - Ok(Box::new(ICU4XRegionDisplayNames( - RegionDisplayNames::try_new_unstable(&provider.0, &locale, Default::default())?, - ))) - } - - /// Returns the locale specific display name of a region. - /// Note that the funtion returns an empty string in case the display name for a given - /// region code is not found. - #[diplomat::rust_link(icu::displaynames::RegionDisplayNames::of, FnInStruct)] - pub fn of(&self, region: &str, write: &mut DiplomatWriteable) -> Result<(), ICU4XError> { - self.0 - .of(region.parse::()?) - .unwrap_or("") - .write_to(write)?; - Ok(()) - } - } -} - -#[allow(unused_imports)] // feature-specific -use icu_displaynames::{DisplayNamesOptions, Fallback, LanguageDisplay, Style}; - -impl From for Option