#[repr(transparent)]pub struct BidiClass(pub u8);
Expand description
Enumerated property Bidi_Class
These are the categories required by the Unicode Bidirectional Algorithm. For the property values, see Bidirectional Class Values. For more information, see Unicode Standard Annex #9.
Tuple Fields§
§0: u8
Implementations§
Source§impl BidiClass
impl BidiClass
Sourcepub const LeftToRight: BidiClass = _
pub const LeftToRight: BidiClass = _
(L
) any strong left-to-right character
Sourcepub const RightToLeft: BidiClass = _
pub const RightToLeft: BidiClass = _
(R
) any strong right-to-left (non-Arabic-type) character
Sourcepub const EuropeanNumber: BidiClass = _
pub const EuropeanNumber: BidiClass = _
(EN
) any ASCII digit or Eastern Arabic-Indic digit
Sourcepub const EuropeanSeparator: BidiClass = _
pub const EuropeanSeparator: BidiClass = _
(ES
) plus and minus signs
Sourcepub const EuropeanTerminator: BidiClass = _
pub const EuropeanTerminator: BidiClass = _
(ET
) a terminator in a numeric format context, includes currency signs
Sourcepub const ArabicNumber: BidiClass = _
pub const ArabicNumber: BidiClass = _
(AN
) any Arabic-Indic digit
Sourcepub const CommonSeparator: BidiClass = _
pub const CommonSeparator: BidiClass = _
(CS
) commas, colons, and slashes
Sourcepub const ParagraphSeparator: BidiClass = _
pub const ParagraphSeparator: BidiClass = _
(B
) various newline characters
Sourcepub const SegmentSeparator: BidiClass = _
pub const SegmentSeparator: BidiClass = _
(S
) various segment-related control codes
Sourcepub const WhiteSpace: BidiClass = _
pub const WhiteSpace: BidiClass = _
(WS
) spaces
Sourcepub const OtherNeutral: BidiClass = _
pub const OtherNeutral: BidiClass = _
(ON
) most other symbols and punctuation marks
Sourcepub const LeftToRightEmbedding: BidiClass = _
pub const LeftToRightEmbedding: BidiClass = _
(LRE
) U+202A: the LR embedding control
Sourcepub const LeftToRightOverride: BidiClass = _
pub const LeftToRightOverride: BidiClass = _
(LRO
) U+202D: the LR override control
Sourcepub const ArabicLetter: BidiClass = _
pub const ArabicLetter: BidiClass = _
(AL
) any strong right-to-left (Arabic-type) character
Sourcepub const RightToLeftEmbedding: BidiClass = _
pub const RightToLeftEmbedding: BidiClass = _
(RLE
) U+202B: the RL embedding control
Sourcepub const RightToLeftOverride: BidiClass = _
pub const RightToLeftOverride: BidiClass = _
(RLO
) U+202E: the RL override control
Sourcepub const PopDirectionalFormat: BidiClass = _
pub const PopDirectionalFormat: BidiClass = _
(PDF
) U+202C: terminates an embedding or override control
Sourcepub const NonspacingMark: BidiClass = _
pub const NonspacingMark: BidiClass = _
(NSM
) any nonspacing mark
Sourcepub const BoundaryNeutral: BidiClass = _
pub const BoundaryNeutral: BidiClass = _
(BN
) most format characters, control codes, or noncharacters
Sourcepub const FirstStrongIsolate: BidiClass = _
pub const FirstStrongIsolate: BidiClass = _
(FSI
) U+2068: the first strong isolate control
Sourcepub const LeftToRightIsolate: BidiClass = _
pub const LeftToRightIsolate: BidiClass = _
(LRI
) U+2066: the LR isolate control
Sourcepub const RightToLeftIsolate: BidiClass = _
pub const RightToLeftIsolate: BidiClass = _
(RLI
) U+2067: the RL isolate control
Sourcepub const PopDirectionalIsolate: BidiClass = _
pub const PopDirectionalIsolate: BidiClass = _
(PDI
) U+2069: terminates an isolate control
Source§impl BidiClass
impl BidiClass
Sourcepub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, BidiClass>
pub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, BidiClass>
Return a PropertyValueNameToEnumMapper
, capable of looking up values
from strings for the Bidi_Class
enumerated property
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::BidiClass;
let lookup = BidiClass::name_to_enum_mapper();
// short name for value
assert_eq!(lookup.get_strict("AN"), Some(BidiClass::ArabicNumber));
assert_eq!(lookup.get_strict("NSM"), Some(BidiClass::NonspacingMark));
// long name for value
assert_eq!(lookup.get_strict("Arabic_Number"), Some(BidiClass::ArabicNumber));
assert_eq!(lookup.get_strict("Nonspacing_Mark"), Some(BidiClass::NonspacingMark));
// name has incorrect casing
assert_eq!(lookup.get_strict("arabicnumber"), None);
// loose matching of name
assert_eq!(lookup.get_loose("arabicnumber"), Some(BidiClass::ArabicNumber));
// fake property
assert_eq!(lookup.get_strict("Upside_Down_Vertical_Backwards_Mirrored"), None);
Sourcepub fn get_name_to_enum_mapper(
provider: &(impl DataProvider<BidiClassNameToValueV1Marker> + ?Sized),
) -> Result<PropertyValueNameToEnumMapper<BidiClass>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &(impl DataProvider<BidiClassNameToValueV1Marker> + ?Sized), ) -> Result<PropertyValueNameToEnumMapper<BidiClass>, PropertiesError>
A version of BidiClass::name_to_enum_mapper()
that uses custom data provided by a DataProvider
.
Sourcepub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, BidiClass>
pub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, BidiClass>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up short names
for values of the Bidi_Class
enumerated property
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::BidiClass;
let lookup = BidiClass::enum_to_short_name_mapper();
assert_eq!(lookup.get(BidiClass::ArabicNumber), Some("AN"));
assert_eq!(lookup.get(BidiClass::NonspacingMark), Some("NSM"));
Sourcepub fn get_enum_to_short_name_mapper(
provider: &(impl DataProvider<BidiClassValueToShortNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<BidiClass>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &(impl DataProvider<BidiClassValueToShortNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<BidiClass>, PropertiesError>
A version of BidiClass::enum_to_short_name_mapper()
that uses custom data provided by a DataProvider
.
Sourcepub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, BidiClass>
pub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, BidiClass>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up long names
for values of the Bidi_Class
enumerated property
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::BidiClass;
let lookup = BidiClass::enum_to_long_name_mapper();
assert_eq!(lookup.get(BidiClass::ArabicNumber), Some("Arabic_Number"));
assert_eq!(lookup.get(BidiClass::NonspacingMark), Some("Nonspacing_Mark"));
Sourcepub fn get_enum_to_long_name_mapper(
provider: &(impl DataProvider<BidiClassValueToLongNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<BidiClass>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &(impl DataProvider<BidiClassValueToLongNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<BidiClass>, PropertiesError>
A version of BidiClass::enum_to_long_name_mapper()
that uses custom data provided by a DataProvider
.
Trait Implementations§
Source§impl Ord for BidiClass
impl Ord for BidiClass
Source§impl PartialOrd for BidiClass
impl PartialOrd for BidiClass
Source§impl TrieValue for BidiClass
impl TrieValue for BidiClass
Source§type TryFromU32Error = TryFromIntError
type TryFromU32Error = TryFromIntError
Source§fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
u32
first.