Struct icu_properties::SentenceBreak
source · #[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§type ULE = SentenceBreakULE
type ULE = SentenceBreakULE
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 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 GetType = SentenceBreakULE
type GetType = SentenceBreakULE
Container::get()
Read moresource§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 moreimpl Copy for SentenceBreak
impl Eq for SentenceBreak
impl StructuralPartialEq for SentenceBreak
Auto Trait Implementations§
impl Freeze for SentenceBreak
impl RefUnwindSafe for SentenceBreak
impl Send for SentenceBreak
impl Sync for SentenceBreak
impl Unpin for SentenceBreak
impl UnwindSafe for SentenceBreak
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)