pub struct TextSpan {
pub text: String,
pub color: Option<Color>,
pub background: Option<Color>,
pub weight: Option<FontWeight>,
pub style: Option<FontStyle>,
pub family: Option<String>,
pub underline: bool,
pub strikethrough: bool,
pub size_delta: f32,
pub link: Option<String>,
pub code: bool,
pub mention: Option<u64>,
}Fields§
§text: String§color: Option<Color>§background: Option<Color>§weight: Option<FontWeight>§style: Option<FontStyle>§family: Option<String>§underline: bool§strikethrough: bool§size_delta: f32§link: Option<String>§code: bool§mention: Option<u64>Implementations§
Source§impl TextSpan
impl TextSpan
pub fn new(text: impl Into<String>) -> Self
pub fn color(self, color: Color) -> Self
pub fn background(self, color: Color) -> Self
pub fn weight(self, weight: FontWeight) -> Self
pub fn bold(self) -> Self
pub fn semibold(self) -> Self
pub fn medium(self) -> Self
pub fn italic(self) -> Self
pub fn oblique(self) -> Self
pub fn font_style(self, style: FontStyle) -> Self
pub fn font(self, family: impl Into<String>) -> Self
pub fn family(self, family: impl Into<String>) -> Self
pub fn underline(self, on: bool) -> Self
pub fn strikethrough(self, on: bool) -> Self
pub fn size_delta(self, delta: f32) -> Self
pub fn link(self, url: impl Into<String>) -> Self
pub fn mention(self, id: u64) -> Self
pub fn code(self, on: bool) -> Self
Trait Implementations§
impl StructuralPartialEq for TextSpan
Auto Trait Implementations§
impl Freeze for TextSpan
impl RefUnwindSafe for TextSpan
impl Send for TextSpan
impl Sync for TextSpan
impl Unpin for TextSpan
impl UnsafeUnpin for TextSpan
impl UnwindSafe for TextSpan
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