pub struct PlaceholderGuard<'a, Key, Val, We, B, L> {
lifecycle: &'a L,
shard: &'a RwLock<CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>,
shared: Arc<Placeholder<Val>>,
inserted: bool,
}Fields§
§lifecycle: &'a L§shard: &'a RwLock<CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>§inserted: boolImplementations§
Source§impl<'a, Key, Val, We, B, L> PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key, Val, We, B, L> PlaceholderGuard<'a, Key, Val, We, B, L>
pub fn start_loading( lifecycle: &'a L, shard: &'a RwLock<CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>, shared: Arc<Placeholder<Val>>, ) -> Self
fn handle_notification(
lifecycle: &'a L,
shard: &'a RwLock<CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>,
shared: Arc<Placeholder<Val>>,
) -> Result<Val, PlaceholderGuard<'a, Key, Val, We, B, L>>where
Val: Clone,
fn join_waiters(
_locked_shard: RwLockWriteGuard<'a, CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>,
shared: &Arc<Placeholder<Val>>,
waiter_new: impl FnOnce() -> Option<Waiter>,
) -> Option<Val>where
Val: Clone,
Source§impl<'a, Key: Eq + Hash, Val: Clone, We: Weighter<Key, Val>, B: BuildHasher, L: Lifecycle<Key, Val>> PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key: Eq + Hash, Val: Clone, We: Weighter<Key, Val>, B: BuildHasher, L: Lifecycle<Key, Val>> PlaceholderGuard<'a, Key, Val, We, B, L>
pub fn join<Q>( lifecycle: &'a L, shard: &'a RwLock<CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>, hash: u64, key: &Q, timeout: Option<Duration>, ) -> GuardResult<'a, Key, Val, We, B, L>
fn join_timeout( lifecycle: &'a L, shard: &'a RwLock<CacheShard<Key, Val, We, B, L, Arc<Placeholder<Val>>>>, shared: Arc<Placeholder<Val>>, parked_thread: Option<ThreadId>, notified: &AtomicBool, ) -> GuardResult<'a, Key, Val, We, B, L>
Source§impl<Key: Eq + Hash, Val: Clone, We: Weighter<Key, Val>, B: BuildHasher, L: Lifecycle<Key, Val>> PlaceholderGuard<'_, Key, Val, We, B, L>
impl<Key: Eq + Hash, Val: Clone, We: Weighter<Key, Val>, B: BuildHasher, L: Lifecycle<Key, Val>> PlaceholderGuard<'_, Key, Val, We, B, L>
Sourcepub fn insert(self, value: Val) -> Result<(), Val>
pub fn insert(self, value: Val) -> Result<(), Val>
Inserts the value into the placeholder
Returns Err if the placeholder isn’t in the cache anymore.
A placeholder can be removed as a result of a remove call
or a non-placeholder insert with the same key.
Sourcepub fn insert_with_lifecycle(self, value: Val) -> Result<L::RequestState, Val>
pub fn insert_with_lifecycle(self, value: Val) -> Result<L::RequestState, Val>
Inserts the value into the placeholder
Returns Err if the placeholder isn’t in the cache anymore.
A placeholder can be removed as a result of a remove call
or a non-placeholder insert with the same key.
Source§impl<Key, Val, We, B, L> PlaceholderGuard<'_, Key, Val, We, B, L>
impl<Key, Val, We, B, L> PlaceholderGuard<'_, Key, Val, We, B, L>
fn drop_uninserted_slow(&mut self)
Trait Implementations§
Source§impl<Key, Val, We, B, L> Debug for PlaceholderGuard<'_, Key, Val, We, B, L>
impl<Key, Val, We, B, L> Debug for PlaceholderGuard<'_, Key, Val, We, B, L>
Auto Trait Implementations§
impl<'a, Key, Val, We, B, L> Freeze for PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key, Val, We, B, L> RefUnwindSafe for PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key, Val, We, B, L> Send for PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key, Val, We, B, L> Sync for PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key, Val, We, B, L> Unpin for PlaceholderGuard<'a, Key, Val, We, B, L>
impl<'a, Key, Val, We, B, L> UnwindSafe for PlaceholderGuard<'a, Key, Val, We, B, L>
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