Skip to main content

OwnedGiftRegular

Struct OwnedGiftRegular 

Source
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: String

Type 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: i64

Date 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

Source§

impl OwnedGiftRegular

Source

pub fn new<A: Into<Gift>>(gift: A, send_date: i64) -> Self

Source

pub fn get_tg_type<'a>(&'a self) -> &'a str

Type of the gift, always “regular”

Source

pub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self

Type of the gift, always “regular”

Source

pub fn get_gift<'a>(&'a self) -> &'a Gift

Information about the regular gift

Source

pub fn set_gift<'a>(&'a mut self, gift: Gift) -> &'a mut Self

Information about the regular gift

Source

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

Source

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

Source

pub fn get_sender_user<'a>(&'a self) -> Option<&'a User>

Optional. Sender of the gift if it is a known user

Source

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

Source

pub fn get_send_date<'a>(&'a self) -> i64

Date the gift was sent in Unix time

Source

pub fn set_send_date<'a>(&'a mut self, send_date: i64) -> &'a mut Self

Date the gift was sent in Unix time

Source

pub fn get_text<'a>(&'a self) -> Option<&'a str>

Optional. Text of the message that was added to the gift

Source

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

Source

pub fn get_entities<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>

Optional. Special entities that appear in the text

Source

pub fn set_entities<'a>( &'a mut self, entities: Option<Vec<MessageEntity>>, ) -> &'a mut Self

Optional. Special entities that appear in the text

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_was_refunded<'a>(&'a self) -> Option<bool>

Optional. True, if the gift was refunded and isn’t available anymore

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source§

fn clone(&self) -> OwnedGiftRegular

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 OwnedGiftRegular

Source§

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

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

impl Default for OwnedGiftRegular

Source§

fn default() -> OwnedGiftRegular

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OwnedGiftRegular

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 From<BoxWrapper<Box<OwnedGiftRegular>>> for OwnedGiftRegular

Source§

fn from(t: BoxWrapper<Box<OwnedGiftRegular>>) -> Self

Converts to this type from the input type.
Source§

impl From<BoxWrapper<Unbox<OwnedGiftRegular>>> for OwnedGiftRegular

Source§

fn from(t: BoxWrapper<Unbox<OwnedGiftRegular>>) -> Self

Converts to this type from the input type.
Source§

impl From<NoSkipOwnedGiftRegular> for OwnedGiftRegular

Source§

fn from(t: NoSkipOwnedGiftRegular) -> Self

Converts to this type from the input type.
Source§

impl Hash for OwnedGiftRegular

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Into<NoSkipOwnedGiftRegular> for OwnedGiftRegular

Source§

fn into(self) -> NoSkipOwnedGiftRegular

Converts this type into the (usually inferred) input type.
Source§

impl Ord for OwnedGiftRegular

Source§

fn cmp(&self, other: &OwnedGiftRegular) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for OwnedGiftRegular

Source§

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

Source§

fn partial_cmp(&self, other: &OwnedGiftRegular) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for OwnedGiftRegular

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 Eq for OwnedGiftRegular

Source§

impl StructuralPartialEq for OwnedGiftRegular

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> 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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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