Struct fuchsia_pkg::PackageManifest
source · pub struct PackageManifest(/* private fields */);
Implementations§
source§impl PackageManifest
impl PackageManifest
sourcepub const META_FAR_BLOB_PATH: &'static str = "meta/"
pub const META_FAR_BLOB_PATH: &'static str = "meta/"
Blob path used in package manifests to indicate the meta.far
.
pub fn blobs(&self) -> &[BlobInfo]
pub fn subpackages(&self) -> &[SubpackageInfo]
pub fn into_blobs(self) -> Vec<BlobInfo>
sourcepub fn into_blobs_and_subpackages(self) -> (Vec<BlobInfo>, Vec<SubpackageInfo>)
pub fn into_blobs_and_subpackages(self) -> (Vec<BlobInfo>, Vec<SubpackageInfo>)
Returns the current packages blobs and subpackages.
pub fn name(&self) -> &PackageName
sourcepub async fn archive(
self,
root_dir: impl AsRef<Path>,
out: impl Write
) -> Result<(), PackageManifestError>
pub async fn archive( self, root_dir: impl AsRef<Path>, out: impl Write ) -> Result<(), PackageManifestError>
Write a package archive into the out
file. The source files are relative to the root_dir
directory.
pub fn package_path(&self) -> PackagePath
pub fn repository(&self) -> Option<&str>
pub fn set_repository(&mut self, repository: Option<String>)
pub fn package_url(&self) -> Result<Option<UnpinnedAbsolutePackageUrl>>
sourcepub fn hash(&self) -> Hash
pub fn hash(&self) -> Hash
Returns the merkle root of the meta.far.
Panics
Panics if the PackageManifest is missing a “meta/” entry
sourcepub fn from_blobs_dir(
blobs_dir: &Path,
meta_far_hash: Hash,
out_manifest_dir: &Path
) -> Result<Self, PackageManifestError>
pub fn from_blobs_dir( blobs_dir: &Path, meta_far_hash: Hash, out_manifest_dir: &Path ) -> Result<Self, PackageManifestError>
Create a PackageManifest
and populate a manifest directory given a blobs directory and the top level meta.far hash.
The blobs_dir
directory must be a flat file that contains all the package blobs.
The out_manifest_dir
will be a flat file populated with JSON representations of PackageManifests
corresponding to the subpackages.
sourcepub fn from_archive(
archive_path: &Path,
blobs_dir: &Path,
out_manifest_dir: &Path
) -> Result<Self, PackageManifestError>
pub fn from_archive( archive_path: &Path, blobs_dir: &Path, out_manifest_dir: &Path ) -> Result<Self, PackageManifestError>
Extract the package blobs from archive_path
into the blobs_dir
directory and
extracts all the JSON representations of the subpackages’ PackageManifests and
top level PackageManifest into out_manifest_dir
.
Returns an in-memory PackageManifest
for these files.
pub fn try_load_from(manifest_path: impl AsRef<Utf8Path>) -> Result<Self>
pub fn from_reader( manifest_path: impl AsRef<Utf8Path>, reader: impl Read ) -> Result<Self>
pub fn write_with_relative_paths( self, path: impl AsRef<Utf8Path> ) -> Result<Self>
Trait Implementations§
source§impl Clone for PackageManifest
impl Clone for PackageManifest
source§fn clone(&self) -> PackageManifest
fn clone(&self) -> PackageManifest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PackageManifest
impl Debug for PackageManifest
source§impl PartialEq for PackageManifest
impl PartialEq for PackageManifest
source§fn eq(&self, other: &PackageManifest) -> bool
fn eq(&self, other: &PackageManifest) -> bool
self
and other
values to be equal, and is used
by ==
.