pub struct ShopifyRuntime { /* private fields */ }Expand description
Implementations§
Source§impl ShopifyRuntime
impl ShopifyRuntime
Sourcepub const fn config(&self) -> &ShopifyConfig
pub const fn config(&self) -> &ShopifyConfig
The resolved, validated config.
Sourcepub const fn registry(&self) -> &WebhookRegistry
pub const fn registry(&self) -> &WebhookRegistry
The webhook handlers.
Sourcepub fn token_store(&self) -> &Arc<dyn TokenStore> ⓘ
pub fn token_store(&self) -> &Arc<dyn TokenStore> ⓘ
The token store, to read tokens.
Do not write or delete tokens through it: the plugin serializes writes per shop, and a direct write can race a refresh.
Sourcepub const fn delivery_store(&self) -> &Arc<dyn DeliveryStore> ⓘ
pub const fn delivery_store(&self) -> &Arc<dyn DeliveryStore> ⓘ
The duplicate-delivery store.
Sourcepub fn client(&self) -> Result<ShopifyClient>
pub fn client(&self) -> Result<ShopifyClient>
The client for the single-store shop.
§Errors
Returns Error::Config when shop or SHOPIFY_ACCESS_TOKEN is
not set.
Sourcepub async fn client_for(
&self,
shop: &ShopDomain,
now: i64,
) -> Result<ShopifyClient>
pub async fn client_for( &self, shop: &ShopDomain, now: i64, ) -> Result<ShopifyClient>
The client for shop, at Unix time now.
The single-store shop uses the fixed token. Other shops use the
token store. When the token expires within
REFRESH_MARGIN_SECS, it refreshes first. Only one refresh for a
shop runs at a time, in its own task: a cancelled caller does not
lose the new token pair. When a refresh fails and the old token is
still valid, the client uses the old token.
§Errors
Returns Error::NotInstalled when the shop has no token,
Error::Reauthorize when Shopify refuses the refresh token, or a
store or HTTP error.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ShopifyRuntime
impl !UnwindSafe for ShopifyRuntime
impl Forget for ShopifyRuntime
impl Freeze for ShopifyRuntime
impl Send for ShopifyRuntime
impl Sync for ShopifyRuntime
impl Unpin for ShopifyRuntime
impl UnsafeUnpin for ShopifyRuntime
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.