Struct icu_properties::runtime::UnicodeProperty
source · pub struct UnicodeProperty(pub u32);
Expand description
This type can represent any Unicode property.
This is intended to be used in situations where the exact unicode property needed is only known at runtime, for example in regex engines.
The values are intended to be identical to ICU4C’s UProperty enum
Tuple Fields§
§0: u32
Implementations§
source§impl UnicodeProperty
impl UnicodeProperty
sourcepub const Alphabetic: Self = _
pub const Alphabetic: Self = _
Binary property Alphabetic
sourcepub const AsciiHexDigit: Self = _
pub const AsciiHexDigit: Self = _
Binary property ASCII_Hex_Digit
sourcepub const BidiControl: Self = _
pub const BidiControl: Self = _
Binary property Bidi_Control
sourcepub const BidiMirrored: Self = _
pub const BidiMirrored: Self = _
Binary property Bidi_Mirrored
sourcepub const DefaultIgnorableCodePoint: Self = _
pub const DefaultIgnorableCodePoint: Self = _
Binary property Default_Ignorable_Code_Point
sourcepub const Deprecated: Self = _
pub const Deprecated: Self = _
Binary property Deprecated
sourcepub const FullCompositionExclusion: Self = _
pub const FullCompositionExclusion: Self = _
Binary property Full_Composition_Exclusion
sourcepub const GraphemeBase: Self = _
pub const GraphemeBase: Self = _
Binary property Grapheme_Base
sourcepub const GraphemeExtend: Self = _
pub const GraphemeExtend: Self = _
Binary property Grapheme_Extend
sourcepub const GraphemeLink: Self = _
pub const GraphemeLink: Self = _
Binary property Grapheme_Link
sourcepub const IdContinue: Self = _
pub const IdContinue: Self = _
Binary property ID_Continue
sourcepub const Ideographic: Self = _
pub const Ideographic: Self = _
Binary property Ideographic
sourcepub const IdsBinaryOperator: Self = _
pub const IdsBinaryOperator: Self = _
Binary property IDS_Binary_Operator
sourcepub const IdsTrinaryOperator: Self = _
pub const IdsTrinaryOperator: Self = _
Binary property IDS_Trinary_Operator
sourcepub const JoinControl: Self = _
pub const JoinControl: Self = _
Binary property Join_Control
sourcepub const LogicalOrderException: Self = _
pub const LogicalOrderException: Self = _
Binary property Logical_Order_Exception
sourcepub const NoncharacterCodePoint: Self = _
pub const NoncharacterCodePoint: Self = _
Binary property Noncharacter_Code_Point
sourcepub const QuotationMark: Self = _
pub const QuotationMark: Self = _
Binary property Quotation_Mark
sourcepub const SoftDotted: Self = _
pub const SoftDotted: Self = _
Binary property Soft_Dotted
sourcepub const TerminalPunctuation: Self = _
pub const TerminalPunctuation: Self = _
Binary property Terminal_Punctuation
sourcepub const UnifiedIdeograph: Self = _
pub const UnifiedIdeograph: Self = _
Binary property Unified_Ideograph
sourcepub const WhiteSpace: Self = _
pub const WhiteSpace: Self = _
Binary property White_Space
sourcepub const XidContinue: Self = _
pub const XidContinue: Self = _
Binary property XID_Continue
sourcepub const CaseSensitive: Self = _
pub const CaseSensitive: Self = _
Binary property Case_Sensitive
sourcepub const SentenceTerminal: Self = _
pub const SentenceTerminal: Self = _
Binary property Sentence_Terminal
sourcepub const VariationSelector: Self = _
pub const VariationSelector: Self = _
Binary property Variation_Selector
sourcepub const SegmentStarter: Self = _
pub const SegmentStarter: Self = _
Binary property Segment_Starter
sourcepub const PatternSyntax: Self = _
pub const PatternSyntax: Self = _
Binary property Pattern_Syntax
sourcepub const PatternWhiteSpace: Self = _
pub const PatternWhiteSpace: Self = _
Binary property Pattern_White_Space
sourcepub const CaseIgnorable: Self = _
pub const CaseIgnorable: Self = _
Binary property Case_Ignorable
sourcepub const ChangesWhenLowercased: Self = _
pub const ChangesWhenLowercased: Self = _
Binary property Changes_When_Lowercased
sourcepub const ChangesWhenUppercased: Self = _
pub const ChangesWhenUppercased: Self = _
Binary property Changes_When_Uppercased
sourcepub const ChangesWhenTitlecased: Self = _
pub const ChangesWhenTitlecased: Self = _
Binary property Changes_When_Titlecased
sourcepub const ChangesWhenCasefolded: Self = _
pub const ChangesWhenCasefolded: Self = _
Binary property Changes_When_Casefolded
sourcepub const ChangesWhenCasemapped: Self = _
pub const ChangesWhenCasemapped: Self = _
Binary property Changes_When_Casemapped
sourcepub const ChangesWhenNfkcCasefolded: Self = _
pub const ChangesWhenNfkcCasefolded: Self = _
Binary property Changes_When_NFKC_Casefolded
sourcepub const EmojiPresentation: Self = _
pub const EmojiPresentation: Self = _
Binary property Emoji_Presentation
sourcepub const EmojiModifier: Self = _
pub const EmojiModifier: Self = _
Binary property Emoji_Modifier
sourcepub const EmojiModifierBase: Self = _
pub const EmojiModifierBase: Self = _
Binary property Emoji_Modifier_Base
sourcepub const EmojiComponent: Self = _
pub const EmojiComponent: Self = _
Binary property Emoji_Component
sourcepub const RegionalIndicator: Self = _
pub const RegionalIndicator: Self = _
Binary property Regional_Indicator
sourcepub const PrependedConcatenationMark: Self = _
pub const PrependedConcatenationMark: Self = _
Binary property Prepended_Concatenation_Mark
sourcepub const ExtendedPictographic: Self = _
pub const ExtendedPictographic: Self = _
Binary property Extended_Pictographic
sourcepub const BasicEmoji: Self = _
pub const BasicEmoji: Self = _
Binary property Basic_Emoji
sourcepub const EmojiKeycapSequence: Self = _
pub const EmojiKeycapSequence: Self = _
Binary property Emoji_Keycap_Sequence
sourcepub const RgiEmojiModifierSequence: Self = _
pub const RgiEmojiModifierSequence: Self = _
Binary property RGI_Emoji_Modifier_Sequence
sourcepub const RgiEmojiFlagSequence: Self = _
pub const RgiEmojiFlagSequence: Self = _
Binary property RGI_Emoji_Flag_Sequence
sourcepub const RgiEmojiTagSequence: Self = _
pub const RgiEmojiTagSequence: Self = _
Binary property RGI_Emoji_Tag_Sequence
sourcepub const RgiEmojiZWJSequence: Self = _
pub const RgiEmojiZWJSequence: Self = _
Binary property RGI_Emoji_ZWJ_Sequence
const BINARY_MAX: Self = Self::RgiEmoji
sourcepub const CombiningClass: Self = _
pub const CombiningClass: Self = _
Enumerated property Canonical_Combining_Class
sourcepub const DecompositionType: Self = _
pub const DecompositionType: Self = _
Enumerated property Decomposition_Type
sourcepub const EastAsianWidth: Self = _
pub const EastAsianWidth: Self = _
Enumerated property East_Asian_Width
sourcepub const GeneralCategory: Self = _
pub const GeneralCategory: Self = _
Enumerated property General_Category
sourcepub const JoiningGroup: Self = _
pub const JoiningGroup: Self = _
Enumerated property Joining_Group
sourcepub const JoiningType: Self = _
pub const JoiningType: Self = _
Enumerated property Joining_Type
sourcepub const NumericType: Self = _
pub const NumericType: Self = _
Enumerated property Numeric_Type
sourcepub const HangulSyllableType: Self = _
pub const HangulSyllableType: Self = _
Enumerated property Hangul_Syllable_Type
sourcepub const NFDQuickCheck: Self = _
pub const NFDQuickCheck: Self = _
Enumerated property NFD_Quick_Check
sourcepub const NFKDQuickCheck: Self = _
pub const NFKDQuickCheck: Self = _
Enumerated property NFKD_Quick_Check
sourcepub const NFCQuickCheck: Self = _
pub const NFCQuickCheck: Self = _
Enumerated property NFC_Quick_Check
sourcepub const NFKCQuickCheck: Self = _
pub const NFKCQuickCheck: Self = _
Enumerated property NFKC_Quick_Check
sourcepub const LeadCanonicalCombiningClass: Self = _
pub const LeadCanonicalCombiningClass: Self = _
Enumerated property Lead_Canonical_Combining_Class
sourcepub const TrailCanonicalCombiningClass: Self = _
pub const TrailCanonicalCombiningClass: Self = _
Enumerated property Trail_Canonical_Combining_Class
sourcepub const GraphemeClusterBreak: Self = _
pub const GraphemeClusterBreak: Self = _
Enumerated property Grapheme_Cluster_Break
sourcepub const SentenceBreak: Self = _
pub const SentenceBreak: Self = _
Enumerated property Sentence_Break
sourcepub const BidiPairedBracketType: Self = _
pub const BidiPairedBracketType: Self = _
Enumerated property Bidi_Paired_Bracket_Type
sourcepub const IndicPositionalCategory: Self = _
pub const IndicPositionalCategory: Self = _
Enumerated property Indic_Positional_Category
sourcepub const IndicSyllabicCategory: Self = _
pub const IndicSyllabicCategory: Self = _
Enumerated property Indic_Syllabic_Category
sourcepub const VerticalOrientation: Self = _
pub const VerticalOrientation: Self = _
Enumerated property Vertical_Orientation
const ENUMERATED_MAX: Self = Self::VerticalOrientation
sourcepub const GeneralCategoryMask: Self = _
pub const GeneralCategoryMask: Self = _
Mask property General_Category_Mask
sourcepub const NumericValue: Self = _
pub const NumericValue: Self = _
Double property Numeric_Value
sourcepub const BidiMirroringGlyph: Self = _
pub const BidiMirroringGlyph: Self = _
String property Bidi_Mirroring_Glyph
sourcepub const CaseFolding: Self = _
pub const CaseFolding: Self = _
String property Case_Folding
sourcepub const ISOComment: Self = _
pub const ISOComment: Self = _
String property ISO_Comment
sourcepub const LowercaseMapping: Self = _
pub const LowercaseMapping: Self = _
String property Lowercase_Mapping
sourcepub const SimpleCaseFolding: Self = _
pub const SimpleCaseFolding: Self = _
String property Simple_Case_Folding
sourcepub const SimpleLowercaseMapping: Self = _
pub const SimpleLowercaseMapping: Self = _
String property Simple_Lowercase_Mapping
sourcepub const SimpleTitlecaseMapping: Self = _
pub const SimpleTitlecaseMapping: Self = _
String property Simple_Titlecase_Mapping
sourcepub const SimpleUppercaseMapping: Self = _
pub const SimpleUppercaseMapping: Self = _
String property Simple_Uppercase_Mapping
sourcepub const TitlecaseMapping: Self = _
pub const TitlecaseMapping: Self = _
String property Titlecase_Mapping
sourcepub const Unicode1_Name: Self = _
pub const Unicode1_Name: Self = _
String property Unicode_1_Name
sourcepub const UppercaseMapping: Self = _
pub const UppercaseMapping: Self = _
String property Uppercase_Mapping
sourcepub const BidiPairedBracket: Self = _
pub const BidiPairedBracket: Self = _
String property Bidi_Paired_Bracket
const STRING_MAX: Self = Self::BidiPairedBracket
sourcepub const ScriptExtensions: Self = _
pub const ScriptExtensions: Self = _
Misc property Script_Extensions
source§impl UnicodeProperty
impl UnicodeProperty
sourcepub fn parse_ecma262_name(name: &str) -> Option<Self>
pub fn parse_ecma262_name(name: &str) -> Option<Self>
Given a property name (long, short, or alias), returns the corresponding UnicodeProperty
value for it provided it belongs to the subset relevant for ECMA262 regexes
Returns none if the name does not match any of the names in this subset. Performs strict matching of names.
If using this to implement an ECMA262-compliant regex engine, please note these caveats:
- This only returns binary and enumerated properties, as well as
Self::ScriptExtensions
. Lookup can be performed sufficiently with [Self::load_ecma262_binary_property_unstable()
],maps::load_general_category()
,maps::load_script()
andscript::load_script_with_extensions_unstable()
. - This does not handle the
Any
,Assigned
, orASCII
pseudoproperties, since they are not defined as properties.Any
can be expressed as the range[\u{0}-\u{10FFFF}]
Assigned
can be expressed as the inverse of the setgc=Cn
(i.e.,\P{gc=Cn}
).ASCII
can be expressed as the range[\u{0}-\u{7F}]
- ECMA262 regexes transparently allow
General_Category_Mask
values forGeneralCategory
. This method does not returnSelf::GeneralCategoryMask
, and instead relies on the caller to use mask-related lookup functions where necessary. - ECMA262 regexes allow treating
General_Category
(andgcm
) values as binary properties, e.g. you can do things like\p{Lu}
as shortform for\p{gc=Lu}
. This method does not do so since these are property values, not properties, but you can useGeneralCategory::get_name_to_enum_mapper()
orGeneralCategoryGroup::get_name_to_enum_mapper()
to handle this.
Trait Implementations§
source§impl Clone for UnicodeProperty
impl Clone for UnicodeProperty
source§fn clone(&self) -> UnicodeProperty
fn clone(&self) -> UnicodeProperty
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UnicodeProperty
impl Debug for UnicodeProperty
source§impl Hash for UnicodeProperty
impl Hash for UnicodeProperty
source§impl Ord for UnicodeProperty
impl Ord for UnicodeProperty
source§fn cmp(&self, other: &UnicodeProperty) -> Ordering
fn cmp(&self, other: &UnicodeProperty) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for UnicodeProperty
impl PartialEq for UnicodeProperty
source§fn eq(&self, other: &UnicodeProperty) -> bool
fn eq(&self, other: &UnicodeProperty) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for UnicodeProperty
impl PartialOrd for UnicodeProperty
source§fn partial_cmp(&self, other: &UnicodeProperty) -> Option<Ordering>
fn partial_cmp(&self, other: &UnicodeProperty) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more