pub struct Package { /* private fields */ }Expand description
A package generated by a PackageBuilder, suitable for assembling into a TUF repository.
Implementations§
Source§impl Package
impl Package
Sourcepub fn name(&self) -> &PackageName
pub fn name(&self) -> &PackageName
The name of the package.
Sourcepub fn fuchsia_url(&self) -> PinnedAbsolutePackageUrl
pub fn fuchsia_url(&self) -> PinnedAbsolutePackageUrl
The pinned fuchsia-pkg url of the package on fuchsia.com.
Sourcepub fn artifacts(&self) -> &Utf8Path
pub fn artifacts(&self) -> &Utf8Path
The directory containing the blobs contained in the package, including the meta.far.
Sourcepub async fn identity() -> Result<Self, Error>
pub async fn identity() -> Result<Self, Error>
Builds and returns the package located at “/pkg” in the current namespace.
Sourcepub async fn from_dir(root: impl AsRef<Path>) -> Result<Self, Error>
pub async fn from_dir(root: impl AsRef<Path>) -> Result<Self, Error>
Builds and returns the package located at the given path in the current namespace.
Sourcepub fn meta_contents(&self) -> Result<MetaContents, Error>
pub fn meta_contents(&self) -> Result<MetaContents, Error>
Returns the parsed contents of the meta/contents file.
Sourcepub fn meta_subpackages(&self) -> Result<MetaSubpackages, Error>
pub fn meta_subpackages(&self) -> Result<MetaSubpackages, Error>
Returns the parsed contents of the subpackages manifest.
Sourcepub fn list_blobs(&self) -> BTreeSet<Hash>
pub fn list_blobs(&self) -> BTreeSet<Hash>
Returns a set of all unique blobs contained in this package, including meta.far and subpackage blobs.
§Panics
If either there are unknown subpackage blobs or there is an error reading meta/contents.
Sourcepub fn content_blob_files(&self) -> impl Iterator<Item = BlobFile>
pub fn content_blob_files(&self) -> impl Iterator<Item = BlobFile>
Returns an iterator of merkle/File pairs for each content blob in the package.
Does not include the meta.far, see meta_far() and meta_far_merkle_root(), instead.
Sourcepub fn contents(&self) -> (BlobContents, HashMap<Hash, Vec<u8>>)
pub fn contents(&self) -> (BlobContents, HashMap<Hash, Vec<u8>>)
Returns a tuple of the contents of the meta far and the contents of all content blobs in the package.
Sourcepub fn content_and_subpackage_blobs(&self) -> Option<HashMap<Hash, Vec<u8>>>
pub fn content_and_subpackage_blobs(&self) -> Option<HashMap<Hash, Vec<u8>>>
Returns None if this Package has subpackages but doesn’t have the blobs.
Sourcepub async fn write_to_blobfs_ignore_subpackages(
&self,
blobfs_ramdisk: &BlobfsRamdisk,
)
pub async fn write_to_blobfs_ignore_subpackages( &self, blobfs_ramdisk: &BlobfsRamdisk, )
Writes the meta.far and all content blobs to blobfs. Does not write the subpackage blobs, if any.
Sourcepub async fn write_to_blobfs(&self, blobfs_ramdisk: &BlobfsRamdisk)
pub async fn write_to_blobfs(&self, blobfs_ramdisk: &BlobfsRamdisk)
Writes the meta.far and all content and subpackage blobs to blobfs.
Sourcepub async fn verify_contents(
&self,
dir: &DirectoryProxy,
) -> Result<(), VerificationError>
pub async fn verify_contents( &self, dir: &DirectoryProxy, ) -> Result<(), VerificationError>
Verifies that the given directory serves the contents of this package.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more