#[non_exhaustive]pub struct Update {Show 14 fields
pub update_id: i64,
pub message: Option<Box<Message>>,
pub edited_message: Option<Box<Message>>,
pub channel_post: Option<Box<Message>>,
pub edited_channel_post: Option<Box<Message>>,
pub callback_query: Option<CallbackQuery>,
pub inline_query: Option<InlineQuery>,
pub chosen_inline_result: Option<ChosenInlineResult>,
pub poll: Option<Box<Poll>>,
pub poll_answer: Option<PollAnswer>,
pub my_chat_member: Option<ChatMemberUpdated>,
pub chat_member: Option<ChatMemberUpdated>,
pub chat_join_request: Option<ChatJoinRequest>,
pub extra: BTreeMap<String, Value>,
}Expand description
Telegram update object.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.update_id: i64§message: Option<Box<Message>>§edited_message: Option<Box<Message>>§channel_post: Option<Box<Message>>§edited_channel_post: Option<Box<Message>>§callback_query: Option<CallbackQuery>§inline_query: Option<InlineQuery>§chosen_inline_result: Option<ChosenInlineResult>§poll: Option<Box<Poll>>§poll_answer: Option<PollAnswer>§my_chat_member: Option<ChatMemberUpdated>§chat_member: Option<ChatMemberUpdated>§chat_join_request: Option<ChatJoinRequest>§extra: BTreeMap<String, Value>Implementations§
Source§impl Update
impl Update
Sourcepub fn kind(&self) -> UpdateKind
pub fn kind(&self) -> UpdateKind
Returns the primary update kind using stable precedence.
Sourcepub fn kinds(&self) -> Vec<UpdateKind>
pub fn kinds(&self) -> Vec<UpdateKind>
Returns all detected update kinds.
Sourcepub fn has_kind(&self, kind: UpdateKind) -> bool
pub fn has_kind(&self, kind: UpdateKind) -> bool
Returns whether this update contains the given kind.
Sourcepub fn web_app_data(&self) -> Option<&WebAppData>
pub fn web_app_data(&self) -> Option<&WebAppData>
Returns Mini App payload from the first available message-like field.
pub fn chat_join_request(&self) -> Option<&ChatJoinRequest>
pub fn my_chat_member(&self) -> Option<&ChatMemberUpdated>
pub fn chat_member(&self) -> Option<&ChatMemberUpdated>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Update
impl<'de> Deserialize<'de> for Update
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 UpdateExt for Update
impl UpdateExt for Update
fn message(&self) -> Option<&Message>
fn chat(&self) -> Option<&Chat>
fn message_kind(&self) -> Option<MessageKind>
fn update_kind(&self) -> UpdateKind
fn text(&self) -> Option<&str>
fn web_app_data(&self) -> Option<&WebAppData>
fn write_access_allowed(&self) -> Option<&WriteAccessAllowed>
fn chat_join_request(&self) -> Option<&ChatJoinRequest>
fn chat_member_update(&self) -> Option<&ChatMemberUpdated>
fn my_chat_member_update(&self) -> Option<&ChatMemberUpdated>
fn callback_data(&self) -> Option<&str>
fn callback_json<T>(&self) -> Option<T>where
T: DeserializeOwned,
fn typed_callback<T>(&self) -> Option<T>where
T: CallbackPayload,
fn typed_callback_with_codec<T, C>(&self) -> Option<T>where
C: CallbackCodec<T>,
fn compact_callback<T>(&self) -> Option<T>where
T: CompactCallbackPayload,
fn command(&self) -> Option<&str>
fn command_args(&self) -> Option<&str>
fn command_data(&self) -> Option<CommandData>
fn typed_command<C>(&self) -> Option<C>where
C: BotCommands,
fn actor(&self) -> Option<&User>
fn subject(&self) -> Option<&User>
fn user(&self) -> Option<&User>
fn chat_id(&self) -> Option<i64>
fn actor_id(&self) -> Option<i64>
fn subject_id(&self) -> Option<i64>
fn user_id(&self) -> Option<i64>
Auto Trait Implementations§
impl Freeze for Update
impl RefUnwindSafe for Update
impl Send for Update
impl Sync for Update
impl Unpin for Update
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more