pub struct WordBreak(/* private fields */);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.
Note: Use icu::segmenter for an all-in-one break iterator implementation.
§Example
use icu::properties::{CodePointMapData, props::WordBreak};
assert_eq!(
CodePointMapData::<WordBreak>::new().get('.'),
WordBreak::MidNumLet
); // U+002E: Full Stop
assert_eq!(
CodePointMapData::<WordBreak>::new().get(','),
WordBreak::MidNum
); // U+FF0C: Fullwidth CommaImplementations§
Source§impl WordBreak
impl WordBreak
pub const Other: Self
pub const XX: Self = Self::Other
pub const ALetter: Self
pub const LE: Self = Self::ALetter
pub const Format: Self
pub const FO: Self = Self::Format
pub const Katakana: Self
pub const KA: Self = Self::Katakana
pub const MidLetter: Self
pub const ML: Self = Self::MidLetter
pub const MidNum: Self
pub const MN: Self = Self::MidNum
pub const Numeric: Self
pub const NU: Self = Self::Numeric
pub const ExtendNumLet: Self
pub const EX: Self = Self::ExtendNumLet
pub const CR: Self
pub const Extend: Self
pub const LF: Self
pub const MidNumLet: Self
pub const MB: Self = Self::MidNumLet
pub const Newline: Self
pub const NL: Self = Self::Newline
pub const RegionalIndicator: Self
pub const RI: Self = Self::RegionalIndicator
pub const HebrewLetter: Self
pub const HL: Self = Self::HebrewLetter
pub const SingleQuote: Self
pub const SQ: Self = Self::SingleQuote
pub const DoubleQuote: Self
pub const DQ: Self = Self::DoubleQuote
pub const EBase: Self
pub const EB: Self = Self::EBase
pub const EBaseGAZ: Self
pub const EBG: Self = Self::EBaseGAZ
pub const EModifier: Self
pub const EM: Self = Self::EModifier
pub const GlueAfterZwj: Self
pub const GAZ: Self = Self::GlueAfterZwj
pub const ZWJ: Self
pub const WSegSpace: Self
Source§impl WordBreak
impl WordBreak
Sourcepub const ALL_VALUES: &'static [Self]
👎Deprecated
pub const ALL_VALUES: &'static [Self]
Deprecated
Source§impl WordBreak
impl WordBreak
Sourcepub const fn to_icu4c_value(self) -> u8
👎Deprecated since 2.3.0: please comment on https://github.com/unicode-org/icu4x/issues/6067 if you need this
pub const fn to_icu4c_value(self) -> u8
please comment on https://github.com/unicode-org/icu4x/issues/6067 if you need this
Returns an ICU4C UWordBreak value.
Sourcepub const fn from_icu4c_value(value: u8) -> Self
👎Deprecated since 2.3.0: please comment on https://github.com/unicode-org/icu4x/issues/6067 if you need this
pub const fn from_icu4c_value(value: u8) -> Self
please comment on https://github.com/unicode-org/icu4x/issues/6067 if you need this
Constructor from an ICU4C UWordBreak value.
Trait Implementations§
impl Copy for WordBreak
Source§impl EnumeratedProperty for WordBreak
impl EnumeratedProperty for WordBreak
impl Eq for WordBreak
Source§impl NamedEnumeratedProperty for WordBreak
impl NamedEnumeratedProperty for WordBreak
Source§fn try_from_str(s: &str) -> Option<Self>
fn try_from_str(s: &str) -> Option<Self>
Convenience method for
PropertyParser::new().get_loose(s) Read moreSource§fn long_name(&self) -> &'static str
fn long_name(&self) -> &'static str
Convenience method for
PropertyNamesLong::new().get(*self).unwrap() Read moreSource§fn short_name(&self) -> &'static str
fn short_name(&self) -> &'static str
Convenience method for
PropertyNamesShort::new().get(*self).unwrap() Read moreSource§impl Ord for WordBreak
impl Ord for WordBreak
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
impl ParseableEnumeratedProperty for WordBreak
Source§impl PartialOrd for WordBreak
impl PartialOrd for WordBreak
impl StructuralPartialEq for WordBreak
Source§impl TrieValue for WordBreak
impl TrieValue for WordBreak
Source§type TryFromU32Error = TryFromIntError
type TryFromU32Error = TryFromIntError
Last-resort fallback value to return if we cannot read data from the trie. Read more
Source§fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
fn try_from_u32(i: u32) -> Result<Self, Self::TryFromU32Error>
A parsing function that is primarily motivated by deserialization contexts.
When the serialization type width is smaller than 32 bits, then it is expected
that the call site will widen the value to a
u32 first.Auto Trait Implementations§
impl Freeze for WordBreak
impl RefUnwindSafe for WordBreak
impl Send for WordBreak
impl Sync for WordBreak
impl Unpin for WordBreak
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more