pub enum ProductPurchaseErrorCode {
InvalidQuantity,
ProductUnavailable,
PurchaseNotAllowed,
IneligibleForOffer,
InvalidOfferIdentifier,
InvalidOfferPrice,
InvalidOfferSignature,
MissingOfferParameters,
Other(String),
}Variants§
InvalidQuantity
PurchaseNotAllowed
IneligibleForOffer
InvalidOfferIdentifier
InvalidOfferPrice
InvalidOfferSignature
MissingOfferParameters
Other(String)
Implementations§
Source§impl ProductPurchaseErrorCode
impl ProductPurchaseErrorCode
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Examples found in repository?
examples/19_typed_errors.rs (line 10)
6fn main() {
7 println!("StoreKit API code: {}", StoreKitApiErrorCode::Unsupported.as_str());
8 println!(
9 "Purchase error code: {}",
10 ProductPurchaseErrorCode::InvalidQuantity.as_str()
11 );
12 println!(
13 "Refund error code: {}",
14 RefundRequestErrorCode::Failed.as_str()
15 );
16 println!(
17 "Typed error sample: {:?}",
18 TypedStoreKitError::InvalidRequest(InvalidRequestError {
19 code: 17,
20 message: "invalid request".to_owned(),
21 })
22 );
23}Trait Implementations§
Source§impl Clone for ProductPurchaseErrorCode
impl Clone for ProductPurchaseErrorCode
Source§fn clone(&self) -> ProductPurchaseErrorCode
fn clone(&self) -> ProductPurchaseErrorCode
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 ProductPurchaseErrorCode
impl Debug for ProductPurchaseErrorCode
Source§impl PartialEq for ProductPurchaseErrorCode
impl PartialEq for ProductPurchaseErrorCode
Source§fn eq(&self, other: &ProductPurchaseErrorCode) -> bool
fn eq(&self, other: &ProductPurchaseErrorCode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ProductPurchaseErrorCode
impl StructuralPartialEq for ProductPurchaseErrorCode
Auto Trait Implementations§
impl Freeze for ProductPurchaseErrorCode
impl RefUnwindSafe for ProductPurchaseErrorCode
impl Send for ProductPurchaseErrorCode
impl Sync for ProductPurchaseErrorCode
impl Unpin for ProductPurchaseErrorCode
impl UnsafeUnpin for ProductPurchaseErrorCode
impl UnwindSafe for ProductPurchaseErrorCode
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