Struct icu_properties::props::LineBreak
source · #[repr(transparent)]pub struct LineBreak(pub u8);
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.
Tuple Fields§
§0: u8
Implementations§
source§impl LineBreak
impl LineBreak
pub const Unknown: LineBreak = _
pub const Ambiguous: LineBreak = _
pub const Alphabetic: LineBreak = _
pub const BreakBoth: LineBreak = _
pub const BreakAfter: LineBreak = _
pub const BreakBefore: LineBreak = _
pub const MandatoryBreak: LineBreak = _
pub const ContingentBreak: LineBreak = _
pub const ClosePunctuation: LineBreak = _
pub const CombiningMark: LineBreak = _
pub const CarriageReturn: LineBreak = _
pub const Exclamation: LineBreak = _
pub const Glue: LineBreak = _
pub const Hyphen: LineBreak = _
pub const Ideographic: LineBreak = _
pub const Inseparable: LineBreak = _
pub const InfixNumeric: LineBreak = _
pub const LineFeed: LineBreak = _
pub const Nonstarter: LineBreak = _
pub const Numeric: LineBreak = _
pub const OpenPunctuation: LineBreak = _
pub const PostfixNumeric: LineBreak = _
pub const PrefixNumeric: LineBreak = _
pub const Quotation: LineBreak = _
pub const ComplexContext: LineBreak = _
pub const Surrogate: LineBreak = _
pub const Space: LineBreak = _
pub const BreakSymbols: LineBreak = _
pub const ZWSpace: LineBreak = _
pub const NextLine: LineBreak = _
pub const WordJoiner: LineBreak = _
pub const H2: LineBreak = _
pub const H3: LineBreak = _
pub const JL: LineBreak = _
pub const JT: LineBreak = _
pub const JV: LineBreak = _
pub const CloseParenthesis: LineBreak = _
pub const ConditionalJapaneseStarter: LineBreak = _
pub const HebrewLetter: LineBreak = _
pub const RegionalIndicator: LineBreak = _
pub const EBase: LineBreak = _
pub const EModifier: LineBreak = _
pub const ZWJ: LineBreak = _
pub const Aksara: LineBreak = _
pub const AksaraPrebase: LineBreak = _
pub const AksaraStart: LineBreak = _
pub const ViramaFinal: LineBreak = _
pub const Virama: LineBreak = _
source§impl LineBreak
impl LineBreak
sourcepub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, LineBreak>
pub const fn name_to_enum_mapper() -> PropertyValueNameToEnumMapperBorrowed<'static, LineBreak>
Return a PropertyValueNameToEnumMapper
, capable of looking up values
from strings for the Line_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::LineBreak;
let lookup = LineBreak::name_to_enum_mapper();
// short name for value
assert_eq!(lookup.get_strict("BK"), Some(LineBreak::MandatoryBreak));
assert_eq!(lookup.get_strict("AL"), Some(LineBreak::Alphabetic));
// long name for value
assert_eq!(lookup.get_strict("Mandatory_Break"), Some(LineBreak::MandatoryBreak));
assert_eq!(lookup.get_strict("Alphabetic"), Some(LineBreak::Alphabetic));
// name has incorrect casing and dash instead of underscore
assert_eq!(lookup.get_strict("mandatory-Break"), None);
// loose matching of name
assert_eq!(lookup.get_loose("mandatory-Break"), Some(LineBreak::MandatoryBreak));
// fake property
assert_eq!(lookup.get_strict("Stochastic_Break"), None);
sourcepub fn get_name_to_enum_mapper(
provider: &(impl DataProvider<LineBreakNameToValueV1Marker> + ?Sized),
) -> Result<PropertyValueNameToEnumMapper<LineBreak>, PropertiesError>
pub fn get_name_to_enum_mapper( provider: &(impl DataProvider<LineBreakNameToValueV1Marker> + ?Sized), ) -> Result<PropertyValueNameToEnumMapper<LineBreak>, PropertiesError>
A version of LineBreak::name_to_enum_mapper()
that uses custom data provided by a DataProvider
.
sourcepub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, LineBreak>
pub const fn enum_to_short_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, LineBreak>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up short names
for values of the Line_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::LineBreak;
let lookup = LineBreak::enum_to_short_name_mapper();
assert_eq!(lookup.get(LineBreak::MandatoryBreak), Some("BK"));
assert_eq!(lookup.get(LineBreak::Alphabetic), Some("AL"));
sourcepub fn get_enum_to_short_name_mapper(
provider: &(impl DataProvider<LineBreakValueToShortNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<LineBreak>, PropertiesError>
pub fn get_enum_to_short_name_mapper( provider: &(impl DataProvider<LineBreakValueToShortNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<LineBreak>, PropertiesError>
A version of LineBreak::enum_to_short_name_mapper()
that uses custom data provided by a DataProvider
.
sourcepub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, LineBreak>
pub const fn enum_to_long_name_mapper() -> PropertyEnumToValueNameLinearMapperBorrowed<'static, LineBreak>
Return a PropertyEnumToValueNameLinearMapper
, capable of looking up long names
for values of the Line_Break
enumerated property.
✨ Enabled with the compiled_data
Cargo feature.
§Example
use icu::properties::LineBreak;
let lookup = LineBreak::enum_to_long_name_mapper();
assert_eq!(lookup.get(LineBreak::MandatoryBreak), Some("Mandatory_Break"));
assert_eq!(lookup.get(LineBreak::Alphabetic), Some("Alphabetic"));
sourcepub fn get_enum_to_long_name_mapper(
provider: &(impl DataProvider<LineBreakValueToLongNameV1Marker> + ?Sized),
) -> Result<PropertyEnumToValueNameLinearMapper<LineBreak>, PropertiesError>
pub fn get_enum_to_long_name_mapper( provider: &(impl DataProvider<LineBreakValueToLongNameV1Marker> + ?Sized), ) -> Result<PropertyEnumToValueNameLinearMapper<LineBreak>, PropertiesError>
A version of LineBreak::enum_to_long_name_mapper()
that uses custom data provided by a DataProvider
.
Trait Implementations§
source§impl AsULE for LineBreak
impl AsULE for LineBreak
source§type ULE = LineBreakULE
type ULE = LineBreakULE
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 Ord for LineBreak
impl Ord for LineBreak
source§impl PartialOrd for LineBreak
impl PartialOrd for LineBreak
source§impl TrieValue for LineBreak
impl TrieValue for LineBreak
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 LineBreak
impl<'a> ZeroMapKV<'a> for LineBreak
impl Copy for LineBreak
impl Eq for LineBreak
impl StructuralPartialEq for LineBreak
Auto Trait Implementations§
impl Freeze for LineBreak
impl RefUnwindSafe for LineBreak
impl Send for LineBreak
impl Sync for LineBreak
impl Unpin 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
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
)