chore(server): add reasons to expect attributes

This commit is contained in:
Serkyo 2026-07-13 00:39:49 +02:00
parent 6b3ae06031
commit 343ea7605b
2 changed files with 12 additions and 6 deletions

View file

@ -47,8 +47,10 @@ pub struct SaveActor {
/// The sending end of the request channel; cloned into every worker so it can issue reads. /// The sending end of the request channel; cloned into every worker so it can issue reads.
request_tx: Sender<SaveRequest>, request_tx: Sender<SaveRequest>,
/// The actor thread handle, retained so it can be joined on shutdown. /// The actor thread handle, retained so it can be joined on shutdown.
// * Retained ahead of a dedicated shutdown path; not yet read because the server has no graceful-stop sequence. #[expect(
#[expect(dead_code)] dead_code,
reason = "retained for a future graceful-shutdown join path"
)]
handle: JoinHandle<()>, handle: JoinHandle<()>,
} }

View file

@ -46,13 +46,17 @@ pub struct ServerWorld {
/// Positions dispatched to a worker but not yet returned, preventing the same chunk being re-dispatched on subsequent passes. /// Positions dispatched to a worker but not yet returned, preventing the same chunk being re-dispatched on subsequent passes.
in_flight: HashSet<ChunkPos>, in_flight: HashSet<ChunkPos>,
/// The dedicated thread owning all region files, kept alive for the world's lifetime. /// The dedicated thread owning all region files, kept alive for the world's lifetime.
// Retained so its request channel stays open for the workers; not read again after construction. #[expect(
#[expect(dead_code)] dead_code,
reason = "retained to keep the save request channel open for the workers"
)]
save_actor: SaveActor, save_actor: SaveActor,
/// Handles to the generation worker threads, retained so they can be joined on shutdown. /// Handles to the generation worker threads, retained so they can be joined on shutdown.
// * NOTE: Retained ahead of a dedicated shutdown path
// TODO: Remove once the server has a graceful-stop sequence // TODO: Remove once the server has a graceful-stop sequence
#[expect(dead_code)] #[expect(
dead_code,
reason = "retained for a future graceful-shutdown join path"
)]
workers: Vec<JoinHandle<()>>, workers: Vec<JoinHandle<()>>,
/// The same read-only generator handle the workers share, held so eviction can regenerate a chunk's baseline to diff against. /// The same read-only generator handle the workers share, held so eviction can regenerate a chunk's baseline to diff against.
generator: Arc<VoxelGenerator>, generator: Arc<VoxelGenerator>,