Enum icu::locale::preferences::extensions::unicode::keywords::LineBreakStyle
source · #[non_exhaustive]pub enum LineBreakStyle {
Strict,
Normal,
Loose,
}
Expand description
A Unicode Line Break Style Identifier defines a preferred line break style corresponding to the CSS level 3 line-break option.
Specifying “lb” in a locale identifier overrides the locale’s default style (which may correspond to “normal” or “strict”).
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.
Strict
CSS level 3 line-break=strict, e.g. treat CJ as NS
Normal
CSS level 3 line-break=normal, e.g. treat CJ as ID, break before hyphens for ja,zh
Loose
CSS lev 3 line-break=loose
Implementations§
Trait Implementations§
source§impl Clone for LineBreakStyle
impl Clone for LineBreakStyle
source§fn clone(&self) -> LineBreakStyle
fn clone(&self) -> LineBreakStyle
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 LineBreakStyle
impl Debug for LineBreakStyle
source§impl From<LineBreakStyle> for Value
impl From<LineBreakStyle> for Value
source§fn from(input: LineBreakStyle) -> Value
fn from(input: LineBreakStyle) -> Value
Converts to this type from the input type.
source§impl Hash for LineBreakStyle
impl Hash for LineBreakStyle
source§impl PartialEq for LineBreakStyle
impl PartialEq for LineBreakStyle
source§impl PreferenceKey for LineBreakStyle
impl PreferenceKey for LineBreakStyle
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<LineBreakStyle>, PreferencesParseError>
fn try_from_key_value( key: &Key, value: &Value, ) -> Result<Option<LineBreakStyle>, 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 LineBreakStyle
impl TryFrom<&Value> for LineBreakStyle
source§type Error = PreferencesParseError
type Error = PreferencesParseError
The type returned in the event of a conversion error.
source§fn try_from(
s: &Value,
) -> Result<LineBreakStyle, <LineBreakStyle as TryFrom<&Value>>::Error>
fn try_from( s: &Value, ) -> Result<LineBreakStyle, <LineBreakStyle as TryFrom<&Value>>::Error>
Performs the conversion.
impl Copy for LineBreakStyle
impl Eq for LineBreakStyle
impl StructuralPartialEq for LineBreakStyle
Auto Trait Implementations§
impl Freeze for LineBreakStyle
impl RefUnwindSafe for LineBreakStyle
impl Send for LineBreakStyle
impl Sync for LineBreakStyle
impl Unpin for LineBreakStyle
impl UnwindSafe for LineBreakStyle
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