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 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)