pub struct StyleModifiers {
pub bold: bool,
pub italic: bool,
pub underline: bool,
}Expand description
Text style modifiers for a single syntax token.
Fields§
§bold: boolRender the token in bold weight.
italic: boolRender the token in italic style.
underline: boolRender the token with an underline.
Implementations§
Source§impl StyleModifiers
impl StyleModifiers
Sourcepub fn parse(s: &str, section: &str, field: &str) -> Result<Self, PaletteError>
pub fn parse(s: &str, section: &str, field: &str) -> Result<Self, PaletteError>
Parse a comma-separated modifier string (e.g. "bold,italic").
Whitespace around each modifier name is trimmed. An empty string
or unknown modifier name returns PaletteError::InvalidStyle.
Sourcepub fn to_css_value(self) -> &'static str
pub fn to_css_value(self) -> &'static str
CSS value string for the combined modifiers.
Returns "normal" when empty, otherwise space-separated names
like "bold", "italic", or "bold italic".
Trait Implementations§
Source§impl Clone for StyleModifiers
impl Clone for StyleModifiers
Source§fn clone(&self) -> StyleModifiers
fn clone(&self) -> StyleModifiers
Returns a duplicate 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 StyleModifiers
impl Debug for StyleModifiers
Source§impl Default for StyleModifiers
impl Default for StyleModifiers
Source§fn default() -> StyleModifiers
fn default() -> StyleModifiers
Returns the “default value” for a type. Read more
Source§impl Display for StyleModifiers
impl Display for StyleModifiers
Source§impl Hash for StyleModifiers
impl Hash for StyleModifiers
Source§impl PartialEq for StyleModifiers
impl PartialEq for StyleModifiers
Source§impl Serialize for StyleModifiers
impl Serialize for StyleModifiers
impl Copy for StyleModifiers
impl Eq for StyleModifiers
impl StructuralPartialEq for StyleModifiers
Auto Trait Implementations§
impl Freeze for StyleModifiers
impl RefUnwindSafe for StyleModifiers
impl Send for StyleModifiers
impl Sync for StyleModifiers
impl Unpin for StyleModifiers
impl UnsafeUnpin for StyleModifiers
impl UnwindSafe for StyleModifiers
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more