mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Derive PartialEq
, Eq
and Hash
on telegram types
This commit is contained in:
parent
65f153734d
commit
e1be16fba2
17 changed files with 17 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct AnswerPreCheckoutQuery {
|
||||
pub pre_checkout_query_id: String,
|
||||
pub ok: bool,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::ShippingOption;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct AnswerShippingQuery {
|
||||
pub shipping_query_id: String,
|
||||
pub ok: bool,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::{ChatPermissions, ChatPhoto, Message};
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Chat {
|
||||
pub id: i64,
|
||||
pub chat_type: String,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ChatPermissions {
|
||||
pub can_send_messages: Option<bool>,
|
||||
pub can_send_media_messages: Option<bool>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ChatPhoto {
|
||||
pub small_file_id: String,
|
||||
pub big_file_id: String,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Document {
|
||||
pub file_id: String,
|
||||
pub thumb: Option<PhotoSize>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Invoice {
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct LabeledPrice {
|
||||
pub label: String,
|
||||
pub amount: i64,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::{Chat, Document, Invoice, SuccessfulPayment, User};
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct Message {
|
||||
pub message_id: i64,
|
||||
pub from: Option<Box<User>>,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::ShippingAddress;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct OrderInfo {
|
||||
pub name: String,
|
||||
pub phone_number: String,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::{OrderInfo, User};
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct PreCheckoutQuery {
|
||||
pub id: String,
|
||||
pub from: User,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::LabeledPrice;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct SendInvoice {
|
||||
pub chat_id: i64,
|
||||
pub title: String,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ShippingAddress {
|
||||
pub country_code: String,
|
||||
pub state: String,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::LabeledPrice;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ShippingOption {
|
||||
pub id: i64,
|
||||
pub title: String,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::{ShippingAddress, User};
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct ShippingQuery {
|
||||
pub id: String,
|
||||
pub from: User,
|
||||
|
|
|
@ -2,7 +2,7 @@ use serde::Deserialize;
|
|||
|
||||
use crate::core::types::OrderInfo;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct SuccessfulPayment {
|
||||
pub currency: String,
|
||||
pub total_amount: i64,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Hash, PartialEq, Eq)]
|
||||
pub struct User {
|
||||
pub id: i64,
|
||||
pub is_bot: bool,
|
||||
|
|
Loading…
Reference in a new issue