Skip to content

Commit 62bac42

Browse files
authored
Merge pull request bootc-dev#619 from cgwalters/diff-serialize
container: Make ManifestDiff serializable
2 parents 3d686ab + 6c8ef67 commit 62bac42

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lib/src/container/mod.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use anyhow::anyhow;
2929
use containers_image_proxy::oci_spec;
3030
use ostree::glib;
31+
use serde::Serialize;
3132

3233
use std::borrow::Cow;
3334
use std::collections::HashMap;
@@ -295,27 +296,31 @@ impl std::fmt::Display for OstreeImageReference {
295296
}
296297

297298
/// Represents the difference in layer/blob content between two OCI image manifests.
298-
#[derive(Debug)]
299+
#[derive(Debug, Serialize)]
299300
pub struct ManifestDiff<'a> {
300301
/// The source container image manifest.
302+
#[serde(skip)]
301303
pub from: &'a oci_spec::image::ImageManifest,
302304
/// The target container image manifest.
305+
#[serde(skip)]
303306
pub to: &'a oci_spec::image::ImageManifest,
304307
/// Layers which are present in the old image but not the new image.
308+
#[serde(skip)]
305309
pub removed: Vec<&'a oci_spec::image::Descriptor>,
306310
/// Layers which are present in the new image but not the old image.
311+
#[serde(skip)]
307312
pub added: Vec<&'a oci_spec::image::Descriptor>,
308-
/// Total number of packages
313+
/// Total number of layers
309314
pub total: u64,
310-
/// Size of total number of packages.
315+
/// Size of total number of layers.
311316
pub total_size: u64,
312-
/// Number of packages removed
317+
/// Number of layers removed
313318
pub n_removed: u64,
314-
/// Size of the number of packages removed
319+
/// Size of the number of layers removed
315320
pub removed_size: u64,
316321
/// Number of packages added
317322
pub n_added: u64,
318-
/// Size of the number of packages added
323+
/// Size of the number of layers added
319324
pub added_size: u64,
320325
}
321326

0 commit comments

Comments
 (0)