Skip to main content

Module model

Module model 

Source
Expand description

Typed models for kopia --json output (kopia 0.23).

These structs are modeled against the actual JSON kopia emits, captured by round-tripping a filesystem repository. Field names match kopia’s keys exactly via #[serde(rename_all = "camelCase")] (plus explicit renames where kopia diverges, e.g. uniqueIDHex). None of these use deny_unknown_fields: kopia adds fields across releases and we must tolerate them. Times are chrono::DateTime<Utc>.

Note on stdout vs stderr: kopia prints its progress (Snapshotting ..., Restored N files) to stderr and the machine-readable --json result to stdout. The client parses stdout only.

Structs§

ClientOptions
Client identity options reported by kopia repository status.
ContentFormat
Content format block from kopia repository status.
DirEntry
One entry of a kopia directory manifest (kopia show <dir-object-id>).
DirManifest
A kopia directory manifest: what kopia show <dir-object-id> emits — {"stream":"kopia:directory","entries":[…]}. (kopia show on a file object streams the file’s raw bytes instead, so callers must check DirEntry::entry_type before showing an object as a directory.)
DirSummary
Directory summary embedded under a root entry (summ). Carries the aggregate counts kopia computed while walking the tree.
DirSummaryLite
The aggregate subtree counters under a directory entry’s summ block — the subset of DirSummary a directory listing renders. All optional: kopia may extend or omit counters across releases.
EntryError
One {path, error} entry from a snapshot’s rootEntry.summ.errors. Kopia records the source-relative path and the full error string for every entry it could not include.
EpochParameters
kopia’s epoch-manager parameters, as reported inside repository status --jsoncontentFormat.epochParameters.
IndexBlobEntry
One entry from kopia index list --json — a single content-index blob.
MaintenanceCadence
A maintenance cadence block (quick / full) from maintenance info.
MaintenanceInfo
Result of kopia maintenance info --json.
MaintenanceSchedule
The schedule block: when maintenance next runs. The detailed per-task runs history is left as a raw value (its shape is large and unstable).
RepositoryStatus
Result of kopia repository status --json.
RootEntry
The rootEntry of a snapshot — the top directory object plus its summary.
SnapshotCreateResult
Result of kopia snapshot create <path> --json.
SnapshotListEntry
One entry from kopia snapshot list --json.
SnapshotSource
Kopia’s snapshot identity triple: userName@host:path. Present on both snapshot-create results and snapshot-list entries.
SnapshotStats
The stats block present on each kopia snapshot list --json entry. These are the new/modified/unchanged-style counters.
StorageInfo
Storage backend block from kopia repository status. config is left as a raw JSON value because its shape is backend-specific (filesystem path vs S3 bucket/endpoint vs …).

Functions§

user_tags
Strip kopia’s tag: manifest-key prefix from a snapshot tags map, yielding the tags under the keys the CLI was given (--tags key:value → manifest tag:key).