pub struct AsyncPurchase;Available on crate feature
async only.Expand description
Async wrapper for Product.purchase(options:).
Initiates an in-app purchase and resolves to the PurchaseResult.
The purchase sheet is shown on the main actor (equivalent to Swift’s
@MainActor).
§Notes
- The future must be awaited until completion; cancellation is not
supported by the
StoreKit2 purchase API. Transaction.currentEntitlementsandTransaction.updates(multi-fire streams) are deferred to Tier 2.
Implementations§
Source§impl AsyncPurchase
impl AsyncPurchase
Sourcepub fn buy(
product_id: &str,
options: &[PurchaseOption],
) -> Result<PurchaseFuture, StoreKitError>
pub fn buy( product_id: &str, options: &[PurchaseOption], ) -> Result<PurchaseFuture, StoreKitError>
Asynchronously purchase a product.
Equivalent to product.purchase(options:) in Swift.
§Errors
Returns an error if the product cannot be found, the purchase fails, or the options cannot be encoded.
Trait Implementations§
Source§impl Clone for AsyncPurchase
impl Clone for AsyncPurchase
Source§fn clone(&self) -> AsyncPurchase
fn clone(&self) -> AsyncPurchase
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AsyncPurchase
impl Debug for AsyncPurchase
impl Copy for AsyncPurchase
Auto Trait Implementations§
impl Freeze for AsyncPurchase
impl RefUnwindSafe for AsyncPurchase
impl Send for AsyncPurchase
impl Sync for AsyncPurchase
impl Unpin for AsyncPurchase
impl UnsafeUnpin for AsyncPurchase
impl UnwindSafe for AsyncPurchase
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