#[non_exhaustive]
pub enum Kind {
Show 14 variants
Message(Message),
EditedMessage(Message),
ChannelPost(Message),
EditedChannelPost(Message),
InlineQuery(InlineQuery),
CallbackQuery(Query),
Poll(Poll),
PollAnswer(Answer),
ChosenInlineResult(ChosenInlineResult),
ShippingQuery(Query),
PreCheckoutQuery(PreCheckoutQuery),
MyChatMember(Updated),
ChatMember(Updated),
Unknown,
}Expand description
Represents different types of updates from Telegram.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Message(Message)
A new chat message.
EditedMessage(Message)
An edited message.
ChannelPost(Message)
A new channel post.
EditedChannelPost(Message)
An edited channel post.
InlineQuery(InlineQuery)
An inline query.
CallbackQuery(Query)
An incoming callback query.
Poll(Poll)
A new state of a poll.
PollAnswer(Answer)
A user changed their answer in a non-anonymous poll.
ChosenInlineResult(ChosenInlineResult)
A chosen inline result.
ShippingQuery(Query)
A shipping query.
PreCheckoutQuery(PreCheckoutQuery)
A pre-checkout query.
MyChatMember(Updated)
The bot’s chat member status was updated.
ChatMember(Updated)
A user’s chat member status was updated.
Unknown
Unknown update kind.
Implementations§
source§impl Kind
impl Kind
sourcepub fn is_message(&self) -> bool
pub fn is_message(&self) -> bool
Returns true if self is of variant Message.
sourcepub fn expect_message(self) -> Messagewhere
Self: Debug,
pub fn expect_message(self) -> Messagewhere
Self: Debug,
sourcepub fn message(self) -> Option<Message>
pub fn message(self) -> Option<Message>
Returns Some if self is of variant Message, and None otherwise.
sourcepub fn is_edited_message(&self) -> bool
pub fn is_edited_message(&self) -> bool
Returns true if self is of variant EditedMessage.
sourcepub fn expect_edited_message(self) -> Messagewhere
Self: Debug,
pub fn expect_edited_message(self) -> Messagewhere
Self: Debug,
Unwraps the value, yielding the content of EditedMessage.
Panics
Panics if the value is not EditedMessage, with a panic message including the content of self.
sourcepub fn edited_message(self) -> Option<Message>
pub fn edited_message(self) -> Option<Message>
Returns Some if self is of variant EditedMessage, and None otherwise.
sourcepub fn is_channel_post(&self) -> bool
pub fn is_channel_post(&self) -> bool
Returns true if self is of variant ChannelPost.
sourcepub fn expect_channel_post(self) -> Messagewhere
Self: Debug,
pub fn expect_channel_post(self) -> Messagewhere
Self: Debug,
Unwraps the value, yielding the content of ChannelPost.
Panics
Panics if the value is not ChannelPost, with a panic message including the content of self.
sourcepub fn channel_post(self) -> Option<Message>
pub fn channel_post(self) -> Option<Message>
Returns Some if self is of variant ChannelPost, and None otherwise.
sourcepub fn is_edited_channel_post(&self) -> bool
pub fn is_edited_channel_post(&self) -> bool
Returns true if self is of variant EditedChannelPost.
sourcepub fn expect_edited_channel_post(self) -> Messagewhere
Self: Debug,
pub fn expect_edited_channel_post(self) -> Messagewhere
Self: Debug,
Unwraps the value, yielding the content of EditedChannelPost.
Panics
Panics if the value is not EditedChannelPost, with a panic message including the content of self.
sourcepub fn edited_channel_post(self) -> Option<Message>
pub fn edited_channel_post(self) -> Option<Message>
Returns Some if self is of variant EditedChannelPost, and None otherwise.
sourcepub fn is_inline_query(&self) -> bool
pub fn is_inline_query(&self) -> bool
Returns true if self is of variant InlineQuery.
sourcepub fn expect_inline_query(self) -> InlineQuerywhere
Self: Debug,
pub fn expect_inline_query(self) -> InlineQuerywhere
Self: Debug,
Unwraps the value, yielding the content of InlineQuery.
Panics
Panics if the value is not InlineQuery, with a panic message including the content of self.
sourcepub fn inline_query(self) -> Option<InlineQuery>
pub fn inline_query(self) -> Option<InlineQuery>
Returns Some if self is of variant InlineQuery, and None otherwise.
sourcepub fn is_callback_query(&self) -> bool
pub fn is_callback_query(&self) -> bool
Returns true if self is of variant CallbackQuery.
sourcepub fn expect_callback_query(self) -> Querywhere
Self: Debug,
pub fn expect_callback_query(self) -> Querywhere
Self: Debug,
Unwraps the value, yielding the content of CallbackQuery.
Panics
Panics if the value is not CallbackQuery, with a panic message including the content of self.
sourcepub fn callback_query(self) -> Option<Query>
pub fn callback_query(self) -> Option<Query>
Returns Some if self is of variant CallbackQuery, and None otherwise.
sourcepub fn expect_poll(self) -> Pollwhere
Self: Debug,
pub fn expect_poll(self) -> Pollwhere
Self: Debug,
sourcepub fn is_poll_answer(&self) -> bool
pub fn is_poll_answer(&self) -> bool
Returns true if self is of variant PollAnswer.
sourcepub fn expect_poll_answer(self) -> Answerwhere
Self: Debug,
pub fn expect_poll_answer(self) -> Answerwhere
Self: Debug,
Unwraps the value, yielding the content of PollAnswer.
Panics
Panics if the value is not PollAnswer, with a panic message including the content of self.
sourcepub fn poll_answer(self) -> Option<Answer>
pub fn poll_answer(self) -> Option<Answer>
Returns Some if self is of variant PollAnswer, and None otherwise.
sourcepub fn is_chosen_inline_result(&self) -> bool
pub fn is_chosen_inline_result(&self) -> bool
Returns true if self is of variant ChosenInlineResult.
sourcepub fn expect_chosen_inline_result(self) -> ChosenInlineResultwhere
Self: Debug,
pub fn expect_chosen_inline_result(self) -> ChosenInlineResultwhere
Self: Debug,
Unwraps the value, yielding the content of ChosenInlineResult.
Panics
Panics if the value is not ChosenInlineResult, with a panic message including the content of self.
sourcepub fn chosen_inline_result(self) -> Option<ChosenInlineResult>
pub fn chosen_inline_result(self) -> Option<ChosenInlineResult>
Returns Some if self is of variant ChosenInlineResult, and None otherwise.
sourcepub fn is_shipping_query(&self) -> bool
pub fn is_shipping_query(&self) -> bool
Returns true if self is of variant ShippingQuery.
sourcepub fn expect_shipping_query(self) -> Querywhere
Self: Debug,
pub fn expect_shipping_query(self) -> Querywhere
Self: Debug,
Unwraps the value, yielding the content of ShippingQuery.
Panics
Panics if the value is not ShippingQuery, with a panic message including the content of self.
sourcepub fn shipping_query(self) -> Option<Query>
pub fn shipping_query(self) -> Option<Query>
Returns Some if self is of variant ShippingQuery, and None otherwise.
sourcepub fn is_pre_checkout_query(&self) -> bool
pub fn is_pre_checkout_query(&self) -> bool
Returns true if self is of variant PreCheckoutQuery.
sourcepub fn expect_pre_checkout_query(self) -> PreCheckoutQuerywhere
Self: Debug,
pub fn expect_pre_checkout_query(self) -> PreCheckoutQuerywhere
Self: Debug,
Unwraps the value, yielding the content of PreCheckoutQuery.
Panics
Panics if the value is not PreCheckoutQuery, with a panic message including the content of self.
sourcepub fn pre_checkout_query(self) -> Option<PreCheckoutQuery>
pub fn pre_checkout_query(self) -> Option<PreCheckoutQuery>
Returns Some if self is of variant PreCheckoutQuery, and None otherwise.
sourcepub fn is_my_chat_member(&self) -> bool
pub fn is_my_chat_member(&self) -> bool
Returns true if self is of variant MyChatMember.
sourcepub fn expect_my_chat_member(self) -> Updatedwhere
Self: Debug,
pub fn expect_my_chat_member(self) -> Updatedwhere
Self: Debug,
Unwraps the value, yielding the content of MyChatMember.
Panics
Panics if the value is not MyChatMember, with a panic message including the content of self.
sourcepub fn my_chat_member(self) -> Option<Updated>
pub fn my_chat_member(self) -> Option<Updated>
Returns Some if self is of variant MyChatMember, and None otherwise.
sourcepub fn is_chat_member(&self) -> bool
pub fn is_chat_member(&self) -> bool
Returns true if self is of variant ChatMember.
sourcepub fn expect_chat_member(self) -> Updatedwhere
Self: Debug,
pub fn expect_chat_member(self) -> Updatedwhere
Self: Debug,
Unwraps the value, yielding the content of ChatMember.
Panics
Panics if the value is not ChatMember, with a panic message including the content of self.
sourcepub fn chat_member(self) -> Option<Updated>
pub fn chat_member(self) -> Option<Updated>
Returns Some if self is of variant ChatMember, and None otherwise.
sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true if self is of variant Unknown.