Struct botapi::gen_types::StarTransaction
source · pub struct StarTransaction {
pub id: String,
pub amount: i64,
pub date: i64,
pub source: Option<BoxWrapper<Unbox<TransactionPartner>>>,
pub receiver: Option<BoxWrapper<Unbox<TransactionPartner>>>,
}
Expand description
Describes a Telegram Star transaction.
Fields§
§id: String
Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
amount: i64
Number of Telegram Stars transferred by the transaction
date: i64
Date the transaction was created in Unix time
source: Option<BoxWrapper<Unbox<TransactionPartner>>>
Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions
receiver: Option<BoxWrapper<Unbox<TransactionPartner>>>
Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions
Implementations§
source§impl StarTransaction
impl StarTransaction
pub fn noskip(self) -> NoSkipStarTransaction
source§impl StarTransaction
impl StarTransaction
pub fn new(id: String, amount: i64, date: i64) -> Self
sourcepub fn get_id<'a>(&'a self) -> &'a str
pub fn get_id<'a>(&'a self) -> &'a str
Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
sourcepub fn set_id<'a>(&'a mut self, id: String) -> &'a mut Self
pub fn set_id<'a>(&'a mut self, id: String) -> &'a mut Self
Unique identifier of the transaction. Coincides with the identifer of the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
sourcepub fn get_amount<'a>(&'a self) -> i64
pub fn get_amount<'a>(&'a self) -> i64
Number of Telegram Stars transferred by the transaction
sourcepub fn set_amount<'a>(&'a mut self, amount: i64) -> &'a mut Self
pub fn set_amount<'a>(&'a mut self, amount: i64) -> &'a mut Self
Number of Telegram Stars transferred by the transaction
sourcepub fn set_date<'a>(&'a mut self, date: i64) -> &'a mut Self
pub fn set_date<'a>(&'a mut self, date: i64) -> &'a mut Self
Date the transaction was created in Unix time
sourcepub fn get_source<'a>(&'a self) -> Option<&'a TransactionPartner>
pub fn get_source<'a>(&'a self) -> Option<&'a TransactionPartner>
Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions
sourcepub fn set_source<'a>(
&'a mut self,
source: Option<TransactionPartner>,
) -> &'a mut Self
pub fn set_source<'a>( &'a mut self, source: Option<TransactionPartner>, ) -> &'a mut Self
Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions
sourcepub fn get_receiver<'a>(&'a self) -> Option<&'a TransactionPartner>
pub fn get_receiver<'a>(&'a self) -> Option<&'a TransactionPartner>
Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions
sourcepub fn set_receiver<'a>(
&'a mut self,
receiver: Option<TransactionPartner>,
) -> &'a mut Self
pub fn set_receiver<'a>( &'a mut self, receiver: Option<TransactionPartner>, ) -> &'a mut Self
Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions
Trait Implementations§
source§impl Clone for StarTransaction
impl Clone for StarTransaction
source§fn clone(&self) -> StarTransaction
fn clone(&self) -> StarTransaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StarTransaction
impl Debug for StarTransaction
source§impl Default for StarTransaction
impl Default for StarTransaction
source§fn default() -> StarTransaction
fn default() -> StarTransaction
source§impl<'de> Deserialize<'de> for StarTransaction
impl<'de> Deserialize<'de> for StarTransaction
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<StarTransaction>>> for StarTransaction
impl From<BoxWrapper<Box<StarTransaction>>> for StarTransaction
source§fn from(t: BoxWrapper<Box<StarTransaction>>) -> Self
fn from(t: BoxWrapper<Box<StarTransaction>>) -> Self
source§impl From<BoxWrapper<Unbox<StarTransaction>>> for StarTransaction
impl From<BoxWrapper<Unbox<StarTransaction>>> for StarTransaction
source§fn from(t: BoxWrapper<Unbox<StarTransaction>>) -> Self
fn from(t: BoxWrapper<Unbox<StarTransaction>>) -> Self
source§impl From<NoSkipStarTransaction> for StarTransaction
impl From<NoSkipStarTransaction> for StarTransaction
source§fn from(t: NoSkipStarTransaction) -> Self
fn from(t: NoSkipStarTransaction) -> Self
source§impl Hash for StarTransaction
impl Hash for StarTransaction
source§impl Into<NoSkipStarTransaction> for StarTransaction
impl Into<NoSkipStarTransaction> for StarTransaction
source§fn into(self) -> NoSkipStarTransaction
fn into(self) -> NoSkipStarTransaction
source§impl Ord for StarTransaction
impl Ord for StarTransaction
source§fn cmp(&self, other: &StarTransaction) -> Ordering
fn cmp(&self, other: &StarTransaction) -> 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 StarTransaction
impl PartialEq for StarTransaction
source§fn eq(&self, other: &StarTransaction) -> bool
fn eq(&self, other: &StarTransaction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for StarTransaction
impl PartialOrd for StarTransaction
source§fn partial_cmp(&self, other: &StarTransaction) -> Option<Ordering>
fn partial_cmp(&self, other: &StarTransaction) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for StarTransaction
impl Serialize for StarTransaction
impl Eq for StarTransaction
impl StructuralPartialEq for StarTransaction
Auto Trait Implementations§
impl Freeze for StarTransaction
impl RefUnwindSafe for StarTransaction
impl Send for StarTransaction
impl Sync for StarTransaction
impl Unpin for StarTransaction
impl UnwindSafe for StarTransaction
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.