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
pub fn delivery_blob_type(&self) -> Option<DeliveryBlobType>
Sourcepub fn from_blobs_dir(
blobs_dir_root: &Path,
delivery_blob_type: Option<DeliveryBlobType>,
meta_far_hash: Hash,
out_manifest_dir: &Path,
) -> Result<Self, PackageManifestError>
pub fn from_blobs_dir( blobs_dir_root: &Path, delivery_blob_type: Option<DeliveryBlobType>, 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_root
directory must contain all the package blobs either uncompressed in
root, or delivery blobs in a sub directory.
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§impl Serialize for PackageManifest
impl Serialize for PackageManifest
impl Eq for PackageManifest
impl StructuralPartialEq for PackageManifest
Auto Trait Implementations§
impl Freeze for PackageManifest
impl RefUnwindSafe for PackageManifest
impl Send for PackageManifest
impl Sync for PackageManifest
impl Unpin for PackageManifest
impl UnwindSafe for PackageManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)