pub enum Kind {
Mention,
Hashtag,
Cashtag,
BotCommand,
Url,
Email,
PhoneNumber,
TextLink(String),
TextMention(User),
}
Expand description
Represents the semantic meaning of the entity.
Variants§
Mention
A mention.
Hashtag
A hashtag.
Cashtag
A cashtag (e.g. $TBOT
).
BotCommand
A bot command.
Url
An URL.
An email.
PhoneNumber
A phone number.
TextLink(String)
A clickable text link.
TextMention(User)
A mention for users without username.
Implementations§
source§impl Kind
impl Kind
sourcepub fn is_mention(&self) -> bool
pub fn is_mention(&self) -> bool
Returns true
if self
is of variant Mention
.
sourcepub fn is_hashtag(&self) -> bool
pub fn is_hashtag(&self) -> bool
Returns true
if self
is of variant Hashtag
.
sourcepub fn is_cashtag(&self) -> bool
pub fn is_cashtag(&self) -> bool
Returns true
if self
is of variant Cashtag
.
sourcepub fn is_bot_command(&self) -> bool
pub fn is_bot_command(&self) -> bool
Returns true
if self
is of variant BotCommand
.
sourcepub fn is_phone_number(&self) -> bool
pub fn is_phone_number(&self) -> bool
Returns true
if self
is of variant PhoneNumber
.
sourcepub fn is_text_link(&self) -> bool
pub fn is_text_link(&self) -> bool
Returns true
if self
is of variant TextLink
.
sourcepub fn expect_text_link(self) -> Stringwhere
Self: Debug,
pub fn expect_text_link(self) -> Stringwhere
Self: Debug,
sourcepub fn text_link(self) -> Option<String>
pub fn text_link(self) -> Option<String>
Returns Some
if self
is of variant TextLink
, and None
otherwise.
sourcepub fn is_text_mention(&self) -> bool
pub fn is_text_mention(&self) -> bool
Returns true
if self
is of variant TextMention
.
sourcepub fn expect_text_mention(self) -> Userwhere
Self: Debug,
pub fn expect_text_mention(self) -> Userwhere
Self: Debug,
Unwraps the value, yielding the content of TextMention
.
Panics
Panics if the value is not TextMention
, with a panic message including the content of self
.
sourcepub fn text_mention(self) -> Option<User>
pub fn text_mention(self) -> Option<User>
Returns Some
if self
is of variant TextMention
, and None
otherwise.