pub(crate) struct ChunkTickContainer {
state: SyncMutex<ChunkTickContainerState>,
}Expand description
Stable scheduled-tick storage owned by one chunk from creation through unload.
The world scheduler retains a shared handle only while the chunk is registered and indexes its current heads. Persistence reads this container directly, so packing one chunk never retains the world scheduler metadata lock.
Fields§
§state: SyncMutex<ChunkTickContainerState>Implementations§
Source§impl ChunkTickContainer
impl ChunkTickContainer
pub(crate) const fn new(lists: ChunkTickLists) -> Self
pub(crate) const fn new_proto(lists: ChunkTickLists) -> Self
Sourcepub(crate) fn promote_to_full(&self) -> bool
pub(crate) fn promote_to_full(&self) -> bool
Atomically closes proto-only mutations and opens unpublished Full scheduling.
pub(crate) fn schedule_unregistered_block( &self, block: BlockRef, pos: BlockPos, trigger_tick: i64, priority: TickPriority, sub_tick_order: i64, ) -> Option<bool>
pub(crate) fn schedule_unregistered_fluid( &self, fluid: FluidRef, pos: BlockPos, trigger_tick: i64, priority: TickPriority, sub_tick_order: i64, ) -> Option<bool>
pub(crate) fn schedule_pending_block( &self, block: BlockRef, pos: BlockPos, priority: TickPriority, ) -> Option<bool>
pub(crate) fn schedule_pending_fluid( &self, fluid: FluidRef, pos: BlockPos, priority: TickPriority, ) -> Option<bool>
pub(crate) fn pending_block_snapshot(&self) -> Option<Vec<SavedTick<BlockRef>>>
pub(crate) fn remove_pending_blocks_matching( &self, predicate: impl FnMut(&SavedTick<BlockRef>) -> bool, ) -> Option<usize>
pub(crate) fn has_block(&self, pos: BlockPos, block: BlockRef) -> Option<bool>
pub(crate) fn has_fluid(&self, pos: BlockPos, fluid: FluidRef) -> Option<bool>
pub(crate) fn snapshot( &self, current_tick: i64, ) -> Option<ScheduledTickSnapshot>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChunkTickContainer
impl !RefUnwindSafe for ChunkTickContainer
impl !UnwindSafe for ChunkTickContainer
impl Send for ChunkTickContainer
impl Sync for ChunkTickContainer
impl Unpin for ChunkTickContainer
impl UnsafeUnpin for ChunkTickContainer
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<>>