pub struct LightChunkReadCache<'a> {
layout: LightCacheLayout,
chunks: LightChunkSlotArray<&'a Chunk>,
light_chunks: LightChunkSlotArray<&'a Chunk>,
}Expand description
Flat cached chunk reads for one scoped lighting operation.
Fields§
§layout: LightCacheLayout§chunks: LightChunkSlotArray<&'a Chunk>§light_chunks: LightChunkSlotArray<&'a Chunk>Implementations§
Source§impl LightChunkReadCache<'_>
impl LightChunkReadCache<'_>
Sourcepub const fn layout(&self) -> LightCacheLayout
pub const fn layout(&self) -> LightCacheLayout
Returns this read cache’s layout.
Sourcepub fn chunk(&self, cached_chunk: CachedLightChunk) -> Option<&Chunk>
pub fn chunk(&self, cached_chunk: CachedLightChunk) -> Option<&Chunk>
Returns the cached chunk for a chunk slot.
Sourcepub fn with_section_read_cache<R>(
&self,
f: impl FnOnce(&LightSectionReadCache<'_>) -> R,
) -> R
pub fn with_section_read_cache<R>( &self, f: impl FnOnce(&LightSectionReadCache<'_>) -> R, ) -> R
Builds a section-read cache for the duration of f.
Section locks are acquired in cache-slot order and released before this method returns. Emptiness maps are copied into the cache so propagation can query known section emptiness without keeping additional borrows.
Sourcepub fn with_light_edit<R>(
&self,
layer: LightLayer,
f: impl FnOnce(LightLayerEdit<'_>) -> R,
) -> R
pub fn with_light_edit<R>( &self, layer: LightLayer, f: impl FnOnce(LightLayerEdit<'_>) -> R, ) -> R
Builds a layer-specific light edit cache for the duration of f.
Committed chunk light storage is copied into the edit cache before
propagation mutates it. The edit writes back only through
LightLayerEdit::commit, so chunk-owned light does not regain the old
persistent visible/updating split.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LightChunkReadCache<'a>
impl<'a> !UnwindSafe for LightChunkReadCache<'a>
impl<'a> Freeze for LightChunkReadCache<'a>
impl<'a> Send for LightChunkReadCache<'a>
impl<'a> Sync for LightChunkReadCache<'a>
impl<'a> Unpin for LightChunkReadCache<'a>
impl<'a> UnsafeUnpin for LightChunkReadCache<'a>
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<>>