Struct botapi::gen_types::Update

source ·
pub struct Update { /* private fields */ }
Expand description

This object represents an incoming update.At most one of the optional parameters can be present in any given update.

Implementations§

source§

impl Update

source

pub fn noskip(self) -> NoSkipUpdate

source§

impl Update

source

pub fn new(update_id: i64) -> Self

source

pub fn get_update_id<'a>(&'a self) -> i64

The update’s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

source

pub fn get_update_id_ref<'a>(&'a self) -> i64

The update’s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

source

pub fn get_message<'a>(&'a self) -> Option<Cow<'a, Message>>

Optional. New incoming message of any kind - text, photo, sticker, etc.

source

pub fn get_message_ref<'a>(&'a self) -> Option<&'a Message>

Optional. New incoming message of any kind - text, photo, sticker, etc.

source

pub fn get_edited_message<'a>(&'a self) -> Option<Cow<'a, Message>>

Optional. New version of a message that is known to the bot and was edited

source

pub fn get_edited_message_ref<'a>(&'a self) -> Option<&'a Message>

Optional. New version of a message that is known to the bot and was edited

source

pub fn get_channel_post<'a>(&'a self) -> Option<Cow<'a, Message>>

Optional. New incoming channel post of any kind - text, photo, sticker, etc.

source

pub fn get_channel_post_ref<'a>(&'a self) -> Option<&'a Message>

Optional. New incoming channel post of any kind - text, photo, sticker, etc.

source

pub fn get_edited_channel_post<'a>(&'a self) -> Option<Cow<'a, Message>>

Optional. New version of a channel post that is known to the bot and was edited

source

pub fn get_edited_channel_post_ref<'a>(&'a self) -> Option<&'a Message>

Optional. New version of a channel post that is known to the bot and was edited

source

pub fn get_inline_query<'a>(&'a self) -> Option<Cow<'a, InlineQuery>>

Optional. New incoming inline query

source

pub fn get_inline_query_ref<'a>(&'a self) -> Option<&'a InlineQuery>

Optional. New incoming inline query

source

pub fn get_chosen_inline_result<'a>( &'a self ) -> Option<Cow<'a, ChosenInlineResult>>

Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

source

pub fn get_chosen_inline_result_ref<'a>( &'a self ) -> Option<&'a ChosenInlineResult>

Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

source

pub fn get_callback_query<'a>(&'a self) -> Option<Cow<'a, CallbackQuery>>

Optional. New incoming callback query

source

pub fn get_callback_query_ref<'a>(&'a self) -> Option<&'a CallbackQuery>

Optional. New incoming callback query

source

pub fn get_shipping_query<'a>(&'a self) -> Option<Cow<'a, ShippingQuery>>

Optional. New incoming shipping query. Only for invoices with flexible price

source

pub fn get_shipping_query_ref<'a>(&'a self) -> Option<&'a ShippingQuery>

Optional. New incoming shipping query. Only for invoices with flexible price

source

pub fn get_pre_checkout_query<'a>(&'a self) -> Option<Cow<'a, PreCheckoutQuery>>

Optional. New incoming pre-checkout query. Contains full information about checkout

source

pub fn get_pre_checkout_query_ref<'a>(&'a self) -> Option<&'a PreCheckoutQuery>

Optional. New incoming pre-checkout query. Contains full information about checkout

source

pub fn get_poll<'a>(&'a self) -> Option<Cow<'a, Poll>>

Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot

source

pub fn get_poll_ref<'a>(&'a self) -> Option<&'a Poll>

Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot

source

pub fn get_poll_answer<'a>(&'a self) -> Option<Cow<'a, PollAnswer>>

Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

source

pub fn get_poll_answer_ref<'a>(&'a self) -> Option<&'a PollAnswer>

Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

source

pub fn get_my_chat_member<'a>(&'a self) -> Option<Cow<'a, ChatMemberUpdated>>

Optional. The bot’s chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.

source

pub fn get_my_chat_member_ref<'a>(&'a self) -> Option<&'a ChatMemberUpdated>

Optional. The bot’s chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.

source

pub fn get_chat_member<'a>(&'a self) -> Option<Cow<'a, ChatMemberUpdated>>

Optional. A chat member’s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.

source

pub fn get_chat_member_ref<'a>(&'a self) -> Option<&'a ChatMemberUpdated>

Optional. A chat member’s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.

source

pub fn get_chat_join_request<'a>(&'a self) -> Option<Cow<'a, ChatJoinRequest>>

Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.

source

pub fn get_chat_join_request_ref<'a>(&'a self) -> Option<&'a ChatJoinRequest>

Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.

Trait Implementations§

source§

impl Clone for Update

source§

fn clone(&self) -> Update

Returns a copy 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 Update

source§

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

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

impl Default for Update

source§

fn default() -> Update

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

impl<'de> Deserialize<'de> for Update

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

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

impl From<NoSkipUpdate> for Update

source§

fn from(t: NoSkipUpdate) -> Self

Converts to this type from the input type.
source§

impl From<Update> for UpdateExt

source§

fn from(update: Update) -> Self

Converts to this type from the input type.
source§

impl Into<NoSkipUpdate> for Update

source§

fn into(self) -> NoSkipUpdate

Converts this type into the (usually inferred) input type.
source§

impl Serialize for Update

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

const: unstable · 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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