bidi.rs |
|
6731 |
code_point_map.rs |
|
14827 |
code_point_set.rs |
|
14741 |
emoji.rs |
|
6656 |
lib.rs |
Definitions of [Unicode Properties] and APIs for
retrieving property data in an appropriate data structure.
This module is published as its own crate ([`icu_properties`](https://docs.rs/icu_properties/latest/icu_properties/))
and as part of the [`icu`](https://docs.rs/icu/latest/icu/) crate. See the latter for more details on the ICU4X project.
APIs that return a [`CodePointSetData`] exist for binary properties and certain enumerated
properties.
APIs that return a [`CodePointMapData`] exist for certain enumerated properties.
# Examples
## Property data as `CodePointSetData`s
```
use icu::properties::{CodePointSetData, CodePointMapData};
use icu::properties::props::{GeneralCategory, Emoji};
// A binary property as a `CodePointSetData`
assert!(CodePointSetData::new::<Emoji>().contains('🎃')); // U+1F383 JACK-O-LANTERN
assert!(!CodePointSetData::new::<Emoji>().contains('木')); // U+6728
// An individual enumerated property value as a `CodePointSetData`
let line_sep_data = CodePointMapData::<GeneralCategory>::new()
.get_set_for_value(GeneralCategory::LineSeparator);
let line_sep = line_sep_data.as_borrowed();
assert!(line_sep.contains('\u{2028}'));
assert!(!line_sep.contains('\u{2029}'));
```
## Property data as `CodePointMapData`s
```
use icu::properties::CodePointMapData;
use icu::properties::props::Script;
assert_eq!(CodePointMapData::<Script>::new().get('🎃'), Script::Common); // U+1F383 JACK-O-LANTERN
assert_eq!(CodePointMapData::<Script>::new().get('木'), Script::Han); // U+6728
```
[`ICU4X`]: ../icu/index.html
[Unicode Properties]: https://unicode-org.github.io/icu/userguide/strings/properties.html
[`CodePointSetData`]: crate::CodePointSetData
[`CodePointMapData`]: crate::CodePointMapData |
3424 |
names.rs |
|
32784 |
props.rs |
This module defines all available properties.
Properties may be empty marker types and implement [`BinaryProperty`], or enumerations[^1]
and implement [`EnumeratedProperty`].
[`BinaryProperty`]s are queried through a [`CodePointSetData`](crate::CodePointSetData),
while [`EnumeratedProperty`]s are queried through [`CodePointMapData`](crate::CodePointMapData).
In addition, some [`EnumeratedProperty`]s also implement [`ParseableEnumeratedProperty`] or
[`NamedEnumeratedProperty`]. For these properties, [`PropertyParser`](crate::PropertyParser),
[`PropertyNamesLong`](crate::PropertyNamesLong), and [`PropertyNamesShort`](crate::PropertyNamesShort)
can be constructed.
[^1]: either Rust `enum`s, or Rust `struct`s with associated constants (open enums) |
125423 |
provider |
|
|
provider.rs |
🚧 \[Unstable\] Data provider struct definitions for this ICU4X component.
<div class="stab unstable">
🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. While the serde representation of data structs is guaranteed
to be stable, their Rust representation might not be. Use with caution.
</div>
Read more about data providers: [`icu_provider`] |
41421 |
runtime.rs |
🚧 \[Experimental\] This module is experimental and currently crate-private. Let us know if you
have a use case for this!
This module contains utilities for working with properties where the specific property in use
is not known at compile time.
For regex engines, [`crate::sets::load_for_ecma262_unstable()`] is a convenient API for working
with properties at runtime tailored for the use case of ECMA262-compatible regex engines. |
25541 |
script.rs |
Data and APIs for supporting Script_Extensions property
values in an efficient structure. |
27292 |
trievalue.rs |
|
9016 |