/// Constructs a Vec<Image> which lists metadata for the base package, BlobFS,
/// FVMs, ZBI, and VBMeta.
Constructs a Vec which lists metadata for the base package, BlobFS,
FVMs, ZBI, and VBMeta.
Constructs a Vec which lists metadata for the base package BlobFS FVMs ZBI and VBMeta .
fn construct_images_metadata(
    zbi_path: &PathBuf,
    base_package: Option<&BasePackage>,
    blobfs_path: Option<&PathBuf>,
    fvms: Option<&Fvms>,
    vbmeta_path: Option<&PathBuf>,
) -> Result<Vec<Image>> {
    let mut images = vec![];
    if let Some(base_package) = base_package {
        images.push(Image::new("base-package", &base_package.path, "far")?);
    }
    if let Some(blobfs_path) = blobfs_path {
        images.push(Image::new("blob", &blobfs_path, "blk")?);
    }
    if let Some(fvms) = fvms {
        images.push(Image::new("storage-full", &fvms.default, "blk")?);
        images.push(Image::new("storage-sparse", &fvms.sparse, "blk")?);
        images.push(Image::new("storage-sparse-blob", &fvms.sparse_blob, "blk")?);
        if let Some(fastboot) = &fvms.fastboot {
            images.push(Image::new("fvm.fastboot", &fastboot, "blk")?);
        }
    }
    images.push(Image::new("zircon-a", &zbi_path, "zbi")?);
    if let Some(vbmeta_path) = vbmeta_path {
        images.push(Image::new("zircon-a", &vbmeta_path, "vbmeta")?);
    }
    Ok(images)
}
fn construct_images_metadata ( zbi_path : & PathBuf , base_package : Option < & BasePackage > , blobfs_path : Option < & PathBuf > , fvms : Option < & Fvms > , vbmeta_path : Option < & PathBuf > , ) -> Result < Vec < Image > > { let mut images = vec ! [ ] ; if let Some ( base_package ) = base_package { images . push ( Image :: new ( " " , & base_package . path , " " ) ? ) ; } if let Some ( blobfs_path ) = blobfs_path { images . push ( Image :: new ( " " , & blobfs_path , " " ) ? ) ; } if let Some ( fvms ) = fvms { images . push ( Image :: new ( " " , & fvms . default , " " ) ? ) ; images . push ( Image :: new ( " " , & fvms . sparse , " " ) ? ) ; images . push ( Image :: new ( " " , & fvms . sparse_blob , " " ) ? ) ; if let Some ( fastboot ) = & fvms . fastboot { images . push ( Image :: new ( " " , & fastboot , " " ) ? ) ; } } images . push ( Image :: new ( " " , & zbi_path , " " ) ? ) ; if let Some ( vbmeta_path ) = vbmeta_path { images . push ( Image :: new ( " " , & vbmeta_path , " " ) ? ) ; } Ok ( images ) }
Constructs a Vec<Image> which lists metadata for the base package, BlobFS,
FVMs, ZBI, and VBMeta.
Constructs a Vec<Image > which lists metadata for the base package BlobFS FVMs ZBI and VBMeta .
zbi_path
&PathBuf
base_package
Option<&BasePackage>
blobfs_path
Option<&PathBuf>
fvms
Option<&Fvms>
vbmeta_path
Option<&PathBuf>