struct WeightGuard<Key, Val, We: Weighter<Key, Val>, B, L, Plh: SharedPlaceholder> {
shard: *mut CacheShard<Key, Val, We, B, L, Plh>,
idx: NonZeroU32,
old_weight: u64,
}Expand description
Drop guard for entry_or_placeholder: if the user callback panics after
mutating the value, recomputes weight to keep shard accounting consistent.
Fields§
§shard: *mut CacheShard<Key, Val, We, B, L, Plh>§idx: NonZeroU32§old_weight: u64Trait Implementations§
Source§impl<Key, Val, We: Weighter<Key, Val>, B, L, Plh: SharedPlaceholder> Drop for WeightGuard<Key, Val, We, B, L, Plh>
impl<Key, Val, We: Weighter<Key, Val>, B, L, Plh: SharedPlaceholder> Drop for WeightGuard<Key, Val, We, B, L, Plh>
Auto Trait Implementations§
impl<Key, Val, We, B, L, Plh> Freeze for WeightGuard<Key, Val, We, B, L, Plh>
impl<Key, Val, We, B, L, Plh> RefUnwindSafe for WeightGuard<Key, Val, We, B, L, Plh>where
B: RefUnwindSafe,
We: RefUnwindSafe,
L: RefUnwindSafe,
Key: RefUnwindSafe,
Val: RefUnwindSafe,
Plh: RefUnwindSafe,
impl<Key, Val, We, B, L, Plh> !Send for WeightGuard<Key, Val, We, B, L, Plh>
impl<Key, Val, We, B, L, Plh> !Sync for WeightGuard<Key, Val, We, B, L, Plh>
impl<Key, Val, We, B, L, Plh> Unpin for WeightGuard<Key, Val, We, B, L, Plh>
impl<Key, Val, We, B, L, Plh> UnwindSafe for WeightGuard<Key, Val, We, B, L, Plh>where
B: RefUnwindSafe,
We: RefUnwindSafe,
L: RefUnwindSafe,
Key: RefUnwindSafe,
Val: RefUnwindSafe,
Plh: RefUnwindSafe,
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