pub struct Update {
pub id: UpdateId,
pub kind: UpdateKind,
}Expand description
This object represents an incoming update.
Fields§
§id: UpdateIdThe 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.
kind: UpdateKindImplementations§
Source§impl Update
impl Update
Sourcepub fn from(&self) -> Option<&User>
pub fn from(&self) -> Option<&User>
Returns the user that performed the action that caused this update, if known.
This is generally the from field (except for PollAnswer where it’s
user and Poll with Error which don’t have such field at all).
Sourcepub fn mentioned_users(&self) -> impl Iterator<Item = &User>
pub fn mentioned_users(&self) -> impl Iterator<Item = &User>
Returns all users that are “contained” in this Update structure.
This might be useful to track information about users.
Note that this function may return quite a few users as it scans replies, pinned messages, message entities, “via bot” fields and more. Also note that this function can return duplicate users.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Update
impl<'de> Deserialize<'de> for Update
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Update, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Update, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Update
impl Serialize for Update
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl<Out> UpdateFilterExt<Out> for Update
impl<Out> UpdateFilterExt<Out> for Update
Source§fn filter_message() -> Handler<'static, Out, DpHandlerDescription>
fn filter_message() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::Message objects.Source§fn filter_edited_message() -> Handler<'static, Out, DpHandlerDescription>
fn filter_edited_message() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::EditedMessage objects.Source§fn filter_channel_post() -> Handler<'static, Out, DpHandlerDescription>
fn filter_channel_post() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::ChannelPost objects.Source§fn filter_edited_channel_post() -> Handler<'static, Out, DpHandlerDescription>
fn filter_edited_channel_post() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::EditedChannelPost objects.Source§fn filter_business_connection() -> Handler<'static, Out, DpHandlerDescription>
fn filter_business_connection() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::BusinessConnection objects.Source§fn filter_business_message() -> Handler<'static, Out, DpHandlerDescription>
fn filter_business_message() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::BusinessMessage objects.Source§fn filter_edited_business_message() -> Handler<'static, Out, DpHandlerDescription>
fn filter_edited_business_message() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::EditedBusinessMessage objects.Source§fn filter_deleted_business_messages() -> Handler<'static, Out, DpHandlerDescription>
fn filter_deleted_business_messages() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::DeletedBusinessMessages objects.Source§fn filter_message_reaction_updated() -> Handler<'static, Out, DpHandlerDescription>
fn filter_message_reaction_updated() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::MessageReaction objects.Source§fn filter_message_reaction_count_updated() -> Handler<'static, Out, DpHandlerDescription>
fn filter_message_reaction_count_updated() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::MessageReactionCount objects.Source§fn filter_inline_query() -> Handler<'static, Out, DpHandlerDescription>
fn filter_inline_query() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::InlineQuery objects.Source§fn filter_chosen_inline_result() -> Handler<'static, Out, DpHandlerDescription>
fn filter_chosen_inline_result() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::ChosenInlineResult objects.Source§fn filter_callback_query() -> Handler<'static, Out, DpHandlerDescription>
fn filter_callback_query() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::CallbackQuery objects.Source§fn filter_shipping_query() -> Handler<'static, Out, DpHandlerDescription>
fn filter_shipping_query() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::ShippingQuery objects.Source§fn filter_pre_checkout_query() -> Handler<'static, Out, DpHandlerDescription>
fn filter_pre_checkout_query() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::PreCheckoutQuery objects.Source§fn filter_purchased_paid_media() -> Handler<'static, Out, DpHandlerDescription>
fn filter_purchased_paid_media() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::PurchasedPaidMedia objects.Source§fn filter_poll() -> Handler<'static, Out, DpHandlerDescription>
fn filter_poll() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::Poll objects.Source§fn filter_poll_answer() -> Handler<'static, Out, DpHandlerDescription>
fn filter_poll_answer() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::PollAnswer objects.Source§fn filter_my_chat_member() -> Handler<'static, Out, DpHandlerDescription>
fn filter_my_chat_member() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::MyChatMember objects.Source§fn filter_chat_member() -> Handler<'static, Out, DpHandlerDescription>
fn filter_chat_member() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::ChatMember objects.Source§fn filter_chat_join_request() -> Handler<'static, Out, DpHandlerDescription>
fn filter_chat_join_request() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::ChatJoinRequest objects.Source§fn filter_chat_boost() -> Handler<'static, Out, DpHandlerDescription>
fn filter_chat_boost() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::ChatBoost objects.Source§fn filter_removed_chat_boost() -> Handler<'static, Out, DpHandlerDescription>
fn filter_removed_chat_boost() -> Handler<'static, Out, DpHandlerDescription>
UpdateKind::RemovedChatBoost objects.impl StructuralPartialEq for Update
Auto Trait Implementations§
impl Freeze for Update
impl RefUnwindSafe for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl UnwindSafe for Update
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<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more