pub struct TextFormat {
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub strikethrough: bool,
pub color: Option<String>,
pub highlight: Option<String>,
pub font_size: Option<u32>,
pub font_family: Option<String>,
pub subscript: bool,
pub superscript: bool,
}Expand description
Text formatting options
Fields§
§bold: bool§italic: bool§underline: bool§strikethrough: bool§color: Option<String>§highlight: Option<String>§font_size: Option<u32>§font_family: Option<String>§subscript: bool§superscript: boolImplementations§
Source§impl TextFormat
impl TextFormat
Sourcepub fn strikethrough(self) -> Self
pub fn strikethrough(self) -> Self
Set strikethrough formatting
Sourcepub fn highlight(self, hex_color: &str) -> Self
pub fn highlight(self, hex_color: &str) -> Self
Set highlight/background color (RGB hex format)
Sourcepub fn font_family(self, family: &str) -> Self
pub fn font_family(self, family: &str) -> Self
Set font family
Sourcepub fn superscript(self) -> Self
pub fn superscript(self) -> Self
Set superscript formatting
Sourcepub fn to_xml_attrs(&self) -> String
pub fn to_xml_attrs(&self) -> String
Generate XML attributes for text formatting
Sourcepub fn to_highlight_xml(&self) -> String
pub fn to_highlight_xml(&self) -> String
Generate highlight element if set
Trait Implementations§
Source§impl Clone for TextFormat
impl Clone for TextFormat
Source§fn clone(&self) -> TextFormat
fn clone(&self) -> TextFormat
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 TextFormat
impl Debug for TextFormat
Source§impl Default for TextFormat
impl Default for TextFormat
Source§fn default() -> TextFormat
fn default() -> TextFormat
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextFormat
impl RefUnwindSafe for TextFormat
impl Send for TextFormat
impl Sync for TextFormat
impl Unpin for TextFormat
impl UnwindSafe for TextFormat
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