pub struct Transaction { /* private fields */ }Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn current_entitlements() -> Result<TransactionStream, StoreKitError>
pub fn current_entitlements() -> Result<TransactionStream, StoreKitError>
Examples found in repository?
examples/02_transaction_stream.rs (line 6)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 match Transaction::current_entitlements() {
7 Ok(mut stream) => match stream.next_timeout(Duration::from_millis(250))? {
8 Some(result) => println!(
9 "current entitlement: {}",
10 result.payload().data().product_id
11 ),
12 None => println!("no entitlement available within timeout"),
13 },
14 Err(error) => println!("transaction stream unavailable: {error}"),
15 }
16 Ok(())
17}pub fn all() -> Result<TransactionStream, StoreKitError>
pub fn updates() -> Result<TransactionStream, StoreKitError>
pub fn unfinished() -> Result<TransactionStream, StoreKitError>
pub fn all_for(product_id: &str) -> Result<TransactionStream, StoreKitError>
pub fn current_entitlements_for( product_id: &str, ) -> Result<TransactionStream, StoreKitError>
pub fn latest_for( product_id: &str, ) -> Result<Option<VerificationResult<Self>>, StoreKitError>
pub fn current_entitlement_for( product_id: &str, ) -> Result<Option<VerificationResult<Self>>, StoreKitError>
Sourcepub const fn data(&self) -> &TransactionData
pub const fn data(&self) -> &TransactionData
Examples found in repository?
examples/02_transaction_stream.rs (line 10)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 match Transaction::current_entitlements() {
7 Ok(mut stream) => match stream.next_timeout(Duration::from_millis(250))? {
8 Some(result) => println!(
9 "current entitlement: {}",
10 result.payload().data().product_id
11 ),
12 None => println!("no entitlement available within timeout"),
13 },
14 Err(error) => println!("transaction stream unavailable: {error}"),
15 }
16 Ok(())
17}pub const fn advanced_commerce_info( &self, ) -> Option<&TransactionAdvancedCommerceInfo>
pub const fn has_live_handle(&self) -> bool
pub fn verify(&self) -> Result<(), StoreKitError>
pub fn finish(&self) -> Result<(), StoreKitError>
pub fn begin_refund_request(&self) -> Result<RefundRequestStatus, StoreKitError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl !Send for Transaction
impl !Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
impl UnwindSafe for Transaction
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