pub struct EdgeCacheManager { /* private fields */ }Expand description
Manages edge caching operations
Implementations§
Source§impl EdgeCacheManager
impl EdgeCacheManager
Sourcepub fn new(config: CacheConfig) -> Self
pub fn new(config: CacheConfig) -> Self
Create a new edge cache manager
Sourcepub fn generate_key(
&self,
path: &str,
query: Option<&str>,
vary_headers: &HashMap<String, String>,
) -> String
pub fn generate_key( &self, path: &str, query: Option<&str>, vary_headers: &HashMap<String, String>, ) -> String
Generate cache key from request
Sourcepub async fn get(&self, key: &str) -> Option<CacheEntry>
pub async fn get(&self, key: &str) -> Option<CacheEntry>
Get entry from cache
Sourcepub async fn set(
&self,
key: String,
value: Vec<u8>,
content_type: String,
path: &str,
)
pub async fn set( &self, key: String, value: Vec<u8>, content_type: String, path: &str, )
Set entry in cache
Sourcepub async fn invalidate(&self, key: &str)
pub async fn invalidate(&self, key: &str)
Invalidate cache entry
Sourcepub async fn invalidate_prefix(&self, prefix: &str)
pub async fn invalidate_prefix(&self, prefix: &str)
Invalidate cache entries by prefix
Sourcepub async fn get_stats(&self) -> CacheStats
pub async fn get_stats(&self) -> CacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for EdgeCacheManager
impl !RefUnwindSafe for EdgeCacheManager
impl Send for EdgeCacheManager
impl Sync for EdgeCacheManager
impl Unpin for EdgeCacheManager
impl UnsafeUnpin for EdgeCacheManager
impl !UnwindSafe for EdgeCacheManager
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 more