pub struct OwnedGiftRegular {Show 15 fields
pub tg_type: String,
pub gift: BoxWrapper<Unbox<Gift>>,
pub owned_gift_id: Option<String>,
pub sender_user: Option<BoxWrapper<Unbox<User>>>,
pub send_date: i64,
pub text: Option<String>,
pub entities: Option<Vec<MessageEntity>>,
pub is_private: Option<bool>,
pub is_saved: Option<bool>,
pub can_be_upgraded: Option<bool>,
pub was_refunded: Option<bool>,
pub convert_star_count: Option<i64>,
pub prepaid_upgrade_star_count: Option<i64>,
pub is_upgrade_separate: Option<bool>,
pub unique_gift_number: Option<i64>,
}Expand description
Describes a regular gift owned by a user or a chat.
Fields§
§tg_type: StringType of the gift, always “regular”
gift: BoxWrapper<Unbox<Gift>>Information about the regular gift
owned_gift_id: Option<String>Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
sender_user: Option<BoxWrapper<Unbox<User>>>Optional. Sender of the gift if it is a known user
send_date: i64Date the gift was sent in Unix time
text: Option<String>Optional. Text of the message that was added to the gift
entities: Option<Vec<MessageEntity>>Optional. Special entities that appear in the text
is_private: Option<bool>Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
is_saved: Option<bool>Optional. True, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only
can_be_upgraded: Option<bool>Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only
was_refunded: Option<bool>Optional. True, if the gift was refunded and isn’t available anymore
convert_star_count: Option<i64>Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only
prepaid_upgrade_star_count: Option<i64>Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift
is_upgrade_separate: Option<bool>Optional. True, if the gift’s upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
unique_gift_number: Option<i64>Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
Implementations§
Source§impl OwnedGiftRegular
impl OwnedGiftRegular
pub fn noskip(self) -> NoSkipOwnedGiftRegular
Source§impl OwnedGiftRegular
impl OwnedGiftRegular
pub fn new<A: Into<Gift>>(gift: A, send_date: i64) -> Self
Sourcepub fn get_tg_type<'a>(&'a self) -> &'a str
pub fn get_tg_type<'a>(&'a self) -> &'a str
Type of the gift, always “regular”
Sourcepub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self
pub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self
Type of the gift, always “regular”
Sourcepub fn set_gift<'a>(&'a mut self, gift: Gift) -> &'a mut Self
pub fn set_gift<'a>(&'a mut self, gift: Gift) -> &'a mut Self
Information about the regular gift
Sourcepub fn get_owned_gift_id<'a>(&'a self) -> Option<&'a str>
pub fn get_owned_gift_id<'a>(&'a self) -> Option<&'a str>
Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
Sourcepub fn set_owned_gift_id<'a>(
&'a mut self,
owned_gift_id: Option<String>,
) -> &'a mut Self
pub fn set_owned_gift_id<'a>( &'a mut self, owned_gift_id: Option<String>, ) -> &'a mut Self
Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
Sourcepub fn get_sender_user<'a>(&'a self) -> Option<&'a User>
pub fn get_sender_user<'a>(&'a self) -> Option<&'a User>
Optional. Sender of the gift if it is a known user
Sourcepub fn set_sender_user<'a>(
&'a mut self,
sender_user: Option<User>,
) -> &'a mut Self
pub fn set_sender_user<'a>( &'a mut self, sender_user: Option<User>, ) -> &'a mut Self
Optional. Sender of the gift if it is a known user
Sourcepub fn get_send_date<'a>(&'a self) -> i64
pub fn get_send_date<'a>(&'a self) -> i64
Date the gift was sent in Unix time
Sourcepub fn set_send_date<'a>(&'a mut self, send_date: i64) -> &'a mut Self
pub fn set_send_date<'a>(&'a mut self, send_date: i64) -> &'a mut Self
Date the gift was sent in Unix time
Sourcepub fn get_text<'a>(&'a self) -> Option<&'a str>
pub fn get_text<'a>(&'a self) -> Option<&'a str>
Optional. Text of the message that was added to the gift
Sourcepub fn set_text<'a>(&'a mut self, text: Option<String>) -> &'a mut Self
pub fn set_text<'a>(&'a mut self, text: Option<String>) -> &'a mut Self
Optional. Text of the message that was added to the gift
Sourcepub fn get_entities<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>
pub fn get_entities<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>
Optional. Special entities that appear in the text
Sourcepub fn set_entities<'a>(
&'a mut self,
entities: Option<Vec<MessageEntity>>,
) -> &'a mut Self
pub fn set_entities<'a>( &'a mut self, entities: Option<Vec<MessageEntity>>, ) -> &'a mut Self
Optional. Special entities that appear in the text
Sourcepub fn get_is_private<'a>(&'a self) -> Option<bool>
pub fn get_is_private<'a>(&'a self) -> Option<bool>
Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
Sourcepub fn set_is_private<'a>(
&'a mut self,
is_private: Option<bool>,
) -> &'a mut Self
pub fn set_is_private<'a>( &'a mut self, is_private: Option<bool>, ) -> &'a mut Self
Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
Sourcepub fn get_is_saved<'a>(&'a self) -> Option<bool>
pub fn get_is_saved<'a>(&'a self) -> Option<bool>
Optional. True, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only
Sourcepub fn set_is_saved<'a>(&'a mut self, is_saved: Option<bool>) -> &'a mut Self
pub fn set_is_saved<'a>(&'a mut self, is_saved: Option<bool>) -> &'a mut Self
Optional. True, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only
Sourcepub fn get_can_be_upgraded<'a>(&'a self) -> Option<bool>
pub fn get_can_be_upgraded<'a>(&'a self) -> Option<bool>
Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only
Sourcepub fn set_can_be_upgraded<'a>(
&'a mut self,
can_be_upgraded: Option<bool>,
) -> &'a mut Self
pub fn set_can_be_upgraded<'a>( &'a mut self, can_be_upgraded: Option<bool>, ) -> &'a mut Self
Optional. True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only
Sourcepub fn get_was_refunded<'a>(&'a self) -> Option<bool>
pub fn get_was_refunded<'a>(&'a self) -> Option<bool>
Optional. True, if the gift was refunded and isn’t available anymore
Sourcepub fn set_was_refunded<'a>(
&'a mut self,
was_refunded: Option<bool>,
) -> &'a mut Self
pub fn set_was_refunded<'a>( &'a mut self, was_refunded: Option<bool>, ) -> &'a mut Self
Optional. True, if the gift was refunded and isn’t available anymore
Sourcepub fn get_convert_star_count<'a>(&'a self) -> Option<i64>
pub fn get_convert_star_count<'a>(&'a self) -> Option<i64>
Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only
Sourcepub fn set_convert_star_count<'a>(
&'a mut self,
convert_star_count: Option<i64>,
) -> &'a mut Self
pub fn set_convert_star_count<'a>( &'a mut self, convert_star_count: Option<i64>, ) -> &'a mut Self
Optional. Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only
Sourcepub fn get_prepaid_upgrade_star_count<'a>(&'a self) -> Option<i64>
pub fn get_prepaid_upgrade_star_count<'a>(&'a self) -> Option<i64>
Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift
Sourcepub fn set_prepaid_upgrade_star_count<'a>(
&'a mut self,
prepaid_upgrade_star_count: Option<i64>,
) -> &'a mut Self
pub fn set_prepaid_upgrade_star_count<'a>( &'a mut self, prepaid_upgrade_star_count: Option<i64>, ) -> &'a mut Self
Optional. Number of Telegram Stars that were paid for the ability to upgrade the gift
Sourcepub fn get_is_upgrade_separate<'a>(&'a self) -> Option<bool>
pub fn get_is_upgrade_separate<'a>(&'a self) -> Option<bool>
Optional. True, if the gift’s upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
Sourcepub fn set_is_upgrade_separate<'a>(
&'a mut self,
is_upgrade_separate: Option<bool>,
) -> &'a mut Self
pub fn set_is_upgrade_separate<'a>( &'a mut self, is_upgrade_separate: Option<bool>, ) -> &'a mut Self
Optional. True, if the gift’s upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
Sourcepub fn get_unique_gift_number<'a>(&'a self) -> Option<i64>
pub fn get_unique_gift_number<'a>(&'a self) -> Option<i64>
Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
Sourcepub fn set_unique_gift_number<'a>(
&'a mut self,
unique_gift_number: Option<i64>,
) -> &'a mut Self
pub fn set_unique_gift_number<'a>( &'a mut self, unique_gift_number: Option<i64>, ) -> &'a mut Self
Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift
Trait Implementations§
Source§impl Clone for OwnedGiftRegular
impl Clone for OwnedGiftRegular
Source§fn clone(&self) -> OwnedGiftRegular
fn clone(&self) -> OwnedGiftRegular
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OwnedGiftRegular
impl Debug for OwnedGiftRegular
Source§impl Default for OwnedGiftRegular
impl Default for OwnedGiftRegular
Source§fn default() -> OwnedGiftRegular
fn default() -> OwnedGiftRegular
Source§impl<'de> Deserialize<'de> for OwnedGiftRegular
impl<'de> Deserialize<'de> for OwnedGiftRegular
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>,
Source§impl From<BoxWrapper<Box<OwnedGiftRegular>>> for OwnedGiftRegular
impl From<BoxWrapper<Box<OwnedGiftRegular>>> for OwnedGiftRegular
Source§fn from(t: BoxWrapper<Box<OwnedGiftRegular>>) -> Self
fn from(t: BoxWrapper<Box<OwnedGiftRegular>>) -> Self
Source§impl From<BoxWrapper<Unbox<OwnedGiftRegular>>> for OwnedGiftRegular
impl From<BoxWrapper<Unbox<OwnedGiftRegular>>> for OwnedGiftRegular
Source§fn from(t: BoxWrapper<Unbox<OwnedGiftRegular>>) -> Self
fn from(t: BoxWrapper<Unbox<OwnedGiftRegular>>) -> Self
Source§impl From<NoSkipOwnedGiftRegular> for OwnedGiftRegular
impl From<NoSkipOwnedGiftRegular> for OwnedGiftRegular
Source§fn from(t: NoSkipOwnedGiftRegular) -> Self
fn from(t: NoSkipOwnedGiftRegular) -> Self
Source§impl Hash for OwnedGiftRegular
impl Hash for OwnedGiftRegular
Source§impl Into<NoSkipOwnedGiftRegular> for OwnedGiftRegular
impl Into<NoSkipOwnedGiftRegular> for OwnedGiftRegular
Source§fn into(self) -> NoSkipOwnedGiftRegular
fn into(self) -> NoSkipOwnedGiftRegular
Source§impl Ord for OwnedGiftRegular
impl Ord for OwnedGiftRegular
Source§fn cmp(&self, other: &OwnedGiftRegular) -> Ordering
fn cmp(&self, other: &OwnedGiftRegular) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for OwnedGiftRegular
impl PartialEq for OwnedGiftRegular
Source§impl PartialOrd for OwnedGiftRegular
impl PartialOrd for OwnedGiftRegular
Source§impl Serialize for OwnedGiftRegular
impl Serialize for OwnedGiftRegular
impl Eq for OwnedGiftRegular
impl StructuralPartialEq for OwnedGiftRegular
Auto Trait Implementations§
impl Freeze for OwnedGiftRegular
impl RefUnwindSafe for OwnedGiftRegular
impl Send for OwnedGiftRegular
impl Sync for OwnedGiftRegular
impl Unpin for OwnedGiftRegular
impl UnsafeUnpin for OwnedGiftRegular
impl UnwindSafe for OwnedGiftRegular
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.