pub struct SnapshotListEntry {
pub id: String,
pub source: SnapshotSource,
pub description: String,
pub start_time: DateTime<Utc>,
pub end_time: DateTime<Utc>,
pub stats: SnapshotStats,
pub root_entry: Option<RootEntry>,
pub retention_reason: Vec<String>,
pub tags: BTreeMap<String, String>,
pub incomplete: Option<String>,
}Expand description
One entry from kopia snapshot list --json.
Unlike the create result, list entries carry a top-level stats block and a
retentionReason array (the kopia GFS classes keeping the snapshot alive):
use kopiur_kopia::SnapshotListEntry;
let json = r#"{
"id": "k1",
"source": {"host": "prod", "userName": "mydb", "path": "/data"},
"startTime": "2026-06-02T03:13:59Z",
"endTime": "2026-06-02T03:14:00Z",
"stats": {"totalSize": 4096, "fileCount": 12, "errorCount": 0},
"retentionReason": ["latest-1", "daily-1"]
}"#;
let entry: SnapshotListEntry = serde_json::from_str(json).unwrap();
assert_eq!(entry.id, "k1");
assert_eq!(entry.stats.total_size, 4096);
assert_eq!(entry.stats.file_count, 12);
assert_eq!(entry.retention_reason, vec!["latest-1", "daily-1"]);Fields§
§id: StringThe snapshot manifest id.
source: SnapshotSourceIdentity of the snapshot.
description: StringFree-form description.
start_time: DateTime<Utc>When the snapshot started.
end_time: DateTime<Utc>When the snapshot finished.
stats: SnapshotStatsPer-snapshot statistics.
root_entry: Option<RootEntry>Root directory entry.
retention_reason: Vec<String>Why this snapshot is being retained (kopia GFS reasons such as
latest-1, daily-1). Empty for snapshots outside any retention class.
Snapshot tags as stored on the manifest — keys carry kopia’s tag: prefix
(strip with user_tags). Empty for untagged snapshots and on kopia
versions that omit the field; an empty map is elided on re-serialization
(these types also ride the mover result wire).
incomplete: Option<String>kopia’s IncompleteReason: set (checkpoint, canceled, …) on a
manifest an interrupted snapshot create left behind. kopia’s JSON
listing emits these even WITHOUT --incomplete (that flag only filters
the text output) — read it through Self::incomplete_reason.
Implementations§
Source§impl SnapshotListEntry
impl SnapshotListEntry
Sourcepub fn incomplete_reason(&self) -> Option<&str>
pub fn incomplete_reason(&self) -> Option<&str>
Why this manifest is NOT a complete snapshot, or None for a complete
one. Reads the top-level marker, falling back to rootEntry.summ
(kopia writes both); an empty string is kopia’s omitempty “complete”.
Deliberately an open string, not an enum: ANY reason means incomplete,
so a reason kopia adds later can never be mistaken for complete.
Trait Implementations§
Source§impl Clone for SnapshotListEntry
impl Clone for SnapshotListEntry
Source§fn clone(&self) -> SnapshotListEntry
fn clone(&self) -> SnapshotListEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SnapshotListEntry
impl Debug for SnapshotListEntry
Source§impl<'de> Deserialize<'de> for SnapshotListEntry
impl<'de> Deserialize<'de> for SnapshotListEntry
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>,
impl Eq for SnapshotListEntry
Source§impl PartialEq for SnapshotListEntry
impl PartialEq for SnapshotListEntry
Source§fn eq(&self, other: &SnapshotListEntry) -> bool
fn eq(&self, other: &SnapshotListEntry) -> bool
self and other values to be equal, and is used by ==.