Enum icu::locale::preferences::extensions::unicode::keywords::LineBreakWordHandling
source · #[non_exhaustive]pub enum LineBreakWordHandling {
Normal,
BreakAll,
KeepAll,
Phrase,
}
Expand description
A Unicode Line Break Word Identifier defines preferred line break word handling behavior corresponding to the CSS level 3 word-break option.
Specifying “lw” in a locale identifier overrides the locale’s default style (which may correspond to “normal” or “keepall”).
The valid values are listed in LDML.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Normal
CSS lev 3 word-break=normal, normal script/language behavior for midword breaks
BreakAll
CSS lev 3 word-break=break-all, allow midword breaks unless forbidden by lb setting
KeepAll
CSS lev 3 word-break=keep-all, prohibit midword breaks except for dictionary breaks
Phrase
Prioritize keeping natural phrases (of multiple words) together when breaking, used in short text like title and headline
Implementations§
Trait Implementations§
source§impl Clone for LineBreakWordHandling
impl Clone for LineBreakWordHandling
source§fn clone(&self) -> LineBreakWordHandling
fn clone(&self) -> LineBreakWordHandling
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LineBreakWordHandling
impl Debug for LineBreakWordHandling
source§impl From<LineBreakWordHandling> for Value
impl From<LineBreakWordHandling> for Value
source§fn from(input: LineBreakWordHandling) -> Value
fn from(input: LineBreakWordHandling) -> Value
Converts to this type from the input type.
source§impl Hash for LineBreakWordHandling
impl Hash for LineBreakWordHandling
source§impl PartialEq for LineBreakWordHandling
impl PartialEq for LineBreakWordHandling
source§impl PreferenceKey for LineBreakWordHandling
impl PreferenceKey for LineBreakWordHandling
source§fn unicode_extension_key() -> Option<Key>
fn unicode_extension_key() -> Option<Key>
Retrieve unicode extension key corresponding to a given preference.
source§fn try_from_key_value(
key: &Key,
value: &Value,
) -> Result<Option<LineBreakWordHandling>, PreferencesParseError>
fn try_from_key_value( key: &Key, value: &Value, ) -> Result<Option<LineBreakWordHandling>, PreferencesParseError>
Optional constructor of the given preference. It takes the
unicode extension key and if the key matches it attemptes to construct
the preference based on the given value.
If the value is not a valid value for the given key, the constructor throws.
source§fn unicode_extension_value(&self) -> Option<Value>
fn unicode_extension_value(&self) -> Option<Value>
Retrieve unicode extension value corresponding to the given instance of the preference.
source§impl TryFrom<&Value> for LineBreakWordHandling
impl TryFrom<&Value> for LineBreakWordHandling
source§type Error = PreferencesParseError
type Error = PreferencesParseError
The type returned in the event of a conversion error.
source§fn try_from(
s: &Value,
) -> Result<LineBreakWordHandling, <LineBreakWordHandling as TryFrom<&Value>>::Error>
fn try_from( s: &Value, ) -> Result<LineBreakWordHandling, <LineBreakWordHandling as TryFrom<&Value>>::Error>
Performs the conversion.
impl Copy for LineBreakWordHandling
impl Eq for LineBreakWordHandling
impl StructuralPartialEq for LineBreakWordHandling
Auto Trait Implementations§
impl Freeze for LineBreakWordHandling
impl RefUnwindSafe for LineBreakWordHandling
impl Send for LineBreakWordHandling
impl Sync for LineBreakWordHandling
impl Unpin for LineBreakWordHandling
impl UnwindSafe for LineBreakWordHandling
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more