pub struct StylePrimitive {
pub block_prefix: String,
pub block_suffix: String,
pub prefix: String,
pub suffix: String,
pub color: Option<String>,
pub background_color: Option<String>,
pub underline: Option<bool>,
pub bold: Option<bool>,
pub italic: Option<bool>,
pub crossed_out: Option<bool>,
pub faint: Option<bool>,
pub format: String,
}Expand description
Primitive style settings for text elements.
Fields§
§block_prefix: StringPrefix added before the block.
block_suffix: StringSuffix added after the block.
prefix: StringPrefix added before text.
suffix: StringSuffix added after text.
color: Option<String>Foreground color (ANSI color code or hex).
background_color: Option<String>Background color (ANSI color code or hex).
underline: Option<bool>Whether text is underlined.
bold: Option<bool>Whether text is bold.
italic: Option<bool>Whether text is italic.
crossed_out: Option<bool>Whether text has strikethrough.
faint: Option<bool>Whether text is faint.
format: StringFormat string for special elements (e.g., “Image: {{.text}}”).
Implementations§
Source§impl StylePrimitive
impl StylePrimitive
Sourcepub fn block_prefix(self, p: impl Into<String>) -> Self
pub fn block_prefix(self, p: impl Into<String>) -> Self
Sets the block prefix.
Sourcepub fn block_suffix(self, s: impl Into<String>) -> Self
pub fn block_suffix(self, s: impl Into<String>) -> Self
Sets the block suffix.
Sourcepub fn background_color(self, c: impl Into<String>) -> Self
pub fn background_color(self, c: impl Into<String>) -> Self
Sets the background color.
Sourcepub fn crossed_out(self, c: bool) -> Self
pub fn crossed_out(self, c: bool) -> Self
Sets strikethrough.
Sourcepub fn to_lipgloss(&self) -> LipglossStyle
pub fn to_lipgloss(&self) -> LipglossStyle
Converts to a lipgloss style.
Trait Implementations§
Source§impl Clone for StylePrimitive
impl Clone for StylePrimitive
Source§fn clone(&self) -> StylePrimitive
fn clone(&self) -> StylePrimitive
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 StylePrimitive
impl Debug for StylePrimitive
Source§impl Default for StylePrimitive
impl Default for StylePrimitive
Source§fn default() -> StylePrimitive
fn default() -> StylePrimitive
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StylePrimitive
impl RefUnwindSafe for StylePrimitive
impl Send for StylePrimitive
impl Sync for StylePrimitive
impl Unpin for StylePrimitive
impl UnwindSafe for StylePrimitive
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