pub enum StorePhase {
Unavailable,
Blocked,
Connecting,
Ready,
}Expand description
How far along the store connection is.
Variants§
No store on this platform, or no backend installed, or one that has not reached the store yet. Nothing is owned and nothing can be bought right now — a backend that is retrying reports this, so an app may reasonably say “not reached” and offer to try again.
Blocked
The store answered, and it will not sell to this app here: in-app billing turned off on the device, an account that cannot pay, a country the app is not distributed in.
The difference from Unavailable is whether
waiting helps. It does not here — no backend retries a store that has
said no — so an app should stop offering the purchase and say why,
rather than inviting a retry that can only fail the same way.
Already-known ownership remains authoritative even though the store
cannot be queried for new purchases.
Connecting
A backend is installed and still talking to the store. Prices are not known yet; owned entitlements may not be known yet either.
Ready
Product and entitlement information has been received at least once.
Implementations§
Source§impl StorePhase
impl StorePhase
Sourcepub fn cannot_sell(self) -> bool
pub fn cannot_sell(self) -> bool
Whether nothing can be bought in this phase.
Saves every paywall from spelling out the same two-variant match, and keeps an app that only cares “can I sell?” from having to be updated when a phase is added.
Sourcepub fn may_yet_change(self) -> bool
pub fn may_yet_change(self) -> bool
Whether the store might still answer differently later.
True while a backend is connecting or has yet to reach the store, false once the store has said no or has already answered.
Trait Implementations§
Source§impl Clone for StorePhase
impl Clone for StorePhase
Source§fn clone(&self) -> StorePhase
fn clone(&self) -> StorePhase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more