pub(crate) struct BlockRegionRead<'a> {
bounds: BlockRegionBounds,
sections: SmallVec<[Option<RwLockReadGuard<'a, ChunkSection>>; 8]>,
min_chunk_x: i32,
min_chunk_z: i32,
chunk_z_count: usize,
min_section_y: i32,
section_y_count: usize,
world_min_y: i32,
world_max_y: i32,
air: BlockStateId,
void_air: BlockStateId,
}Expand description
Scoped block-state reads over a rectangular set of prelocked sections.
Fields§
§bounds: BlockRegionBounds§sections: SmallVec<[Option<RwLockReadGuard<'a, ChunkSection>>; 8]>§min_chunk_x: i32§min_chunk_z: i32§chunk_z_count: usize§min_section_y: i32§section_y_count: usize§world_min_y: i32§world_max_y: i32§air: BlockStateId§void_air: BlockStateIdImplementations§
Source§impl BlockRegionRead<'_>
impl BlockRegionRead<'_>
Sourcepub(crate) fn get_block_state(&self, pos: BlockPos) -> Option<BlockStateId>
pub(crate) fn get_block_state(&self, pos: BlockPos) -> Option<BlockStateId>
Returns the block state at pos, or None when it is outside this region.
Positions outside world bounds are void air. Missing Full chunks are air,
matching World::get_block_state.
Sourcepub(crate) fn section(
&self,
section_pos: SectionPos,
) -> Option<BlockSectionRead<'_>>
pub(crate) fn section( &self, section_pos: SectionPos, ) -> Option<BlockSectionRead<'_>>
Returns a prelocked section view, or None for an unloaded or uncached section.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BlockRegionRead<'a>
impl<'a> !Send for BlockRegionRead<'a>
impl<'a> !UnwindSafe for BlockRegionRead<'a>
impl<'a> Freeze for BlockRegionRead<'a>
impl<'a> Sync for BlockRegionRead<'a>
impl<'a> Unpin for BlockRegionRead<'a>
impl<'a> UnsafeUnpin for BlockRegionRead<'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<>>