1 // This file is part of ICU4X. For terms of use, please see the file
2 // called LICENSE at the top level of the ICU4X source tree
3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
5 // https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
6 #![cfg_attr(not(feature = "std"), no_std)]
10 clippy::indexing_slicing,
14 // Exhaustiveness and Debug is not required for Diplomat types
17 // Diplomat limitations
19 clippy::needless_lifetimes,
20 clippy::result_unit_err,
21 clippy::should_implement_trait
24 //! This crate contains the source of truth for the [Diplomat](https://github.com/rust-diplomat/diplomat)-generated
25 //! FFI bindings. This generates the C, C++, JavaScript, and TypeScript bindings. This crate also contains the `extern "C"`
28 //! While the types in this crate are public, APIs from this crate are *not intended to be used from Rust*
29 //! and as such this crate may unpredictably change its Rust API across compatible semver versions. The `extern "C"` APIs exposed
30 //! by this crate, while not directly documented, are stable within the same major semver version, as are the bindings exposed under
31 //! the `cpp/` and `js/` folders.
33 //! This crate may still be explored for documentation on docs.rs, and there are language-specific docs available as well.
34 //! C++, Dart, and TypeScript headers contain inline documentation, which is available pre-rendered: [C++], [TypeScript].
36 //! This crate is `no_std`-compatible. If you wish to use it in `no_std` mode, you must write a wrapper crate that defines an allocator
37 //! and a panic hook in order to compile as a C library.
39 //! More information on using ICU4X from C++ can be found in [our tutorial].
41 //! [our tutorial]: https://github.com/unicode-org/icu4x/blob/main/tutorials/cpp.md
42 //! [TypeScript]: https://unicode-org.github.io/icu4x/tsdoc
43 //! [C++]: https://unicode-org.github.io/icu4x/cppdoc
45 // Renamed so you can't accidentally use it
46 #[cfg(target_arch = "wasm32")]
47 extern crate std as rust_std;
49 #[cfg(all(not(feature = "std"), feature = "looping_panic_handler"))]
51 fn panic(_info: &core::panic::PanicInfo) -> ! {
56 #[cfg(all(not(feature = "std"), feature = "libc_alloc"))]
57 extern crate libc_alloc;
65 #[cfg(feature = "logging")]
73 #[cfg(feature = "icu_properties")]
76 feature = "icu_datetime",
77 feature = "icu_timezone",
78 feature = "icu_calendar"
81 #[cfg(feature = "icu_casemap")]
83 #[cfg(feature = "icu_collator")]
85 #[cfg(feature = "icu_properties")]
86 pub mod collections_sets;
88 feature = "icu_datetime",
89 feature = "icu_timezone",
90 feature = "icu_calendar"
94 feature = "icu_datetime",
95 feature = "icu_timezone",
96 feature = "icu_calendar"
99 #[cfg(feature = "icu_datetime")]
100 pub mod datetime_formatter;
101 #[cfg(feature = "icu_decimal")]
103 #[cfg(feature = "experimental_components")]
104 pub mod displaynames;
105 #[cfg(feature = "icu_locid_transform")]
107 #[cfg(feature = "icu_decimal")]
108 pub mod fixed_decimal;
109 #[cfg(any(feature = "icu_datetime", feature = "icu_timezone"))]
110 pub mod iana_bcp47_mapper;
111 #[cfg(feature = "icu_list")]
113 #[cfg(feature = "icu_locid_transform")]
114 pub mod locale_directionality;
115 #[cfg(feature = "icu_locid_transform")]
116 pub mod locid_transform;
117 #[cfg(feature = "icu_timezone")]
118 pub mod metazone_calculator;
119 #[cfg(feature = "icu_normalizer")]
121 #[cfg(feature = "icu_normalizer")]
122 pub mod normalizer_properties;
123 #[cfg(feature = "icu_plurals")]
125 #[cfg(feature = "icu_properties")]
126 pub mod properties_iter;
127 #[cfg(feature = "icu_properties")]
128 pub mod properties_maps;
129 #[cfg(feature = "icu_properties")]
130 pub mod properties_names;
131 #[cfg(feature = "icu_properties")]
132 pub mod properties_sets;
133 #[cfg(feature = "icu_properties")]
134 pub mod properties_unisets;
135 #[cfg(feature = "icu_properties")]
137 #[cfg(feature = "icu_segmenter")]
138 pub mod segmenter_grapheme;
139 #[cfg(feature = "icu_segmenter")]
140 pub mod segmenter_line;
141 #[cfg(feature = "icu_segmenter")]
142 pub mod segmenter_sentence;
143 #[cfg(feature = "icu_segmenter")]
144 pub mod segmenter_word;
146 feature = "icu_datetime",
147 feature = "icu_timezone",
148 feature = "icu_calendar"
151 #[cfg(any(feature = "icu_datetime", feature = "icu_timezone"))]
153 #[cfg(feature = "icu_datetime")]
154 pub mod timezone_formatter;
155 #[cfg(any(feature = "icu_datetime", feature = "icu_timezone"))]
156 pub mod timezone_mapper;
157 #[cfg(feature = "experimental_components")]
158 pub mod units_converter;
159 #[cfg(feature = "icu_calendar")]
161 #[cfg(feature = "icu_datetime")]
162 pub mod zoned_formatter;