pub fn manifest(mut self, manifest: Manifest, manifest_descriptor: Descriptor) -> Self {
        // add the manifest descriptor to the index_json
        self.index_json.manifests.push(manifest_descriptor.clone());

        let mut blob_descriptors = Vec::new();

        // add the various descriptors referenced in the manifest
        // (and the manifest itself) as required blobs
        blob_descriptors.push(manifest_descriptor);
        blob_descriptors.push(manifest.config.clone());
        for descriptor in &manifest.layers {
            blob_descriptors.push(descriptor.clone());
        }

        self.blobs
            .extend(blob_descriptors.into_iter().map(|descriptor| {
                let mut path = PathBuf::new();
                path.push("blobs");
                path.push(descriptor.digest.algorithm());
                path.push(descriptor.digest.encoded());
                (path, descriptor)
            }));

        self
    }
/// Add a manifest to the image layout.
Add a manifest to the image layout.
Add a manifest to the image layout .
pub fn manifest(mut self, manifest: Manifest, manifest_descriptor: Descriptor) -> Self {
        // add the manifest descriptor to the index_json
        self.index_json.manifests.push(manifest_descriptor.clone());
        let mut blob_descriptors = Vec::new();
        // add the various descriptors referenced in the manifest
        // (and the manifest itself) as required blobs
        blob_descriptors.push(manifest_descriptor);
        blob_descriptors.push(manifest.config.clone());
        for descriptor in &manifest.layers {
            blob_descriptors.push(descriptor.clone());
        }
        self.blobs
            .extend(blob_descriptors.into_iter().map(|descriptor| {
                let mut path = PathBuf::new();
                path.push("blobs");
                path.push(descriptor.digest.algorithm());
                path.push(descriptor.digest.encoded());
                (path, descriptor)
            }));
        self
    }
pub fn manifest ( mut self , manifest : Manifest , manifest_descriptor : Descriptor ) -> Self { // add the manifest descriptor to the index_json self . index_json . manifests . push ( manifest_descriptor . clone ( ) ) ; let mut blob_descriptors = Vec :: new ( ) ; // add the various descriptors referenced in the manifest // (and the manifest itself) as required blobs blob_descriptors . push ( manifest_descriptor ) ; blob_descriptors . push ( manifest . config . clone ( ) ) ; for descriptor in & manifest . layers { blob_descriptors . push ( descriptor . clone ( ) ) ; } self . blobs . extend ( blob_descriptors . into_iter ( ) . map ( | descriptor | { let mut path = PathBuf :: new ( ) ; path . push ( " " ) ; path . push ( descriptor . digest . algorithm ( ) ) ; path . push ( descriptor . digest . encoded ( ) ) ; ( path , descriptor ) } ) ) ; self }
Add a manifest to the image layout.
Add a manifest to the image layout .
mut self
manifest
Manifest
manifest_descriptor
Descriptor
mut self
manifest
Manifest
manifest_descriptor
Descriptor