Struct icu_properties::props::GraphemeClusterBreak
source · #[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
§type ULE = GraphemeClusterBreakULE
type ULE = GraphemeClusterBreakULE
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 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§fn eq(&self, other: &GraphemeClusterBreak) -> bool
fn eq(&self, other: &GraphemeClusterBreak) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for GraphemeClusterBreak
impl PartialOrd for GraphemeClusterBreak
source§fn partial_cmp(&self, other: &GraphemeClusterBreak) -> Option<Ordering>
fn partial_cmp(&self, other: &GraphemeClusterBreak) -> 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 moresource§impl TrieValue for GraphemeClusterBreak
impl TrieValue for GraphemeClusterBreak
§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
§type Container = ZeroVec<'a, GraphemeClusterBreak>
type Container = ZeroVec<'a, GraphemeClusterBreak>
ZeroVec
or VarZeroVec
.type Slice = ZeroSlice<GraphemeClusterBreak>
§type GetType = GraphemeClusterBreakULE
type GetType = GraphemeClusterBreakULE
Container::get()
Read more§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