pub enum RichText {
Show 27 variants
Plain(String),
Array(Vec<RichText>),
Bold(Box<RichTextBold>),
Italic(Box<RichTextItalic>),
Underline(Box<RichTextUnderline>),
Strikethrough(Box<RichTextStrikethrough>),
Spoiler(Box<RichTextSpoiler>),
DateTime(Box<RichTextDateTime>),
TextMention(Box<RichTextTextMention>),
Subscript(Box<RichTextSubscript>),
Superscript(Box<RichTextSuperscript>),
Marked(Box<RichTextMarked>),
Code(Box<RichTextCode>),
CustomEmoji(Box<RichTextCustomEmoji>),
MathematicalExpression(Box<RichTextMathematicalExpression>),
Url(Box<RichTextUrl>),
EmailAddress(Box<RichTextEmailAddress>),
PhoneNumber(Box<RichTextPhoneNumber>),
BankCardNumber(Box<RichTextBankCardNumber>),
Mention(Box<RichTextMention>),
Hashtag(Box<RichTextHashtag>),
Cashtag(Box<RichTextCashtag>),
BotCommand(Box<RichTextBotCommand>),
Anchor(Box<RichTextAnchor>),
AnchorLink(Box<RichTextAnchorLink>),
Footnote(Box<RichTextFootnote>),
Reference(Box<RichTextReference>),
}Expand description
Variants§
Plain(String)
Plain text without any formatting.
Array(Vec<RichText>)
A sequence of rich-text nodes rendered consecutively.
Bold(Box<RichTextBold>)
Bold formatting.
Italic(Box<RichTextItalic>)
Italic formatting.
Underline(Box<RichTextUnderline>)
Underline formatting.
Strikethrough(Box<RichTextStrikethrough>)
Strikethrough formatting.
Spoiler(Box<RichTextSpoiler>)
Spoiler — text hidden until tapped.
DateTime(Box<RichTextDateTime>)
A date/time entity.
TextMention(Box<RichTextTextMention>)
A mention by user object.
Subscript(Box<RichTextSubscript>)
Subscript text.
Superscript(Box<RichTextSuperscript>)
Superscript text.
Marked(Box<RichTextMarked>)
Highlighted/marked text.
Code(Box<RichTextCode>)
Inline monospace code.
CustomEmoji(Box<RichTextCustomEmoji>)
A custom emoji.
MathematicalExpression(Box<RichTextMathematicalExpression>)
An inline LaTeX mathematical expression.
Url(Box<RichTextUrl>)
A hyperlink.
EmailAddress(Box<RichTextEmailAddress>)
An e-mail address link.
PhoneNumber(Box<RichTextPhoneNumber>)
A telephone number link.
BankCardNumber(Box<RichTextBankCardNumber>)
A bank card number.
Mention(Box<RichTextMention>)
A @username mention.
Hashtag(Box<RichTextHashtag>)
A #hashtag.
Cashtag(Box<RichTextCashtag>)
A $cashtag.
BotCommand(Box<RichTextBotCommand>)
A /bot_command.
Anchor(Box<RichTextAnchor>)
An in-document anchor definition.
AnchorLink(Box<RichTextAnchorLink>)
A link targeting an in-document anchor.
Footnote(Box<RichTextFootnote>)
A footnote body.
Reference(Box<RichTextReference>)
A reference to a footnote.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RichText
impl<'de> Deserialize<'de> for RichText
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RichText
impl RefUnwindSafe for RichText
impl Send for RichText
impl Sync for RichText
impl Unpin for RichText
impl UnsafeUnpin for RichText
impl UnwindSafe for RichText
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