#[repr(transparent)]pub struct GraphemeClusterBreak(pub u8);
Expand description
Enumerated property Grapheme_Cluster_Break.
See “Default Grapheme Cluster Boundary Specification” in UAX #29 for the summary of each property value: https://www.unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table
The numeric value is compatible with UGraphemeClusterBreak
in ICU4C.
Tuple Fields§
§0: u8
Implementations§
Source§impl GraphemeClusterBreak
impl GraphemeClusterBreak
pub const Other: GraphemeClusterBreak = _
pub const Control: GraphemeClusterBreak = _
pub const CR: GraphemeClusterBreak = _
pub const Extend: GraphemeClusterBreak = _
pub const L: GraphemeClusterBreak = _
pub const LF: GraphemeClusterBreak = _
pub const LV: GraphemeClusterBreak = _
pub const LVT: GraphemeClusterBreak = _
pub const T: GraphemeClusterBreak = _
pub const V: GraphemeClusterBreak = _
pub const SpacingMark: GraphemeClusterBreak = _
pub const Prepend: GraphemeClusterBreak = _
pub const RegionalIndicator: GraphemeClusterBreak = _
Sourcepub const EBase: GraphemeClusterBreak = _
pub const EBase: GraphemeClusterBreak = _
This value is obsolete and unused.
Sourcepub const EBaseGAZ: GraphemeClusterBreak = _
pub const EBaseGAZ: GraphemeClusterBreak = _
This value is obsolete and unused.
Sourcepub const EModifier: GraphemeClusterBreak = _
pub const EModifier: GraphemeClusterBreak = _
This value is obsolete and unused.
Sourcepub const GlueAfterZwj: GraphemeClusterBreak = _
pub const GlueAfterZwj: GraphemeClusterBreak = _
This value is obsolete and unused.
pub const ZWJ: GraphemeClusterBreak = _
Source§impl GraphemeClusterBreak
impl GraphemeClusterBreak
Sourcepub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, GraphemeClusterBreak>
pub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, GraphemeClusterBreak>
Return a PropertyValueNameToEnumMapper
, capable of looking up values
from strings for the Grapheme_Cluster_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::GraphemeClusterBreak;
let lookup = GraphemeClusterBreak::name_to_enum_mapper();
// short name for value
assert_eq!(lookup.get_strict("EX"), Some(GraphemeClusterBreak::Extend));
assert_eq!(lookup.get_strict("RI"), Some(GraphemeClusterBreak::RegionalIndicator));
// long name for value
assert_eq!(lookup.get_strict("Extend"), Some(GraphemeClusterBreak::Extend));
assert_eq!(lookup.get_strict("Regional_Indicator"), Some(GraphemeClusterBreak::RegionalIndicator));
// name has incorrect casing and lacks an underscore
assert_eq!(lookup.get_strict("regionalindicator"), None);
// loose matching of name
assert_eq!(lookup.get_loose("regionalindicator"), Some(GraphemeClusterBreak::RegionalIndicator));
// fake property
assert_eq!(lookup.get_strict("Regional_Indicator_Two_Point_Oh"), None);
Sourcepub fn get_name_to_enum_mapper(
provider: &(impl DataProvider<GraphemeClusterBreakNameToValueV1Marker> + ?Sized),
) -> Result<PropertyValueNameToEnumMapper<GraphemeClusterBreak>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &(impl DataProvider<GraphemeClusterBreakNameToValueV1Marker> + ?Sized), ) -> Result<PropertyValueNameToEnumMapper<GraphemeClusterBreak>, PropertiesError>
A version of GraphemeClusterBreak::name_to_enum_mapper()
that uses custom data provided by a DataProvider
.
Sourcepub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, GraphemeClusterBreak>
pub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, GraphemeClusterBreak>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up short names
for values of the Grapheme_Cluster_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::GraphemeClusterBreak;
let lookup = GraphemeClusterBreak::enum_to_short_name_mapper();
assert_eq!(lookup.get(GraphemeClusterBreak::Extend), Some("EX"));
assert_eq!(lookup.get(GraphemeClusterBreak::RegionalIndicator), Some("RI"));
Sourcepub fn get_enum_to_short_name_mapper(
provider: &(impl DataProvider<GraphemeClusterBreakValueToShortNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &(impl DataProvider<GraphemeClusterBreakValueToShortNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
A version of GraphemeClusterBreak::enum_to_short_name_mapper()
that uses custom data provided by a DataProvider
.
Sourcepub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, GraphemeClusterBreak>
pub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, GraphemeClusterBreak>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up long names
for values of the Grapheme_Cluster_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::GraphemeClusterBreak;
let lookup = GraphemeClusterBreak::enum_to_long_name_mapper();
assert_eq!(lookup.get(GraphemeClusterBreak::Extend), Some("Extend"));
assert_eq!(lookup.get(GraphemeClusterBreak::RegionalIndicator), Some("Regional_Indicator"));
Sourcepub fn get_enum_to_long_name_mapper(
provider: &(impl DataProvider<GraphemeClusterBreakValueToLongNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &(impl DataProvider<GraphemeClusterBreakValueToLongNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
A version of GraphemeClusterBreak::enum_to_long_name_mapper()
that uses custom data provided by a DataProvider
.
Trait Implementations§
Source§impl AsULE for GraphemeClusterBreak
impl AsULE for GraphemeClusterBreak
Source§impl Clone for GraphemeClusterBreak
impl Clone for GraphemeClusterBreak
Source§fn clone(&self) -> GraphemeClusterBreak
fn clone(&self) -> GraphemeClusterBreak
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GraphemeClusterBreak
impl Debug for GraphemeClusterBreak
Source§impl Hash for GraphemeClusterBreak
impl Hash for GraphemeClusterBreak
Source§impl Ord for GraphemeClusterBreak
impl Ord for GraphemeClusterBreak
Source§fn cmp(&self, other: &GraphemeClusterBreak) -> Ordering
fn cmp(&self, other: &GraphemeClusterBreak) -> 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 GraphemeClusterBreak
impl PartialEq for GraphemeClusterBreak
Source§impl PartialOrd for GraphemeClusterBreak
impl PartialOrd for GraphemeClusterBreak
Source§impl TrieValue for GraphemeClusterBreak
impl TrieValue for GraphemeClusterBreak
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 GraphemeClusterBreak
impl<'a> ZeroMapKV<'a> for GraphemeClusterBreak
Source§type Container = ZeroVec<'a, GraphemeClusterBreak>
type Container = ZeroVec<'a, GraphemeClusterBreak>
ZeroVec
or VarZeroVec
.type Slice = ZeroSlice<GraphemeClusterBreak>
Source§type OwnedType = GraphemeClusterBreak
type OwnedType = GraphemeClusterBreak
Container::replace()
and Container::remove()
,
also used during deserialization. If Self
is human readable serialized,
deserializing to Self::OwnedType
should produce the same value once
passed through Self::owned_as_self()
Read more