pub struct TextStyle {
pub color: Option<TextColor>,
pub bold: Option<bool>,
pub italic: Option<bool>,
pub underlined: Option<bool>,
pub strikethrough: Option<bool>,
pub obfuscated: Option<bool>,
pub insertion: Option<String>,
pub click_event: Option<ClickEvent>,
pub hover_event: Option<HoverEvent>,
}Expand description
Visual styling for a text component.
All fields are Option — None means the value is inherited from the
parent component. The root component inherits from the client’s default
chat style (typically white, non-bold, non-italic).
Fields§
§color: Option<TextColor>The text color. Overrides the parent’s color when set.
bold: Option<bool>Bold formatting. Renders the text with a thicker stroke.
italic: Option<bool>Italic formatting. Renders the text at a slant.
underlined: Option<bool>Underlined formatting. Draws a line beneath the text.
strikethrough: Option<bool>Strikethrough formatting. Draws a line through the text.
obfuscated: Option<bool>Obfuscated formatting. Rapidly cycles through random characters.
insertion: Option<String>Text inserted into the chat input when the component is shift-clicked.
click_event: Option<ClickEvent>Action triggered when the component is clicked.
hover_event: Option<HoverEvent>Content displayed when the component is hovered.
Trait Implementations§
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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