pub struct CachePlugin { /* private fields */ }Expand description
Process-wide CachePlugin singleton storing CacheConfig and a pluggable CacheStore.
Implementations§
Source§impl CachePlugin
Inherent implementation of CachePlugin.
impl CachePlugin
Inherent implementation of CachePlugin.
Sourcepub fn init(config: CacheConfig) -> &'static Self
pub fn init(config: CacheConfig) -> &'static Self
Initializes the global CachePlugin once with config and the default ShardedMemoryCache.
§Arguments
CacheConfig- HTTP cache policy and memory limits.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn init_with_store(
config: CacheConfig,
store: SharedCacheStore,
) -> &'static Self
pub fn init_with_store( config: CacheConfig, store: SharedCacheStore, ) -> &'static Self
Initializes the global CachePlugin once with config and a custom CacheStore.
§Arguments
CacheConfig- HTTP cache policy.SharedCacheStore- Pluggable cache backend.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global CachePlugin, if initialized.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Sourcepub fn get_config(&self) -> &CacheConfig
pub fn get_config(&self) -> &CacheConfig
Sourcepub fn get_store(&self) -> &SharedCacheStore
pub fn get_store(&self) -> &SharedCacheStore
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CachePlugin
impl !UnwindSafe for CachePlugin
impl Forget for CachePlugin
impl Freeze for CachePluginwhere
*const ArcInner<dyn CacheStore> is !null: Freeze,
PhantomData<ArcInner<dyn CacheStore>>: Freeze,
*const ArcInner<ShardedMemoryCacheInner> is !null: Freeze,
PhantomData<ArcInner<ShardedMemoryCacheInner>>: Freeze,
impl Move for CachePlugin
impl Send for CachePlugin
impl Sync for CachePlugin
impl Unpin for CachePlugin
impl UnsafeUnpin for CachePluginwhere
*const ArcInner<dyn CacheStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn CacheStore>>: UnsafeUnpin,
*const ArcInner<ShardedMemoryCacheInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<ShardedMemoryCacheInner>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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