#[non_exhaustive]pub enum EntityKind {
}Expand description
Represents an entity’s kind.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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.
Bold
Text in bold.
Italic
Text in italic.
Underline
Underlined text.
Strikethrough
Strikethrough text.
Code
String of monowidth text.
Pre(Option<String>)
Block of monowidth text.
TextLink(String)
A clickable text url.
TextMention(User)
A mention for users without username.
Implementations§
Source§impl EntityKind
impl EntityKind
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_underline(&self) -> bool
pub fn is_underline(&self) -> bool
Returns true if self is of variant Underline.
Sourcepub fn is_strikethrough(&self) -> bool
pub fn is_strikethrough(&self) -> bool
Returns true if self is of variant Strikethrough.
Sourcepub fn expect_pre(self) -> Option<String>where
Self: Debug,
pub fn expect_pre(self) -> Option<String>where
Self: Debug,
Sourcepub fn pre(self) -> Option<Option<String>>
pub fn pre(self) -> Option<Option<String>>
Returns Some if self is of variant Pre, and None otherwise.
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.
Trait Implementations§
Source§impl Clone for EntityKind
impl Clone for EntityKind
Source§fn clone(&self) -> EntityKind
fn clone(&self) -> EntityKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntityKind
impl Debug for EntityKind
Source§impl Hash for EntityKind
impl Hash for EntityKind
Source§impl PartialEq for EntityKind
impl PartialEq for EntityKind
impl Eq for EntityKind
impl StructuralPartialEq for EntityKind
Auto Trait Implementations§
impl Freeze for EntityKind
impl RefUnwindSafe for EntityKind
impl Send for EntityKind
impl Sync for EntityKind
impl Unpin for EntityKind
impl UnwindSafe for EntityKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.