pub enum StorePhase {
Unavailable,
Blocked,
Connecting,
Ready,
}Expand description
Re-export framework services (HTTP, URI, etc.) from the dedicated services crate. 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 moreimpl Copy for StorePhase
Source§impl Debug for StorePhase
impl Debug for StorePhase
Source§impl Default for StorePhase
impl Default for StorePhase
Source§fn default() -> StorePhase
fn default() -> StorePhase
impl Eq for StorePhase
Source§impl PartialEq for StorePhase
impl PartialEq for StorePhase
impl StructuralPartialEq for StorePhase
Auto Trait Implementations§
impl Freeze for StorePhase
impl RefUnwindSafe for StorePhase
impl Send for StorePhase
impl Sync for StorePhase
impl Unpin for StorePhase
impl UnsafeUnpin for StorePhase
impl UnwindSafe for StorePhase
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.