pub enum CacheScope {
ThreadLocal,
Global,
}Expand description
Cache scope: thread-local or global
This enum determines whether a cache is stored in thread-local storage or in global static storage accessible by all threads.
§Variants
ThreadLocal- Each thread has its own independent cacheGlobal- Cache is shared across all threads with mutex protection
§Examples
use cachelito_core::CacheScope;
let scope = CacheScope::ThreadLocal;
assert_eq!(scope, CacheScope::ThreadLocal);
let global = CacheScope::Global;
assert_eq!(global, CacheScope::Global);Variants§
Trait Implementations§
Source§impl Clone for CacheScope
impl Clone for CacheScope
Source§fn clone(&self) -> CacheScope
fn clone(&self) -> CacheScope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CacheScope
Source§impl Debug for CacheScope
impl Debug for CacheScope
impl Eq for CacheScope
Source§impl PartialEq for CacheScope
impl PartialEq for CacheScope
Source§fn eq(&self, other: &CacheScope) -> bool
fn eq(&self, other: &CacheScope) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CacheScope
Auto Trait Implementations§
impl Freeze for CacheScope
impl RefUnwindSafe for CacheScope
impl Send for CacheScope
impl Sync for CacheScope
impl Unpin for CacheScope
impl UnsafeUnpin for CacheScope
impl UnwindSafe for CacheScope
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