#[non_exhaustive]pub struct JobMetadata {
pub schema_version: String,
pub plan_hash: String,
pub completed_tiles: Vec<TileCoord>,
pub levels_completed: Vec<u32>,
pub started_at: String,
pub last_checkpoint_at: String,
}Expand description
On-disk checkpoint describing the state of a pyramid generation job.
Produced and consumed by JobCheckpoint::save / JobCheckpoint::load.
The struct is intentionally simple and flat so that it serialises cleanly
as JSON — a debugger or shell user can inspect it with cat / jq.
schema_version is stored as a String so we can read back old
checkpoints, compare them against SCHEMA_VERSION, and return a
structured error if they disagree.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.schema_version: StringOn-disk schema version. Equal to SCHEMA_VERSION (“1”) for
checkpoints produced by this crate version. Stored as a plain
String so the value read from disk is preserved verbatim and can
be compared against the binary’s expected version.
plan_hash: StringLowercase hex Blake3 digest of the plan’s canonical byte
representation (see compute_plan_hash).
completed_tiles: Vec<TileCoord>Coordinates of every tile that has been successfully written and flushed since the job started.
Uses the [tile_coord_vec_serde] adapter because TileCoord in
crate::planner does not itself implement Serialize /
Deserialize.
levels_completed: Vec<u32>Level indices that have been fully completed (every tile in the level
is present in completed_tiles). Populated eagerly so resumption can
skip whole levels without re-checking each tile.
started_at: StringRFC 3339 timestamp captured when the job first started (Overwrite mode) or when an existing checkpoint was first resumed.
last_checkpoint_at: StringRFC 3339 timestamp of the most recent checkpoint write.
Implementations§
Source§impl JobMetadata
impl JobMetadata
Sourcepub fn new(plan_hash: String, started_at: String) -> Self
pub fn new(plan_hash: String, started_at: String) -> Self
Construct a fresh JobMetadata tagged with the current
SCHEMA_VERSION. All other fields default to empty / zero values;
callers fill them in as the job progresses.
Trait Implementations§
Source§impl Clone for JobMetadata
impl Clone for JobMetadata
Source§fn clone(&self) -> JobMetadata
fn clone(&self) -> JobMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JobMetadata
impl Debug for JobMetadata
Source§impl<'de> Deserialize<'de> for JobMetadata
impl<'de> Deserialize<'de> for JobMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for JobMetadata
impl PartialEq for JobMetadata
Source§impl Serialize for JobMetadata
impl Serialize for JobMetadata
impl StructuralPartialEq for JobMetadata
Auto Trait Implementations§
impl Freeze for JobMetadata
impl RefUnwindSafe for JobMetadata
impl Send for JobMetadata
impl Sync for JobMetadata
impl Unpin for JobMetadata
impl UnsafeUnpin for JobMetadata
impl UnwindSafe for JobMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more