pub struct RepositoryStatus {
pub config_file: String,
pub unique_id_hex: String,
pub client_options: ClientOptions,
pub storage: StorageInfo,
pub content_format: ContentFormat,
pub blob_retention: Option<BlobRetention>,
}Expand description
Result of kopia repository status --json.
The repository’s stable identity is uniqueIDHex (kopia’s JSON key, hence
the explicit rename). We keep the high-value fields typed and leave the rest
(volume capacity, object format, epoch params) for future expansion without
breaking on unknown fields.
Parse a trimmed status object — note the uniqueIDHex key maps to
unique_id_hex, and unknown fields (here extraFutureField) are tolerated:
use kopiur_kopia::RepositoryStatus;
let json = r#"{
"configFile": "/config/repository.config",
"uniqueIDHex": "deadbeef",
"clientOptions": {"hostname": "prod", "username": "mydb"},
"storage": {"type": "s3", "config": {"bucket": "backups"}},
"contentFormat": {"hash": "BLAKE2B-256-128", "encryption": "AES256-GCM-HMAC-SHA256", "version": 3},
"extraFutureField": 42
}"#;
let status: RepositoryStatus = serde_json::from_str(json).unwrap();
assert_eq!(status.unique_id_hex, "deadbeef");
assert_eq!(status.storage.storage_type, "s3");
assert_eq!(status.content_format.version, 3);
assert_eq!(status.client_options.username, "mydb");Fields§
§config_file: StringPath to the local repository config file.
unique_id_hex: StringThe repository’s stable unique id. kopia’s key is uniqueIDHex.
client_options: ClientOptionsClient identity options.
storage: StorageInfoStorage backend info.
content_format: ContentFormatContent format (hash/encryption/version).
blob_retention: Option<BlobRetention>Object-lock blob retention, from kopia’s kopia.blobcfg blob.
Top-level, unlike the epoch parameters nested under contentFormat — do not
follow that pattern here. omitempty on both inner keys means kopia emits {} when
retention is off, so an all-default value is the “disabled” observation, not a
missing one.
Trait Implementations§
Source§impl Clone for RepositoryStatus
impl Clone for RepositoryStatus
Source§fn clone(&self) -> RepositoryStatus
fn clone(&self) -> RepositoryStatus
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 RepositoryStatus
impl Debug for RepositoryStatus
Source§impl<'de> Deserialize<'de> for RepositoryStatus
impl<'de> Deserialize<'de> for RepositoryStatus
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 RepositoryStatus
impl PartialEq for RepositoryStatus
Source§fn eq(&self, other: &RepositoryStatus) -> bool
fn eq(&self, other: &RepositoryStatus) -> bool
self and other values to be equal, and is used by ==.