pub struct LightSectionReadCache<'a> {
layout: LightCacheLayout,
sections: LightSectionSlotArray<RwLockReadGuard<'a, ChunkSection>>,
emptiness_maps: LightChunkSlotArray<Box<[bool]>>,
}Expand description
Flat cached chunk-section reads for block-state access during lighting.
Fields§
§layout: LightCacheLayout§sections: LightSectionSlotArray<RwLockReadGuard<'a, ChunkSection>>§emptiness_maps: LightChunkSlotArray<Box<[bool]>>Implementations§
Source§impl LightSectionReadCache<'_>
impl LightSectionReadCache<'_>
Sourcepub const fn layout(&self) -> LightCacheLayout
pub const fn layout(&self) -> LightCacheLayout
Returns this read cache’s layout.
Sourcepub fn get_block_state(&self, cached_block: CachedLightBlock) -> BlockStateId
pub fn get_block_state(&self, cached_block: CachedLightBlock) -> BlockStateId
Returns the block state for a cached light block, or air for missing sections.
Sourcepub fn has_non_empty_section(&self, section_pos: SectionPos) -> bool
pub fn has_non_empty_section(&self, section_pos: SectionPos) -> bool
Returns whether a cached section exists and is non-empty.
Sourcepub fn has_cached_section(&self, section_pos: SectionPos) -> bool
pub fn has_cached_section(&self, section_pos: SectionPos) -> bool
Returns whether a cached section was admitted into the section-read cache.
Sourcepub fn section_empty(&self, section_pos: SectionPos) -> Option<bool>
pub fn section_empty(&self, section_pos: SectionPos) -> Option<bool>
Returns known real-section emptiness for a readable cached chunk column.
fn air() -> BlockStateId
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LightSectionReadCache<'a>
impl<'a> !Send for LightSectionReadCache<'a>
impl<'a> !UnwindSafe for LightSectionReadCache<'a>
impl<'a> Freeze for LightSectionReadCache<'a>
impl<'a> Sync for LightSectionReadCache<'a>
impl<'a> Unpin for LightSectionReadCache<'a>
impl<'a> UnsafeUnpin for LightSectionReadCache<'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<>>