pub(crate) struct LocalFullChunkHolderCache {
scope_id: Option<NonZeroU64>,
entries: [Option<LocalFullChunkHolderCacheEntry>; 4],
}Expand description
A tiny holder cache for repeated, live Full-chunk block-state reads.
Entries are usable only inside the exact gameplay lookup-cache scope that populated them. That scope is the proof that active-map membership is stable. The holder’s current Full permission and publication are rechecked for every read, and the block section itself is locked only long enough to copy the state. Missing and unpublished chunks are never retained.
Fields§
§scope_id: Option<NonZeroU64>§entries: [Option<LocalFullChunkHolderCacheEntry>; 4]Implementations§
Source§impl LocalFullChunkHolderCache
impl LocalFullChunkHolderCache
pub(crate) const fn new() -> Self
Sourcepub(crate) fn block_state(
&mut self,
chunk_map: &ChunkMap,
pos: BlockPos,
) -> Option<BlockStateId>
pub(crate) fn block_state( &mut self, chunk_map: &ChunkMap, pos: BlockPos, ) -> Option<BlockStateId>
Reads the current state without retaining a section guard or a missing chunk result.
fn insert(&mut self, pos: ChunkPos, holder: Arc<ChunkHolder>)
fn promote(&mut self, index: usize)
fn remove(&mut self, index: usize)
Auto Trait Implementations§
impl !RefUnwindSafe for LocalFullChunkHolderCache
impl !UnwindSafe for LocalFullChunkHolderCache
impl Freeze for LocalFullChunkHolderCache
impl Send for LocalFullChunkHolderCache
impl Sync for LocalFullChunkHolderCache
impl Unpin for LocalFullChunkHolderCache
impl UnsafeUnpin for LocalFullChunkHolderCache
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<>>