Struct icu_properties::props::BidiClass
source · #[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 AsULE for BidiClass
impl AsULE for BidiClass
source§type ULE = BidiClassULE
type ULE = BidiClassULE
Self
. Read moresource§fn to_unaligned(self) -> Self::ULE
fn to_unaligned(self) -> Self::ULE
source§fn from_unaligned(unaligned: Self::ULE) -> Self
fn from_unaligned(unaligned: Self::ULE) -> Self
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.source§impl<'a> ZeroMapKV<'a> for BidiClass
impl<'a> ZeroMapKV<'a> for BidiClass
impl Copy for BidiClass
impl Eq for BidiClass
impl StructuralPartialEq for BidiClass
Auto Trait Implementations§
impl Freeze for BidiClass
impl RefUnwindSafe for BidiClass
impl Send for BidiClass
impl Sync for BidiClass
impl Unpin for BidiClass
impl UnwindSafe for BidiClass
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)