tma_init_data

Struct InitData

Source
pub struct InitData {
    pub auth_date: u64,
    pub can_send_after: Option<u64>,
    pub chat: Option<Chat>,
    pub chat_type: Option<String>,
    pub chat_instance: Option<String>,
    pub hash: String,
    pub query_id: String,
    pub receiver: Option<User>,
    pub start_param: Option<String>,
    pub user: Option<User>,
}
Expand description

Contains launch parameters data https://docs.telegram-mini-apps.com/platform/init-data#parameters-list

Fields§

§auth_date: u64

The date the initialization data was created. Is a number representing a Unix timestamp.

§can_send_after: Option<u64>

The number of seconds after which a message can be sent via the method answerWebAppQuery.

§chat: Option<Chat>

An object containing data about the chat where the bot was launched via the attachment menu. Returned for supergroups, channels and group chats - only for Mini Apps launched via the attachment menu.

§chat_type: Option<String>

The type of chat from which the Mini Apps was opened. Returned only for applications opened by direct link.

§chat_instance: Option<String>

A global identifier indicating the chat from which the Mini Apps was opened. Returned only for applications opened by direct link.

§hash: String

Initialization data signature.

§query_id: String

The unique session ID of the Mini App. Used in the process of sending a message via the method answerWebAppQuery.

§receiver: Option<User>

An object containing data about the chat partner of the current user in the chat where the bot was launched via the attachment menu. Returned only for private chats and only for Mini Apps launched via the attachment menu.

§start_param: Option<String>

The value of the startattach or startapp query parameter specified in the link. It is returned only for Mini Apps opened through the attachment menu.

§user: Option<User>

An object containing information about the current user.

Trait Implementations§

Source§

impl Debug for InitData

Source§

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

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

impl<'de> Deserialize<'de> for InitData

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 PartialEq for InitData

Source§

fn eq(&self, other: &InitData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for InitData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T