pub struct StarTransaction { /* private fields */ }Expand description
Describes a Telegram Star transaction.
Implementations§
Source§impl StarTransaction
impl StarTransaction
Sourcepub fn new<T>(amount: Integer, date: Integer, id: T) -> Self
pub fn new<T>(amount: Integer, date: Integer, id: T) -> Self
Creates a new StarTransaction.
§Arguments
amount- Number of Telegram Stars transferred by the transaction.date- Date the transaction was created in Unix time.id- Unique identifier of the transaction; coincides with the identifer of the original transaction for refund transactions; coincides withtelegram_payment_charge_idofcrate::types::SuccessfulPaymentfor successful incoming payments from users.
Sourcepub fn with_nanostar_amount(self, value: Integer) -> Self
pub fn with_nanostar_amount(self, value: Integer) -> Self
Sets a new nanostar amount.
§Arguments
value- The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999.
Sourcepub fn with_source(self, value: TransactionPartner) -> Self
pub fn with_source(self, value: TransactionPartner) -> Self
Sets a new source.
§Arguments
value- Source of an incoming transaction. E.g., a user purchasing goods or services, Fragment refunding a failed withdrawal. Only for incoming transactions.
Sourcepub fn with_receiver(self, value: TransactionPartner) -> Self
pub fn with_receiver(self, value: TransactionPartner) -> Self
Sets a new receiver.
§Arguments
value- 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StarTransaction
impl Debug for 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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StarTransaction
impl PartialEq for StarTransaction
Source§impl Serialize for StarTransaction
impl Serialize 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
Mutably borrows from an owned value. Read more