pub(crate) struct ChunkTicketStorage {
tickets: FxHashMap<ChunkPos, Vec<StoredChunkTicket>>,
timed_generation: u64,
}Expand description
Owns one logical ticket for each canonical type identity and level.
Fields§
§tickets: FxHashMap<ChunkPos, Vec<StoredChunkTicket>>§timed_generation: u64Implementations§
Source§impl ChunkTicketStorage
impl ChunkTicketStorage
pub(crate) fn new() -> Self
Sourcepub(crate) fn from_persistent(
persistent: PersistentChunkTickets,
) -> Result<Self, ChunkTicketStorageLoadError>
pub(crate) fn from_persistent( persistent: PersistentChunkTickets, ) -> Result<Self, ChunkTicketStorageLoadError>
Restores registered ticket types from saved data.
Sourcepub(crate) fn add_ticket(
&mut self,
pos: ChunkPos,
ticket: ChunkTicket,
) -> SourceProjectionChanges
pub(crate) fn add_ticket( &mut self, pos: ChunkPos, ticket: ChunkTicket, ) -> SourceProjectionChanges
Adds one canonical ticket or refreshes an existing matching type and level.
Sourcepub(crate) fn remove_ticket(
&mut self,
pos: ChunkPos,
ticket: ChunkTicket,
) -> SourceProjectionChanges
pub(crate) fn remove_ticket( &mut self, pos: ChunkPos, ticket: ChunkTicket, ) -> SourceProjectionChanges
Removes the canonical ticket matching ticket’s type identity and level.
Sourcepub(crate) fn load_source_level(
&self,
pos: ChunkPos,
) -> Option<ChunkTicketLevel>
pub(crate) fn load_source_level( &self, pos: ChunkPos, ) -> Option<ChunkTicketLevel>
Returns the strongest loading ticket at pos.
Sourcepub(crate) fn simulation_source_level(
&self,
pos: ChunkPos,
) -> Option<ChunkTicketLevel>
pub(crate) fn simulation_source_level( &self, pos: ChunkPos, ) -> Option<ChunkTicketLevel>
Returns the strongest simulation ticket supported by Steel’s tracker at pos.
pub(crate) fn load_source_update(&self, pos: ChunkPos) -> SourceLevelUpdate
pub(crate) fn simulation_source_update( &self, pos: ChunkPos, ) -> SourceLevelUpdate
Sourcepub(crate) fn initial_load_sources(&self) -> Vec<SourceLevelUpdate>
pub(crate) fn initial_load_sources(&self) -> Vec<SourceLevelUpdate>
Enumerates the initial loading sources for propagation tracker seeding.
Sourcepub(crate) fn initial_simulation_sources(&self) -> Vec<SourceLevelUpdate>
pub(crate) fn initial_simulation_sources(&self) -> Vec<SourceLevelUpdate>
Enumerates the initial simulation sources for propagation tracker seeding.
fn initial_sources( &self, source_update: fn(&Self, ChunkPos) -> SourceLevelUpdate, ) -> Vec<SourceLevelUpdate>
Sourcepub(crate) fn add_or_refresh_portal_ticket(
&mut self,
pos: ChunkPos,
) -> SourceProjectionChanges
pub(crate) fn add_or_refresh_portal_ticket( &mut self, pos: ChunkPos, ) -> SourceProjectionChanges
Adds or refreshes Vanilla’s post-portal ticket.
Sourcepub(crate) fn add_or_refresh_ender_pearl_ticket(
&mut self,
pos: ChunkPos,
) -> SourceProjectionChanges
pub(crate) fn add_or_refresh_ender_pearl_ticket( &mut self, pos: ChunkPos, ) -> SourceProjectionChanges
Adds or refreshes Vanilla’s in-flight ender pearl ticket.
Sourcepub(crate) fn timed_ticket_expirations(&self) -> Vec<TimedTicketExpiration>
pub(crate) fn timed_ticket_expirations(&self) -> Vec<TimedTicketExpiration>
Snapshots the exact timed entries eligible for this world-tick pass.
Sourcepub(crate) fn tick_timed_tickets(
&mut self,
expirations: &[TimedTicketExpiration],
) -> SourceProjectionChanges
pub(crate) fn tick_timed_tickets( &mut self, expirations: &[TimedTicketExpiration], ) -> SourceProjectionChanges
Ages unchanged timed entries selected by the current world-tick pass.
Sourcepub(crate) fn to_persistent(&self) -> PersistentChunkTickets
pub(crate) fn to_persistent(&self) -> PersistentChunkTickets
Converts every active ticket whose type has Vanilla’s persist flag.
fn add_loaded_persistent_ticket( &mut self, persistent: PersistentChunkTicket, ) -> Result<(), ChunkTicketStorageLoadError>
fn add_loaded_ticket(&mut self, pos: ChunkPos, ticket: ChunkTicket)
fn generation_for(&mut self, ticket_type: TicketTypeRef) -> Option<u64>
fn allocate_timed_generation(&mut self) -> u64
fn compare_expirations( left: &TimedTicketExpiration, right: &TimedTicketExpiration, ) -> Ordering
fn compare_persistent_tickets( left: &PersistentChunkTicket, right: &PersistentChunkTicket, ) -> Ordering
Trait Implementations§
Source§impl Debug for ChunkTicketStorage
impl Debug for ChunkTicketStorage
Source§impl Default for ChunkTicketStorage
impl Default for ChunkTicketStorage
Source§fn default() -> ChunkTicketStorage
fn default() -> ChunkTicketStorage
Auto Trait Implementations§
impl Freeze for ChunkTicketStorage
impl RefUnwindSafe for ChunkTicketStorage
impl Send for ChunkTicketStorage
impl Sync for ChunkTicketStorage
impl Unpin for ChunkTicketStorage
impl UnsafeUnpin for ChunkTicketStorage
impl UnwindSafe for ChunkTicketStorage
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
§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> ⓘ
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> ⓘ
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 moreArc<SyncMutex<>>