#[repr(transparent)]pub struct WordBreak(pub u8);Expand description
Enumerated property Word_Break.
See “Default Word 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 UWordBreakValues in ICU4C.
Tuple Fields§
§0: u8Implementations§
Source§impl WordBreak
impl WordBreak
pub const Other: WordBreak
pub const ALetter: WordBreak
pub const Format: WordBreak
pub const Katakana: WordBreak
pub const MidLetter: WordBreak
pub const MidNum: WordBreak
pub const Numeric: WordBreak
pub const ExtendNumLet: WordBreak
pub const CR: WordBreak
pub const Extend: WordBreak
pub const LF: WordBreak
pub const MidNumLet: WordBreak
pub const Newline: WordBreak
pub const RegionalIndicator: WordBreak
pub const HebrewLetter: WordBreak
pub const SingleQuote: WordBreak
pub const DoubleQuote: WordBreak
Sourcepub const GlueAfterZwj: WordBreak
pub const GlueAfterZwj: WordBreak
This value is obsolete and unused.
pub const ZWJ: WordBreak
pub const WSegSpace: WordBreak
Source§impl WordBreak
impl WordBreak
Sourcepub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, WordBreak>
pub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, WordBreak>
Return a PropertyValueNameToEnumMapper, capable of looking up values
from strings for the Word_Break enumerated property.
✨ Enabled with the compiled_data Cargo feature.
§Example
use icu::properties::WordBreak;
let lookup = WordBreak::name_to_enum_mapper();
// short name for value
assert_eq!(lookup.get_strict("KA"), Some(WordBreak::Katakana));
assert_eq!(lookup.get_strict("LE"), Some(WordBreak::ALetter));
// long name for value
assert_eq!(lookup.get_strict("Katakana"), Some(WordBreak::Katakana));
assert_eq!(lookup.get_strict("ALetter"), Some(WordBreak::ALetter));
// name has incorrect casing
assert_eq!(lookup.get_strict("Aletter"), None);
// loose matching of name
assert_eq!(lookup.get_loose("Aletter"), Some(WordBreak::ALetter));
assert_eq!(lookup.get_loose("w_seg_space"), Some(WordBreak::WSegSpace));
// fake property
assert_eq!(lookup.get_strict("Quadruple_Quote"), None);Sourcepub fn get_name_to_enum_mapper(
provider: &(impl DataProvider<WordBreakNameToValueV1Marker> + ?Sized),
) -> Result<PropertyValueNameToEnumMapper<WordBreak>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &(impl DataProvider<WordBreakNameToValueV1Marker> + ?Sized), ) -> Result<PropertyValueNameToEnumMapper<WordBreak>, PropertiesError>
A version of WordBreak::name_to_enum_mapper() that uses custom data provided by a DataProvider.
Sourcepub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, WordBreak>
pub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, WordBreak>
Return a PropertyEnumToValueNameLinearMapper, capable of looking up short names
for values of the Word_Break enumerated property.
✨ Enabled with the compiled_data Cargo feature.
§Example
use icu::properties::WordBreak;
let lookup = WordBreak::enum_to_short_name_mapper();
assert_eq!(lookup.get(WordBreak::Katakana), Some("KA"));
assert_eq!(lookup.get(WordBreak::ALetter), Some("LE"));
assert_eq!(lookup.get(WordBreak::WSegSpace), Some("WSegSpace"));Sourcepub fn get_enum_to_short_name_mapper(
provider: &(impl DataProvider<WordBreakValueToShortNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<WordBreak>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &(impl DataProvider<WordBreakValueToShortNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<WordBreak>, PropertiesError>
A version of WordBreak::enum_to_short_name_mapper() that uses custom data provided by a DataProvider.
Sourcepub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, WordBreak>
pub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, WordBreak>
Return a PropertyEnumToValueNameLinearMapper, capable of looking up long names
for values of the Word_Break enumerated property.
✨ Enabled with the compiled_data Cargo feature.
§Example
use icu::properties::WordBreak;
let lookup = WordBreak::enum_to_long_name_mapper();
assert_eq!(lookup.get(WordBreak::Katakana), Some("Katakana"));
assert_eq!(lookup.get(WordBreak::ALetter), Some("ALetter"));
assert_eq!(lookup.get(WordBreak::WSegSpace), Some("WSegSpace"));Sourcepub fn get_enum_to_long_name_mapper(
provider: &(impl DataProvider<WordBreakValueToLongNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<WordBreak>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &(impl DataProvider<WordBreakValueToLongNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<WordBreak>, PropertiesError>
A version of WordBreak::enum_to_long_name_mapper() that uses custom data provided by a DataProvider.
Trait Implementations§
Source§impl Ord for WordBreak
impl Ord for WordBreak
Source§impl PartialOrd for WordBreak
impl PartialOrd for WordBreak
Source§impl TrieValue for WordBreak
impl TrieValue for WordBreak
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 WordBreak
impl<'a> ZeroMapKV<'a> for WordBreak
impl Copy for WordBreak
impl Eq for WordBreak
impl StructuralPartialEq for WordBreak
Auto Trait Implementations§
impl Freeze for WordBreak
impl RefUnwindSafe for WordBreak
impl Send for WordBreak
impl Sync for WordBreak
impl Unpin for WordBreak
impl UnwindSafe for WordBreak
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