Struct icu::properties::GraphemeClusterBreak
source · 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 = GraphemeClusterBreak(0)
pub const Control: GraphemeClusterBreak = GraphemeClusterBreak(1)
pub const CR: GraphemeClusterBreak = GraphemeClusterBreak(2)
pub const Extend: GraphemeClusterBreak = GraphemeClusterBreak(3)
pub const L: GraphemeClusterBreak = GraphemeClusterBreak(4)
pub const LF: GraphemeClusterBreak = GraphemeClusterBreak(5)
pub const LV: GraphemeClusterBreak = GraphemeClusterBreak(6)
pub const LVT: GraphemeClusterBreak = GraphemeClusterBreak(7)
pub const T: GraphemeClusterBreak = GraphemeClusterBreak(8)
pub const V: GraphemeClusterBreak = GraphemeClusterBreak(9)
pub const SpacingMark: GraphemeClusterBreak = GraphemeClusterBreak(10)
pub const Prepend: GraphemeClusterBreak = GraphemeClusterBreak(11)
pub const RegionalIndicator: GraphemeClusterBreak = GraphemeClusterBreak(12)
sourcepub const EBase: GraphemeClusterBreak = GraphemeClusterBreak(13)
pub const EBase: GraphemeClusterBreak = GraphemeClusterBreak(13)
This value is obsolete and unused.
sourcepub const EBaseGAZ: GraphemeClusterBreak = GraphemeClusterBreak(14)
pub const EBaseGAZ: GraphemeClusterBreak = GraphemeClusterBreak(14)
This value is obsolete and unused.
sourcepub const EModifier: GraphemeClusterBreak = GraphemeClusterBreak(15)
pub const EModifier: GraphemeClusterBreak = GraphemeClusterBreak(15)
This value is obsolete and unused.
sourcepub const GlueAfterZwj: GraphemeClusterBreak = GraphemeClusterBreak(16)
pub const GlueAfterZwj: GraphemeClusterBreak = GraphemeClusterBreak(16)
This value is obsolete and unused.
pub const ZWJ: GraphemeClusterBreak = GraphemeClusterBreak(17)
source§impl GraphemeClusterBreak
impl GraphemeClusterBreak
sourcepub fn get_name_to_enum_mapper(
provider: &impl DataProvider<GraphemeClusterBreakNameToValueV1Marker>
) -> Result<PropertyValueNameToEnumMapper<GraphemeClusterBreak>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &impl DataProvider<GraphemeClusterBreakNameToValueV1Marker> ) -> Result<PropertyValueNameToEnumMapper<GraphemeClusterBreak>, PropertiesError>
Return a PropertyValueNameToEnumMapper
, capable of looking up values
from strings for the Grapheme_Cluster_Break
enumerated property
Example
use icu::properties::GraphemeClusterBreak;
let lookup = GraphemeClusterBreak::get_name_to_enum_mapper(&icu_testdata::unstable())
.expect("The data should be valid");
let lookup = lookup.as_borrowed();
// 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_enum_to_short_name_mapper(
provider: &impl DataProvider<GraphemeClusterBreakValueToShortNameV1Marker>
) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &impl DataProvider<GraphemeClusterBreakValueToShortNameV1Marker> ) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up short names
for values of the Grapheme_Cluster_Break
enumerated property
Example
use icu::properties::GraphemeClusterBreak;
let lookup = GraphemeClusterBreak::get_enum_to_short_name_mapper(&icu_testdata::unstable())
.expect("The data should be valid");
let lookup = lookup.as_borrowed();
assert_eq!(lookup.get(GraphemeClusterBreak::Extend), Some("EX"));
assert_eq!(lookup.get(GraphemeClusterBreak::RegionalIndicator), Some("RI"));
sourcepub fn get_enum_to_long_name_mapper(
provider: &impl DataProvider<GraphemeClusterBreakValueToLongNameV1Marker>
) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &impl DataProvider<GraphemeClusterBreakValueToLongNameV1Marker> ) -> Result<PropertyEnumToValueNameLinearMapper<GraphemeClusterBreak>, PropertiesError>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up long names
for values of the Grapheme_Cluster_Break
enumerated property
Example
use icu::properties::GraphemeClusterBreak;
let lookup = GraphemeClusterBreak::get_enum_to_long_name_mapper(&icu_testdata::unstable())
.expect("The data should be valid");
let lookup = lookup.as_borrowed();
assert_eq!(lookup.get(GraphemeClusterBreak::Extend), Some("Extend"));
assert_eq!(lookup.get(GraphemeClusterBreak::RegionalIndicator), Some("Regional_Indicator"));
Trait Implementations§
source§impl AsULE for GraphemeClusterBreak
impl AsULE for GraphemeClusterBreak
source§fn to_unaligned(self) -> <GraphemeClusterBreak as AsULE>::ULE
fn to_unaligned(self) -> <GraphemeClusterBreak as AsULE>::ULE
source§fn from_unaligned(
unaligned: <GraphemeClusterBreak as AsULE>::ULE
) -> GraphemeClusterBreak
fn from_unaligned( unaligned: <GraphemeClusterBreak as AsULE>::ULE ) -> 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<'de> Deserialize<'de> for GraphemeClusterBreak
impl<'de> Deserialize<'de> for GraphemeClusterBreak
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<GraphemeClusterBreak, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<GraphemeClusterBreak, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
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<GraphemeClusterBreak> for GraphemeClusterBreak
impl PartialEq<GraphemeClusterBreak> 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<GraphemeClusterBreak> for GraphemeClusterBreak
impl PartialOrd<GraphemeClusterBreak> 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 Serialize for GraphemeClusterBreak
impl Serialize for GraphemeClusterBreak
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
source§impl TrieValue for GraphemeClusterBreak
impl TrieValue for GraphemeClusterBreak
§type TryFromU32Error = TryFromIntError
type TryFromU32Error = TryFromIntError
source§fn try_from_u32(
i: u32
) -> Result<GraphemeClusterBreak, <GraphemeClusterBreak as TrieValue>::TryFromU32Error>
fn try_from_u32( i: u32 ) -> Result<GraphemeClusterBreak, <GraphemeClusterBreak as TrieValue>::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 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