pub(crate) struct GameplayChunkLookupCacheScope<'map> {
previous: Option<ActiveCache>,
active: bool,
_chunk_map: PhantomData<&'map ChunkMap>,
_thread_bound: PhantomData<Rc<()>>,
}Expand description
Installs an empty cache until the scope is finished or dropped.
Nested scopes restore the prior cache, and the owned holder references are released on every exit path, including unwinding. Nested guards must exit in the usual last-in, first-out order.
Fields§
§previous: Option<ActiveCache>§active: bool§_chunk_map: PhantomData<&'map ChunkMap>§_thread_bound: PhantomData<Rc<()>>Implementations§
Source§impl<'map> GameplayChunkLookupCacheScope<'map>
impl<'map> GameplayChunkLookupCacheScope<'map>
pub(crate) fn enter(chunk_map: &'map ChunkMap) -> Self
fn enter_key(owner: CacheOwner) -> Self
pub(crate) fn finish(self) -> GameplayChunkLookupCacheStats
fn restore(&mut self) -> Option<ActiveCache>
Trait Implementations§
Source§impl Drop for GameplayChunkLookupCacheScope<'_>
impl Drop for GameplayChunkLookupCacheScope<'_>
Auto Trait Implementations§
impl<'map> !RefUnwindSafe for GameplayChunkLookupCacheScope<'map>
impl<'map> !Send for GameplayChunkLookupCacheScope<'map>
impl<'map> !Sync for GameplayChunkLookupCacheScope<'map>
impl<'map> !UnwindSafe for GameplayChunkLookupCacheScope<'map>
impl<'map> Freeze for GameplayChunkLookupCacheScope<'map>
impl<'map> Unpin for GameplayChunkLookupCacheScope<'map>
impl<'map> UnsafeUnpin for GameplayChunkLookupCacheScope<'map>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreWraps this value in an
Arc<SyncMutex<>>