pub struct Snapshot {
pub schema_version: i32,
pub export_version: String,
pub exported_at: String,
pub exported_by: String,
pub tables: BTreeMap<String, Vec<Value>>,
}Expand description
A structured export snapshot of the task-graph database.
This is a flexible format that can load exports created by either
the Database::export_tables (strongly-typed) or any JSON conforming
to the export spec. The tables field uses generic JSON values
to support comparison across schema versions.
Fields§
§schema_version: i32Database schema version (from task-graph internals) Uses i32 for compatibility with existing exports.
export_version: StringExport format version (semver)
exported_at: StringISO 8601 timestamp of export
exported_by: StringTool name and version that created this export
tables: BTreeMap<String, Vec<Value>>Table data, keyed by table name. Each table is an array of row objects with column names as keys.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Load a snapshot from a file (supports both plain JSON and gzip).
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serialize to JSON with pretty formatting.
Sourcepub fn is_schema_compatible(&self) -> bool
pub fn is_schema_compatible(&self) -> bool
Check if this snapshot’s schema is compatible with the current version.
Sourcepub fn table_names(&self) -> Vec<&str>
pub fn table_names(&self) -> Vec<&str>
Get the list of tables present in this snapshot.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
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>,
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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 more