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 read_file(&self, path: &str) -> Result<Vec<u8>, ReadError>
pub async fn read_file(&self, path: &str) -> Result<Vec<u8>, ReadError>
Read the file in the package given by path
, and return its contents.
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 moreAuto Trait Implementations§
impl Freeze for PackageDirectory
impl !RefUnwindSafe for PackageDirectory
impl Send for PackageDirectory
impl Sync for PackageDirectory
impl Unpin for PackageDirectory
impl !UnwindSafe for PackageDirectory
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
)