#[repr(transparent)]pub struct SentenceBreak(pub u8);
Expand description
Enumerated property Sentence_Break. See “Default Sentence Boundary Specification” in UAX #29 for the summary of each property value: https://www.unicode.org/reports/tr29/#Default_Word_Boundaries.
The numeric value is compatible with USentenceBreak
in ICU4C.
Tuple Fields§
§0: u8
Implementations§
Source§impl SentenceBreak
impl SentenceBreak
pub const Other: SentenceBreak = _
pub const ATerm: SentenceBreak = _
pub const Close: SentenceBreak = _
pub const Format: SentenceBreak = _
pub const Lower: SentenceBreak = _
pub const Numeric: SentenceBreak = _
pub const OLetter: SentenceBreak = _
pub const Sep: SentenceBreak = _
pub const Sp: SentenceBreak = _
pub const STerm: SentenceBreak = _
pub const Upper: SentenceBreak = _
pub const CR: SentenceBreak = _
pub const Extend: SentenceBreak = _
pub const LF: SentenceBreak = _
pub const SContinue: SentenceBreak = _
Source§impl SentenceBreak
impl SentenceBreak
Sourcepub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, SentenceBreak>
pub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, SentenceBreak>
Return a PropertyValueNameToEnumMapper
, capable of looking up values
from strings for the Sentence_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::SentenceBreak;
let lookup = SentenceBreak::name_to_enum_mapper();
// short name for value
assert_eq!(lookup.get_strict("FO"), Some(SentenceBreak::Format));
assert_eq!(lookup.get_strict("NU"), Some(SentenceBreak::Numeric));
// long name for value
assert_eq!(lookup.get_strict("Format"), Some(SentenceBreak::Format));
assert_eq!(lookup.get_strict("Numeric"), Some(SentenceBreak::Numeric));
// name has incorrect casing
assert_eq!(lookup.get_strict("fOrmat"), None);
// loose matching of name
assert_eq!(lookup.get_loose("fOrmat"), Some(SentenceBreak::Format));
// fake property
assert_eq!(lookup.get_strict("Fixer_Upper"), None);
Sourcepub fn get_name_to_enum_mapper(
provider: &(impl DataProvider<SentenceBreakNameToValueV1Marker> + ?Sized),
) -> Result<PropertyValueNameToEnumMapper<SentenceBreak>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &(impl DataProvider<SentenceBreakNameToValueV1Marker> + ?Sized), ) -> Result<PropertyValueNameToEnumMapper<SentenceBreak>, PropertiesError>
A version of SentenceBreak::name_to_enum_mapper()
that uses custom data provided by a DataProvider
.
Sourcepub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, SentenceBreak>
pub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, SentenceBreak>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up short names
for values of the Sentence_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::SentenceBreak;
let lookup = SentenceBreak::enum_to_short_name_mapper();
assert_eq!(lookup.get(SentenceBreak::Format), Some("FO"));
assert_eq!(lookup.get(SentenceBreak::Numeric), Some("NU"));
Sourcepub fn get_enum_to_short_name_mapper(
provider: &(impl DataProvider<SentenceBreakValueToShortNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<SentenceBreak>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &(impl DataProvider<SentenceBreakValueToShortNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<SentenceBreak>, PropertiesError>
A version of SentenceBreak::enum_to_short_name_mapper()
that uses custom data provided by a DataProvider
.
Sourcepub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, SentenceBreak>
pub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, SentenceBreak>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up long names
for values of the Sentence_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::SentenceBreak;
let lookup = SentenceBreak::enum_to_long_name_mapper();
assert_eq!(lookup.get(SentenceBreak::Format), Some("Format"));
assert_eq!(lookup.get(SentenceBreak::Numeric), Some("Numeric"));
assert_eq!(lookup.get(SentenceBreak::SContinue), Some("SContinue"));
Sourcepub fn get_enum_to_long_name_mapper(
provider: &(impl DataProvider<SentenceBreakValueToLongNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<SentenceBreak>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &(impl DataProvider<SentenceBreakValueToLongNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<SentenceBreak>, PropertiesError>
A version of SentenceBreak::enum_to_long_name_mapper()
that uses custom data provided by a DataProvider
.
Trait Implementations§
Source§impl AsULE for SentenceBreak
impl AsULE for SentenceBreak
Source§impl Clone for SentenceBreak
impl Clone for SentenceBreak
Source§fn clone(&self) -> SentenceBreak
fn clone(&self) -> SentenceBreak
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SentenceBreak
impl Debug for SentenceBreak
Source§impl Hash for SentenceBreak
impl Hash for SentenceBreak
Source§impl Ord for SentenceBreak
impl Ord for SentenceBreak
Source§fn cmp(&self, other: &SentenceBreak) -> Ordering
fn cmp(&self, other: &SentenceBreak) -> 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 SentenceBreak
impl PartialEq for SentenceBreak
Source§impl PartialOrd for SentenceBreak
impl PartialOrd for SentenceBreak
Source§impl TrieValue for SentenceBreak
impl TrieValue for SentenceBreak
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 SentenceBreak
impl<'a> ZeroMapKV<'a> for SentenceBreak
Source§type Container = ZeroVec<'a, SentenceBreak>
type Container = ZeroVec<'a, SentenceBreak>
ZeroVec
or VarZeroVec
.type Slice = ZeroSlice<SentenceBreak>
Source§type OwnedType = SentenceBreak
type OwnedType = SentenceBreak
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