pub enum TextEntity {
Show 19 variants
Blockquote(TextEntityPosition),
Bold(TextEntityPosition),
BotCommand(TextEntityPosition),
Cashtag(TextEntityPosition),
Code(TextEntityPosition),
CustomEmoji {
custom_emoji_id: String,
position: TextEntityPosition,
},
Email(TextEntityPosition),
ExpandableBlockquote(TextEntityPosition),
Hashtag(TextEntityPosition),
Italic(TextEntityPosition),
Mention(TextEntityPosition),
PhoneNumber(TextEntityPosition),
Pre {
position: TextEntityPosition,
language: Option<String>,
},
Spoiler(TextEntityPosition),
Strikethrough(TextEntityPosition),
TextLink {
position: TextEntityPosition,
url: String,
},
TextMention {
position: TextEntityPosition,
user: User,
},
Underline(TextEntityPosition),
Url(TextEntityPosition),
}
Expand description
Represents an entity in a text.
Variants§
Blockquote(TextEntityPosition)
A block quotation.
Bold(TextEntityPosition)
A bold text.
BotCommand(TextEntityPosition)
A bot command.
Cashtag(TextEntityPosition)
A cashtag.
Code(TextEntityPosition)
A monospace string.
CustomEmoji
An inline custom emoji sticker.
Fields
custom_emoji_id: String
Unique identifier of the custom emoji.
Use crate::types::GetCustomEmojiStickers
to get full information about the sticker.
position: TextEntityPosition
Position of entity in text.
Email(TextEntityPosition)
An E-Mail.
ExpandableBlockquote(TextEntityPosition)
Collapsed-by-default block quotation.
Hashtag(TextEntityPosition)
A hashtag.
Italic(TextEntityPosition)
An italic text.
Mention(TextEntityPosition)
A user mention (e.g. @username).
PhoneNumber(TextEntityPosition)
A phone number.
Pre
A monospace block.
Fields
position: TextEntityPosition
The position of the entity in the text.
Spoiler(TextEntityPosition)
A spoiler message.
Strikethrough(TextEntityPosition)
A strikethrough text.
TextLink
A clickable text URLs.
Fields
position: TextEntityPosition
The position of the entity in the text.
TextMention
A user mention without a username.
Fields
position: TextEntityPosition
The position of the entity in the text.
Underline(TextEntityPosition)
An underlined text.
Url(TextEntityPosition)
An URL.
Implementations§
Source§impl TextEntity
impl TextEntity
Sourcepub fn blockquote<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn blockquote<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn bold<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn bold<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn bot_command<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn bot_command<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn cashtag<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn cashtag<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn code<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn code<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn email<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn email<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn expandable_blockquote<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn expandable_blockquote<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn hashtag<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn hashtag<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn italic<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn italic<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn mention<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn mention<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn phone_number<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn phone_number<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn spoiler<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn spoiler<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn strikethrough<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn strikethrough<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn underline<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
pub fn underline<T: Into<TextEntityPosition>>(pos: T) -> TextEntity
Sourcepub fn custom_emoji<P: Into<TextEntityPosition>, I: Into<String>>(
pos: P,
custom_emoji_id: I,
) -> TextEntity
pub fn custom_emoji<P: Into<TextEntityPosition>, I: Into<String>>( pos: P, custom_emoji_id: I, ) -> TextEntity
Creates a new TextEntity
.
§Arguments
pos
- Position of the entity in UTF-16 code units.custom_emoji_id
- Unique identifier of the custom emoji.
Sourcepub fn pre<P: Into<TextEntityPosition>, L: Into<String>>(
pos: P,
language: Option<L>,
) -> TextEntity
pub fn pre<P: Into<TextEntityPosition>, L: Into<String>>( pos: P, language: Option<L>, ) -> TextEntity
Creates a new TextEntity
.
§Arguments
pos
- Position of the entity in UTF-16 code units.language
- The programming language of the entity text.
Sourcepub fn text_link<P: Into<TextEntityPosition>, U: Into<String>>(
pos: P,
url: U,
) -> TextEntity
pub fn text_link<P: Into<TextEntityPosition>, U: Into<String>>( pos: P, url: U, ) -> TextEntity
Creates a new TextEntity
.
§Arguments
pos
- The position of the entity in UTF-16 code units.url
- The URL that will be opened after user taps on the text.
Sourcepub fn text_mention<P: Into<TextEntityPosition>>(
pos: P,
user: User,
) -> TextEntity
pub fn text_mention<P: Into<TextEntityPosition>>( pos: P, user: User, ) -> TextEntity
Creates a new TextEntity
.
§Arguments
pos
- The position of the entity in UTF-16 code units.user
- The user to be mentioned.
Trait Implementations§
Source§impl Clone for TextEntity
impl Clone for TextEntity
Source§fn clone(&self) -> TextEntity
fn clone(&self) -> TextEntity
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more