#[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: u8Implementations§
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 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,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte