pub struct CacheKey {
url: ServoUrl,
}Expand description
The key used to differentiate requests in the cache.
Fields§
§url: ServoUrlImplementations§
Trait Implementations§
Source§impl Lifecycle<CacheKey, Arc<RwLock<Vec<CachedResource>>>> for MemoryCacheLifecycle
impl Lifecycle<CacheKey, Arc<RwLock<Vec<CachedResource>>>> for MemoryCacheLifecycle
Source§type RequestState = ()
type RequestState = ()
Per-request accumulator threaded through the eviction hooks. Read more
Source§fn on_evict(
&self,
_state: &mut Self::RequestState,
key: CacheKey,
value: Arc<RwLock<Vec<CachedResource>>>,
)
fn on_evict( &self, _state: &mut Self::RequestState, key: CacheKey, value: Arc<RwLock<Vec<CachedResource>>>, )
Called when an item is evicted. Read more
Source§fn is_pinned(&self, key: &Key, val: &Val) -> bool
fn is_pinned(&self, key: &Key, val: &Val) -> bool
Returns whether the item is pinned. Items that are pinned can’t be evicted.
Note that a pinned item can still be replaced with get_mut, insert, replace and similar APIs. Read more
Source§fn before_evict(&self, state: &mut Self::RequestState, key: &Key, val: &mut Val)
fn before_evict(&self, state: &mut Self::RequestState, key: &Key, val: &mut Val)
Called when a cache item is about to be evicted.
Note that value replacement (e.g. insertions for the same key) won’t call this method. Read more
Source§fn on_evict_cold(&self, state: &mut Self::RequestState, key: Key, val: Val)
fn on_evict_cold(&self, state: &mut Self::RequestState, key: Key, val: Val)
Called when an item is evicted from the cold queue. Read more
Source§fn on_evict_hot(&self, state: &mut Self::RequestState, key: Key, val: Val)
fn on_evict_hot(&self, state: &mut Self::RequestState, key: Key, val: Val)
Called when an item is evicted from the hot queue. Read more
Source§impl MallocSizeOf for CacheKey
impl MallocSizeOf for CacheKey
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
impl Eq for CacheKey
impl StructuralPartialEq for CacheKey
Auto Trait Implementations§
impl Freeze for CacheKey
impl RefUnwindSafe for CacheKey
impl Send for CacheKey
impl Sync for CacheKey
impl Unpin for CacheKey
impl UnsafeUnpin for CacheKey
impl UnwindSafe for CacheKey
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert