pub struct LineBreak(/* private fields */);Expand description
Enumerated property Line_Break.
See “Line Breaking Properties” in UAX #14 for the summary of each property value: https://www.unicode.org/reports/tr14/#Properties
The numeric value is compatible with ULineBreak in ICU4C.
Note: Use icu::segmenter for an all-in-one break iterator implementation.
§Example
use icu::properties::{CodePointMapData, props::LineBreak};
assert_eq!(
CodePointMapData::<LineBreak>::new().get(')'),
LineBreak::CloseParenthesis
); // U+0029: Right Parenthesis
assert_eq!(
CodePointMapData::<LineBreak>::new().get('ぁ'),
LineBreak::ConditionalJapaneseStarter
); //U+3041: Hiragana Letter Small AImplementations§
Source§impl LineBreak
impl LineBreak
pub const Unknown: Self
pub const XX: Self = Self::Unknown
pub const Ambiguous: Self
pub const AI: Self = Self::Ambiguous
pub const Alphabetic: Self
pub const AL: Self = Self::Alphabetic
pub const BreakBoth: Self
pub const B2: Self = Self::BreakBoth
pub const BreakAfter: Self
pub const BA: Self = Self::BreakAfter
pub const BreakBefore: Self
pub const BB: Self = Self::BreakBefore
pub const MandatoryBreak: Self
pub const BK: Self = Self::MandatoryBreak
pub const ContingentBreak: Self
pub const CB: Self = Self::ContingentBreak
pub const ClosePunctuation: Self
pub const CL: Self = Self::ClosePunctuation
pub const CombiningMark: Self
pub const CM: Self = Self::CombiningMark
pub const CarriageReturn: Self
pub const CR: Self = Self::CarriageReturn
pub const Exclamation: Self
pub const EX: Self = Self::Exclamation
pub const Glue: Self
pub const GL: Self = Self::Glue
pub const Hyphen: Self
pub const HY: Self = Self::Hyphen
pub const Ideographic: Self
pub const ID: Self = Self::Ideographic
pub const Inseparable: Self
pub const IN: Self = Self::Inseparable
pub const Inseperable: Self = Self::Inseparable
pub const InfixNumeric: Self
pub const IS: Self = Self::InfixNumeric
pub const LineFeed: Self
pub const LF: Self = Self::LineFeed
pub const Nonstarter: Self
pub const NS: Self = Self::Nonstarter
pub const Numeric: Self
pub const NU: Self = Self::Numeric
pub const OpenPunctuation: Self
pub const OP: Self = Self::OpenPunctuation
pub const PostfixNumeric: Self
pub const PO: Self = Self::PostfixNumeric
pub const PrefixNumeric: Self
pub const PR: Self = Self::PrefixNumeric
pub const Quotation: Self
pub const QU: Self = Self::Quotation
pub const ComplexContext: Self
pub const SA: Self = Self::ComplexContext
pub const Surrogate: Self
pub const SG: Self = Self::Surrogate
pub const Space: Self
pub const SP: Self = Self::Space
pub const BreakSymbols: Self
pub const SY: Self = Self::BreakSymbols
pub const ZWSpace: Self
pub const ZW: Self = Self::ZWSpace
pub const NextLine: Self
pub const NL: Self = Self::NextLine
pub const WordJoiner: Self
pub const WJ: Self = Self::WordJoiner
pub const H2: Self
pub const H3: Self
pub const JL: Self
pub const JT: Self
pub const JV: Self
pub const CloseParenthesis: Self
pub const CP: Self = Self::CloseParenthesis
pub const ConditionalJapaneseStarter: Self
pub const CJ: Self = Self::ConditionalJapaneseStarter
pub const HebrewLetter: Self
pub const HL: Self = Self::HebrewLetter
pub const RegionalIndicator: Self
pub const RI: Self = Self::RegionalIndicator
pub const EBase: Self
pub const EB: Self = Self::EBase
pub const EModifier: Self
pub const EM: Self = Self::EModifier
pub const ZWJ: Self
pub const Aksara: Self
pub const AK: Self = Self::Aksara
pub const AksaraPrebase: Self
pub const AP: Self = Self::AksaraPrebase
pub const AksaraStart: Self
pub const AS: Self = Self::AksaraStart
pub const ViramaFinal: Self
pub const VF: Self = Self::ViramaFinal
pub const Virama: Self
pub const VI: Self = Self::Virama
pub const UnambiguousHyphen: Self
pub const HH: Self = Self::UnambiguousHyphen
Source§impl LineBreak
impl LineBreak
Sourcepub const ALL_VALUES: &'static [Self]
👎Deprecated
pub const ALL_VALUES: &'static [Self]
Deprecated
Source§impl LineBreak
impl LineBreak
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 ULineBreak 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 ULineBreak value.
Trait Implementations§
impl Copy for LineBreak
Source§impl EnumeratedProperty for LineBreak
impl EnumeratedProperty for LineBreak
impl Eq for LineBreak
Source§impl NamedEnumeratedProperty for LineBreak
impl NamedEnumeratedProperty for LineBreak
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 LineBreak
impl Ord for LineBreak
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 LineBreak
Source§impl PartialOrd for LineBreak
impl PartialOrd for LineBreak
impl StructuralPartialEq for LineBreak
Source§impl TrieValue for LineBreak
impl TrieValue for LineBreak
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 LineBreak
impl RefUnwindSafe for LineBreak
impl Send for LineBreak
impl Sync for LineBreak
impl Unpin for LineBreak
impl UnsafeUnpin for LineBreak
impl UnwindSafe for LineBreak
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