pub struct AzureCdnInvalidator { /* private fields */ }Expand description
Azure CDN purge backend. Construct with Self::new; chain
.with_* configuration before installing on the admin router.
Implementations§
Source§impl AzureCdnInvalidator
impl AzureCdnInvalidator
Sourcepub fn new(
subscription_id: impl Into<String>,
resource_group: impl Into<String>,
profile: impl Into<String>,
endpoint: impl Into<String>,
token: Arc<dyn AccessTokenSource>,
) -> Self
pub fn new( subscription_id: impl Into<String>, resource_group: impl Into<String>, profile: impl Into<String>, endpoint: impl Into<String>, token: Arc<dyn AccessTokenSource>, ) -> Self
Build a fresh invalidator. The HTTP client uses the framework’s default 10-second timeout + exponential-backoff retry policy.
§Panics
If the framework HTTP client cannot be constructed (no TLS backend, etc.) — a startup-time failure where crashing loudly beats silently dropping every purge.
Sourcepub fn with_api_base(self, api_base: impl Into<String>) -> Self
pub fn with_api_base(self, api_base: impl Into<String>) -> Self
Override the API base URL. Used by tests to point at an httpmock server; production keeps the default.
Sourcepub fn with_api_version(self, api_version: impl Into<String>) -> Self
pub fn with_api_version(self, api_version: impl Into<String>) -> Self
Override the ARM API version (default 2023-05-01).
Trait Implementations§
Source§impl PageCacheInvalidator for AzureCdnInvalidator
impl PageCacheInvalidator for AzureCdnInvalidator
Source§fn invalidate_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tenant: &'life1 TenantSlug,
url_path: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invalidate_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tenant: &'life1 TenantSlug,
url_path: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Drop the cache entry for the public render of
url_path on
the given tenant (slug and org id, as the page cache keys it).
Hosts pass the unprefixed page URL — the implementation appends
the configured URL prefix + host(s) before computing the cache key.Source§fn invalidate_subtree<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tenant: &'life1 TenantSlug,
url_path: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invalidate_subtree<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tenant: &'life1 TenantSlug,
url_path: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Drop every cache entry whose URL starts with
url_path /
(the page itself + every descendant). Called after a slug
rename, a move, or a subtree delete.Source§fn invalidate_urls<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tenant: &'life1 TenantSlug,
url_paths: &'life2 [String],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn invalidate_urls<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_tenant: &'life1 TenantSlug,
url_paths: &'life2 [String],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Drop the cache entries for many page URLs at once. The
default loops over
Self::invalidate_url — preserving the
per-URL behavior — but backends with a bulk-purge API
(Cloudflare files, Azure CDN contentPaths) should override
this to issue a single request instead of N. The purge fan-out
in crate::task_queue::purge_urls calls this so a batch
backend collapses a multi-URL save into one round-trip.Auto Trait Implementations§
impl !RefUnwindSafe for AzureCdnInvalidator
impl !UnwindSafe for AzureCdnInvalidator
impl Forget for AzureCdnInvalidator
impl Freeze for AzureCdnInvalidator
impl Send for AzureCdnInvalidator
impl Sync for AzureCdnInvalidator
impl Unpin for AzureCdnInvalidator
impl UnsafeUnpin for AzureCdnInvalidator
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.