TextEntityType

Enum TextEntityType 

Source
pub enum TextEntityType {
Show 18 variants BankCardNumber(TextEntityTypeBankCardNumber), Bold(TextEntityTypeBold), BotCommand(TextEntityTypeBotCommand), Cashtag(TextEntityTypeCashtag), Code(TextEntityTypeCode), EmailAddress(TextEntityTypeEmailAddress), Hashtag(TextEntityTypeHashtag), Italic(TextEntityTypeItalic), MediaTimestamp(TextEntityTypeMediaTimestamp), Mention(TextEntityTypeMention), MentionName(TextEntityTypeMentionName), PhoneNumber(TextEntityTypePhoneNumber), Pre(TextEntityTypePre), PreCode(TextEntityTypePreCode), Strikethrough(TextEntityTypeStrikethrough), TextUrl(TextEntityTypeTextUrl), Underline(TextEntityTypeUnderline), Url(TextEntityTypeUrl), // some variants omitted
}
Expand description

Represents a part of the text which must be formatted differently

Variants§

§

BankCardNumber(TextEntityTypeBankCardNumber)

A bank card number. The getBankCardInfo method can be used to get information about the bank card

§

Bold(TextEntityTypeBold)

A bold text

§

BotCommand(TextEntityTypeBotCommand)

A bot command, beginning with “/”

§

Cashtag(TextEntityTypeCashtag)

A cashtag text, beginning with “$” and consisting of capital English letters (e.g., “$USD”)

§

Code(TextEntityTypeCode)

Text that must be formatted as if inside a code HTML tag

§

EmailAddress(TextEntityTypeEmailAddress)

An email address

§

Hashtag(TextEntityTypeHashtag)

A hashtag text, beginning with “#”

§

Italic(TextEntityTypeItalic)

An italic text

§

MediaTimestamp(TextEntityTypeMediaTimestamp)

A media timestamp

§

Mention(TextEntityTypeMention)

A mention of a user by their username

§

MentionName(TextEntityTypeMentionName)

A text shows instead of a raw mention of the user (e.g., when the user has no username)

§

PhoneNumber(TextEntityTypePhoneNumber)

A phone number

§

Pre(TextEntityTypePre)

Text that must be formatted as if inside a pre HTML tag

§

PreCode(TextEntityTypePreCode)

Text that must be formatted as if inside pre, and code HTML tags

§

Strikethrough(TextEntityTypeStrikethrough)

A strikethrough text

§

TextUrl(TextEntityTypeTextUrl)

A text description shown instead of a raw URL

§

Underline(TextEntityTypeUnderline)

An underlined text

§

Url(TextEntityTypeUrl)

An HTTP URL

Implementations§

Source§

impl TextEntityType

Source

pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self>

Source

pub fn is_bank_card_number(&self) -> bool

Source

pub fn is_bold(&self) -> bool

Source

pub fn is_bot_command(&self) -> bool

Source

pub fn is_cashtag(&self) -> bool

Source

pub fn is_code(&self) -> bool

Source

pub fn is_email_address(&self) -> bool

Source

pub fn is_hashtag(&self) -> bool

Source

pub fn is_italic(&self) -> bool

Source

pub fn is_media_timestamp(&self) -> bool

Source

pub fn is_mention(&self) -> bool

Source

pub fn is_mention_name(&self) -> bool

Source

pub fn is_phone_number(&self) -> bool

Source

pub fn is_pre(&self) -> bool

Source

pub fn is_pre_code(&self) -> bool

Source

pub fn is_strikethrough(&self) -> bool

Source

pub fn is_text_url(&self) -> bool

Source

pub fn is_underline(&self) -> bool

Source

pub fn is_url(&self) -> bool

Source

pub fn on_bank_card_number<F: FnOnce(&TextEntityTypeBankCardNumber)>( &self, fnc: F, ) -> &Self

Source

pub fn on_bold<F: FnOnce(&TextEntityTypeBold)>(&self, fnc: F) -> &Self

Source

pub fn on_bot_command<F: FnOnce(&TextEntityTypeBotCommand)>( &self, fnc: F, ) -> &Self

Source

pub fn on_cashtag<F: FnOnce(&TextEntityTypeCashtag)>(&self, fnc: F) -> &Self

Source

pub fn on_code<F: FnOnce(&TextEntityTypeCode)>(&self, fnc: F) -> &Self

Source

pub fn on_email_address<F: FnOnce(&TextEntityTypeEmailAddress)>( &self, fnc: F, ) -> &Self

Source

pub fn on_hashtag<F: FnOnce(&TextEntityTypeHashtag)>(&self, fnc: F) -> &Self

Source

pub fn on_italic<F: FnOnce(&TextEntityTypeItalic)>(&self, fnc: F) -> &Self

Source

pub fn on_media_timestamp<F: FnOnce(&TextEntityTypeMediaTimestamp)>( &self, fnc: F, ) -> &Self

Source

pub fn on_mention<F: FnOnce(&TextEntityTypeMention)>(&self, fnc: F) -> &Self

Source

