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>) -> TextSpan
pub fn color(self, color: Color) -> TextSpan
pub fn background(self, color: Color) -> TextSpan
pub fn weight(self, weight: FontWeight) -> TextSpan
pub fn bold(self) -> TextSpan
pub fn semibold(self) -> TextSpan
pub fn medium(self) -> TextSpan
pub fn italic(self) -> TextSpan
pub fn oblique(self) -> TextSpan
pub fn font_style(self, style: FontStyle) -> TextSpan
pub fn font(self, family: impl Into<String>) -> TextSpan
pub fn family(self, family: impl Into<String>) -> TextSpan
pub fn underline(self, on: bool) -> TextSpan
pub fn strikethrough(self, on: bool) -> TextSpan
pub fn size_delta(self, delta: f32) -> TextSpan
pub fn link(self, url: impl Into<String>) -> TextSpan
pub fn mention(self, id: u64) -> TextSpan
pub fn code(self, on: bool) -> TextSpan
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