[][src]Enum tbot::types::update::Kind

#[non_exhaustive]pub enum Kind {
    Message(Message),
    EditedMessage(Message),
    ChannelPost(Message),
    EditedChannelPost(Message),
    InlineQuery(InlineQuery),
    CallbackQuery(Query),
    Poll(Poll),
    PollAnswer(Answer),
    ChosenInlineResult(ChosenInlineResult),
    ShippingQuery(Query),
    PreCheckoutQuery(PreCheckoutQuery),
    Unknown,
}

Represents different types of updates from Telegram.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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.

Unknown

Unknown update kind.

Implementations

impl Kind[src]

pub fn is_message(&self) -> bool[src]

Returns true if self is of variant Message.

pub fn expect_message(self) -> Message where
    Self: Debug
[src]

Unwraps the value, yielding the content of Message.

Panics

Panics if the value is not Message, with a panic message including the content of self.

pub fn message(self) -> Option<Message>[src]

Returns Some if self is of variant Message, and None otherwise.

pub fn is_edited_message(&self) -> bool[src]

Returns true if self is of variant EditedMessage.

pub fn expect_edited_message(self) -> Message where
    Self: Debug
[src]

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.

pub fn edited_message(self) -> Option<Message>[src]

Returns Some if self is of variant EditedMessage, and None otherwise.

pub fn is_channel_post(&self) -> bool[src]

Returns true if self is of variant ChannelPost.

pub fn expect_channel_post(self) -> Message where
    Self: Debug
[src]

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.

pub fn channel_post(self) -> Option<Message>[src]

Returns Some if self is of variant ChannelPost, and None otherwise.

pub fn is_edited_channel_post(&self) -> bool[src]

Returns true if self is of variant EditedChannelPost.

pub fn expect_edited_channel_post(self) -> Message where
    Self: Debug
[src]

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.

pub fn edited_channel_post(self) -> Option<Message>[src]

Returns Some if self is of variant EditedChannelPost, and None otherwise.

pub fn is_inline_query(&self) -> bool[src]

Returns true if self is of variant InlineQuery.

pub fn expect_inline_query(self) -> InlineQuery where
    Self: Debug
[src]

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.

pub fn inline_query(self) -> Option<InlineQuery>[src]

Returns Some if self is of variant InlineQuery, and None otherwise.

pub fn is_callback_query(&self) -> bool[src]

Returns true if self is of variant CallbackQuery.

pub fn expect_callback_query(self) -> Query where
    Self: Debug
[src]

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.

pub fn callback_query(self) -> Option<Query>[src]

Returns Some if self is of variant CallbackQuery, and None otherwise.

pub fn is_poll(&self) -> bool[src]

Returns true if self is of variant Poll.

pub fn expect_poll(self) -> Poll where
    Self: Debug
[src]

Unwraps the value, yielding the content of Poll.

Panics

Panics if the value is not Poll, with a panic message including the content of self.

pub fn poll(self) -> Option<Poll>[src]

Returns Some if self is of variant Poll, and None otherwise.

pub fn is_poll_answer(&self) -> bool[src]

Returns true if self is of variant PollAnswer.

pub fn expect_poll_answer(self) -> Answer where
    Self: Debug
[src]

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.

pub fn poll_answer(self) -> Option<Answer>[src]

Returns Some if self is of variant PollAnswer, and None otherwise.

pub fn is_chosen_inline_result(&self) -> bool[src]

Returns true if self is of variant ChosenInlineResult.

pub fn expect_chosen_inline_result(self) -> ChosenInlineResult where
    Self: Debug
[src]

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.

pub fn chosen_inline_result(self) -> Option<ChosenInlineResult>[src]

Returns Some if self is of variant ChosenInlineResult, and None otherwise.

pub fn is_shipping_query(&self) -> bool[src]

Returns true if self is of variant ShippingQuery.

pub fn expect_shipping_query(self) -> Query where
    Self: Debug
[src]

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.

pub fn shipping_query(self) -> Option<Query>[src]

Returns Some if self is of variant ShippingQuery, and None otherwise.

pub fn is_pre_checkout_query(&self) -> bool[src]

Returns true if self is of variant PreCheckoutQuery.

pub fn expect_pre_checkout_query(self) -> PreCheckoutQuery where
    Self: Debug
[src]

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.

pub fn pre_checkout_query(self) -> Option<PreCheckoutQuery>[src]

Returns Some if self is of variant PreCheckoutQuery, and None otherwise.

pub fn is_unknown(&self) -> bool[src]

Returns true if self is of variant Unknown.

Trait Implementations

impl Clone for Kind[src]

impl Debug for Kind[src]

impl PartialEq<Kind> for Kind[src]

impl StructuralPartialEq for Kind[src]

Auto Trait Implementations

impl RefUnwindSafe for Kind

impl Send for Kind

impl Sync for Kind

impl Unpin for Kind

impl UnwindSafe for Kind

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> WithSubscriber for T[src]