pub struct MessageEntity {
pub ty: String,
pub offset: i64,
pub length: i64,
pub url: Option<String>,
pub user: Option<User>,
}
Expand description
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
Fields§
§ty: String
Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
offset: i64
Offset in UTF-16 code units to the start of the entity
length: i64
Length of the entity in UTF-16 code units
url: Option<String>
Optional. For “text_link” only, url that will be opened after user taps on the text
user: Option<User>
Optional. For “text_mention” only, the mentioned user
Trait Implementations§
Source§impl Clone for MessageEntity
impl Clone for MessageEntity
Source§fn clone(&self) -> MessageEntity
fn clone(&self) -> MessageEntity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MessageEntity
impl Debug for MessageEntity
Source§impl<'de> Deserialize<'de> for MessageEntity
impl<'de> Deserialize<'de> for MessageEntity
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
Source§impl PartialEq for MessageEntity
impl PartialEq for MessageEntity
Source§impl PartialOrd for MessageEntity
impl PartialOrd for MessageEntity
Source§impl Serialize for MessageEntity
impl Serialize for MessageEntity
impl StructuralPartialEq for MessageEntity
Auto Trait Implementations§
impl Freeze for MessageEntity
impl RefUnwindSafe for MessageEntity
impl Send for MessageEntity
impl Sync for MessageEntity
impl Unpin for MessageEntity
impl UnwindSafe for MessageEntity
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