pub fn on_mention_name<F: FnOnce(&TextEntityTypeMentionName)>( &self, fnc: F, ) -> &Self

Source

pub fn on_phone_number<F: FnOnce(&TextEntityTypePhoneNumber)>( &self, fnc: F, ) -> &Self

Source

pub fn on_pre<F: FnOnce(&TextEntityTypePre)>(&self, fnc: F) -> &Self

Source

pub fn on_pre_code<F: FnOnce(&TextEntityTypePreCode)>(&self, fnc: F) -> &Self

Source

pub fn on_strikethrough<F: FnOnce(&TextEntityTypeStrikethrough)>( &self, fnc: F, ) -> &Self

Source

pub fn on_text_url<F: FnOnce(&TextEntityTypeTextUrl)>(&self, fnc: F) -> &Self

Source

pub fn on_underline<F: FnOnce(&TextEntityTypeUnderline)>(&self, fnc: F) -> &Self

Source

pub fn on_url<F: FnOnce(&TextEntityTypeUrl)>(&self, fnc: F) -> &Self

Source

pub fn as_bank_card_number(&self) -> Option<&TextEntityTypeBankCardNumber>

Source

pub fn as_bold(&self) -> Option<&TextEntityTypeBold>

Source

pub fn as_bot_command(&self) -> Option<&TextEntityTypeBotCommand>

Source

pub fn as_cashtag(&self) -> Option<&TextEntityTypeCashtag>

Source

pub fn as_code(&self) -> Option<&TextEntityTypeCode>

Source

pub fn as_email_address(&self) -> Option<&TextEntityTypeEmailAddress>

Source

pub fn as_hashtag(&self) -> Option<&TextEntityTypeHashtag>

Source

pub fn as_italic(&self) -> Option<&TextEntityTypeItalic>

Source

pub fn as_media_timestamp(&self) -> Option<&TextEntityTypeMediaTimestamp>

Source

pub fn as_mention(&self) -> Option<&TextEntityTypeMention>

Source

pub fn as_mention_name(&self) -> Option<&TextEntityTypeMentionName>

Source

pub fn as_phone_number(&self) -> Option<&TextEntityTypePhoneNumber>

Source

pub fn as_pre(&self) -> Option<&TextEntityTypePre>

Source

pub fn as_pre_code(&self) -> Option<&TextEntityTypePreCode>

Source

pub fn as_strikethrough(&self) -> Option<&TextEntityTypeStrikethrough>

Source

pub fn as_text_url(&self) -> Option<&TextEntityTypeTextUrl>

Source

pub fn as_underline(&self) -> Option<&TextEntityTypeUnderline>

Source

pub fn as_url(&self) -> Option<&TextEntityTypeUrl>

Source

pub fn bank_card_number<T: AsRef<TextEntityTypeBankCardNumber>>(t: T) -> Self

Source

pub fn bold<T: AsRef<TextEntityTypeBold>>(t: T) -> Self

Source

pub fn bot_command<T: AsRef<TextEntityTypeBotCommand>>(t: T) -> Self

Source

pub fn cashtag<T: AsRef<TextEntityTypeCashtag>>(t: T) -> Self

Source

pub fn code<T: AsRef<TextEntityTypeCode>>(t: T) -> Self

Source

pub fn email_address<T: AsRef<TextEntityTypeEmailAddress>>(t: T) -> Self

Source

pub fn hashtag<T: AsRef<TextEntityTypeHashtag>>(t: T) -> Self

Source

pub fn italic<T: AsRef<TextEntityTypeItalic>>(t: T) -> Self

Source

pub fn media_timestamp<T: AsRef<TextEntityTypeMediaTimestamp>>(t: T) -> Self

Source

pub fn mention<T: AsRef<TextEntityTypeMention>>(t: T) -> Self

Source

pub fn mention_name<T: AsRef<TextEntityTypeMentionName>>(t: T) -> Self

Source

pub fn phone_number<T: AsRef<TextEntityTypePhoneNumber>>(t: T) -> Self

Source

pub fn pre<T: AsRef<TextEntityTypePre>>(t: T) -> Self

Source

pub fn pre_code<T: AsRef<TextEntityTypePreCode>>(t: T) -> Self

Source

pub fn strikethrough<T: AsRef<TextEntityTypeStrikethrough>>(t: T) -> Self

Source

pub fn text_url<T: AsRef<TextEntityTypeTextUrl>>(t: T) -> Self

Source

pub fn underline<T: AsRef<TextEntityTypeUnderline>>(t: T) -> Self

Source

pub fn url<T: AsRef<TextEntityTypeUrl>>(t: T) -> Self

Trait Implementations§

Source§

impl AsRef<TextEntityType> for TextEntityType

Source§

fn as_ref(&self) -> &TextEntityType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for TextEntityType

Source§

fn clone(&self) -> TextEntityType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TextEntityType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TextEntityType

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TextEntityType

Source§

fn deserialize<D>(deserializer: D) -> Result<TextEntityType, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl RObject for TextEntityType

Source§

fn to_json(&self) -> RTDResult<String>

Return td type to json string
Source§

impl Serialize for TextEntityType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,