pub enum RichTextNode {
Show 25 variants
Bold(RichTextBold),
Italic(RichTextItalic),
Underline(RichTextUnderline),
Strikethrough(RichTextStrikethrough),
Spoiler(RichTextSpoiler),
DateTime(RichTextDateTime),
TextMention(RichTextTextMention),
Subscript(RichTextSubscript),
Superscript(RichTextSuperscript),
Marked(RichTextMarked),
Code(RichTextCode),
CustomEmoji(RichTextCustomEmoji),
MathematicalExpression(RichTextMathematicalExpression),
Url(RichTextUrl),
EmailAddress(RichTextEmailAddress),
PhoneNumber(RichTextPhoneNumber),
BankCardNumber(RichTextBankCardNumber),
Mention(RichTextMention),
Hashtag(RichTextHashtag),
Cashtag(RichTextCashtag),
BotCommand(RichTextBotCommand),
Anchor(RichTextAnchor),
AnchorLink(RichTextAnchorLink),
Reference(RichTextReference),
ReferenceLink(RichTextReferenceLink),
}Expand description
A single formatted rich-text node, dispatched on its type discriminant.
An unrecognised type is a deserialization error rather than a silent
fallback. That is deliberate — silently mistyping formatted text is the bug
this enum exists to fix — but it does mean a rich-text kind introduced by a
future Bot API version will fail to parse until it is added here.
Variants§
Bold(RichTextBold)
Bold formatting.
Italic(RichTextItalic)
Italic formatting.
Underline(RichTextUnderline)
Underline formatting.
Strikethrough(RichTextStrikethrough)
Strikethrough formatting.
Spoiler(RichTextSpoiler)
Spoiler — text hidden until tapped.
DateTime(RichTextDateTime)
A date/time entity.
TextMention(RichTextTextMention)
A mention by user object.
Subscript(RichTextSubscript)
Subscript text.
Superscript(RichTextSuperscript)
Superscript text.
Marked(RichTextMarked)
Highlighted/marked text.
Code(RichTextCode)
Inline monospace code.
CustomEmoji(RichTextCustomEmoji)
A custom emoji.
MathematicalExpression(RichTextMathematicalExpression)
An inline LaTeX mathematical expression.
Url(RichTextUrl)
A hyperlink.
EmailAddress(RichTextEmailAddress)
An e-mail address link.
PhoneNumber(RichTextPhoneNumber)
A telephone number link.
BankCardNumber(RichTextBankCardNumber)
A bank card number.
Mention(RichTextMention)
A @username mention.
Hashtag(RichTextHashtag)
A #hashtag.
Cashtag(RichTextCashtag)
A $cashtag.
BotCommand(RichTextBotCommand)
A /bot_command.
Anchor(RichTextAnchor)
An in-document anchor definition.
AnchorLink(RichTextAnchorLink)
A link targeting an in-document anchor.
Reference(RichTextReference)
A reference to a footnote.
ReferenceLink(RichTextReferenceLink)
A link to a reference.
Trait Implementations§
Source§impl Clone for RichTextNode
impl Clone for RichTextNode
Source§fn clone(&self) -> RichTextNode
fn clone(&self) -> RichTextNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more