Struct icu::properties::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
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 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 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 moreimpl Copy for GraphemeClusterBreak
impl Eq for GraphemeClusterBreak
impl StructuralPartialEq for GraphemeClusterBreak
Auto Trait Implementations§
impl Freeze for GraphemeClusterBreak
impl RefUnwindSafe for GraphemeClusterBreak
impl Send for GraphemeClusterBreak
impl Sync for GraphemeClusterBreak
impl Unpin for GraphemeClusterBreak
impl UnwindSafe for GraphemeClusterBreak
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more