Skip to main content

Gift

Struct Gift 

Source
pub struct Gift {
Show 17 fields pub id: i64, pub publisher_chat_id: i64, pub sticker: Sticker, pub star_count: i64, pub default_sell_star_count: i64, pub upgrade_star_count: i64, pub upgrade_variant_count: i32, pub has_colors: bool, pub is_for_birthday: bool, pub is_premium: bool, pub auction_info: Option<GiftAuction>, pub next_send_date: i32, pub user_limits: Option<GiftPurchaseLimits>, pub overall_limits: Option<GiftPurchaseLimits>, pub background: GiftBackground, pub first_send_date: i32, pub last_send_date: i32,
}
Expand description

Describes a gift that can be sent to another user or channel chat

Fields§

§id: i64

Unique identifier of the gift

§publisher_chat_id: i64

Identifier of the chat that published the gift; 0 if none

§sticker: Sticker

The sticker representing the gift

§star_count: i64

Number of Telegram Stars that must be paid for the gift

§default_sell_star_count: i64

Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed

§upgrade_star_count: i64

Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn’t possible

§upgrade_variant_count: i32

Number of unique gift variants that are available for the upgraded gift; 0 if unknown

§has_colors: bool

True, if the gift can be used to customize the user’s name, and backgrounds of profile photo, reply header, and link preview

§is_for_birthday: bool

True, if the gift is a birthday gift

§is_premium: bool

True, if the gift can be bought only by Telegram Premium subscribers

§auction_info: Option<GiftAuction>

Information about the auction on which the gift can be purchased; may be null if the gift can be purchased directly

§next_send_date: i32

Point in time (Unix timestamp) when the gift can be sent next time by the current user; may be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can’t be sent now

§user_limits: Option<GiftPurchaseLimits>

Number of times the gift can be purchased by the current user; may be null if not limited

§overall_limits: Option<GiftPurchaseLimits>

Number of times the gift can be purchased all users; may be null if not limited

§background: GiftBackground

Background of the gift

§first_send_date: i32

Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only

§last_send_date: i32

Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only

Trait Implementations§

Source§

impl Clone for Gift

Source§

fn clone(&self) -> Gift

Returns a duplicate 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 Gift

Source§

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

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

impl<'de> Deserialize<'de> for Gift

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 Gift

Source§

fn eq(&self, other: &Gift) -> 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 Serialize for Gift

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
Source§

impl StructuralPartialEq for Gift

Auto Trait Implementations§

§

impl Freeze for Gift

§

impl RefUnwindSafe for Gift

§

impl Send for Gift

§

impl Sync for Gift

§

impl Unpin for Gift

§

impl UnsafeUnpin for Gift

§

impl UnwindSafe for Gift

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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 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>,