pub struct Style {
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 reset: bool,
}
Fields§
§color: Option<TextColor>
§bold: Option<bool>
§italic: Option<bool>
§underlined: Option<bool>
§strikethrough: Option<bool>
§obfuscated: Option<bool>
§reset: bool
Whether formatting should be reset before applying these styles
Implementations§
Source§impl Style
impl Style
pub fn empty() -> Self
pub fn deserialize(json: &Value) -> Style
Sourcepub fn compare_ansi(&self, after: &Style, default_style: &Style) -> String
pub fn compare_ansi(&self, after: &Style, default_style: &Style) -> String
find the necessary ansi code to get from this style to another
Sourcepub fn apply_formatting(&mut self, formatting: &ChatFormatting)
pub fn apply_formatting(&mut self, formatting: &ChatFormatting)
Apply a ChatFormatting to this style
Trait Implementations§
Source§impl Serialize for Style
impl Serialize for Style
fn to_compound(self) -> NbtCompound
fn to_nbt(self) -> BaseNbt
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
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
)