Struct fuchsia_pkg::package_directory::PackageDirectory
source · pub struct PackageDirectory { /* private fields */ }
Expand description
An open package directory
Implementations§
source§impl PackageDirectory
impl PackageDirectory
sourcepub fn from_proxy(proxy: DirectoryProxy) -> Self
pub fn from_proxy(proxy: DirectoryProxy) -> Self
Interprets the provided directory proxy as a package dir.
sourcepub fn create_request() -> Result<(Self, ServerEnd<DirectoryMarker>), Error>
pub fn create_request() -> Result<(Self, ServerEnd<DirectoryMarker>), Error>
Creates a new channel pair, returning the client end as Self and the server end as a channel.
sourcepub fn open_from_namespace() -> Result<Self, OpenError>
pub fn open_from_namespace() -> Result<Self, OpenError>
Returns the current component’s package directory.
sourcepub async fn close(self) -> Result<(), CloseError>
pub async fn close(self) -> Result<(), CloseError>
Cleanly close the package directory, consuming self.
sourcepub fn reopen(
&self,
dir_request: ServerEnd<DirectoryMarker>
) -> Result<(), CloneError>
pub fn reopen( &self, dir_request: ServerEnd<DirectoryMarker> ) -> Result<(), CloneError>
Send request to also serve this package directory on the given directory request.
sourcepub fn into_proxy(self) -> DirectoryProxy
pub fn into_proxy(self) -> DirectoryProxy
Unwraps the inner DirectoryProxy, consuming self.
sourcepub async fn open_file(
&self,
path: &str,
rights: OpenRights
) -> Result<FileProxy, OpenError>
pub async fn open_file( &self, path: &str, rights: OpenRights ) -> Result<FileProxy, OpenError>
Open the file in the package given by path
with the given access rights
.
sourcepub async fn merkle_root(&self) -> Result<Hash, ReadHashError>
pub async fn merkle_root(&self) -> Result<Hash, ReadHashError>
Reads the merkle root of the package.
sourcepub async fn meta_contents(&self) -> Result<MetaContents, LoadMetaContentsError>
pub async fn meta_contents(&self) -> Result<MetaContents, LoadMetaContentsError>
Reads and parses the package’s meta/contents file.
sourcepub async fn meta_package(&self) -> Result<MetaPackage, LoadMetaPackageError>
pub async fn meta_package(&self) -> Result<MetaPackage, LoadMetaPackageError>
Reads and parses the package’s meta/package file.
sourcepub async fn meta_subpackages(
&self
) -> Result<MetaSubpackages, LoadMetaSubpackagesError>
pub async fn meta_subpackages( &self ) -> Result<MetaSubpackages, LoadMetaSubpackagesError>
Reads and parses the package’s meta/fuchsia.pkg/subpackages file. If the file
doesn’t exist, an empty MetaSubpackages
is returned.
sourcepub async fn abi_revision(&self) -> Result<AbiRevision, LoadAbiRevisionError>
pub async fn abi_revision(&self) -> Result<AbiRevision, LoadAbiRevisionError>
Reads and parses the package’s meta/fuchsia.abi/abi-revision file.
Trait Implementations§
source§impl Clone for PackageDirectory
impl Clone for PackageDirectory
source§fn clone(&self) -> PackageDirectory
fn clone(&self) -> PackageDirectory
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more