Struct fidl_fuchsia_pkg_ext::cache::Client
source · pub struct Client { /* private fields */ }
Expand description
An open connection to a provider of the fuchsia.pkg.PackageCache
.
Implementations§
source§impl Client
impl Client
sourcepub fn from_proxy(proxy: PackageCacheProxy) -> Self
pub fn from_proxy(proxy: PackageCacheProxy) -> Self
Constructs a client from the given proxy.
sourcepub fn proxy(&self) -> &PackageCacheProxy
pub fn proxy(&self) -> &PackageCacheProxy
Returns a reference to the underlying PackageCacheProxy connection.
sourcepub fn get(
&self,
meta_far_blob: BlobInfo,
gc_protection: GcProtection,
) -> Result<Get, Error>
pub fn get( &self, meta_far_blob: BlobInfo, gc_protection: GcProtection, ) -> Result<Get, Error>
Opens the package specified by meta_far_blob
with the intent to fetch any missing blobs
using the returned Get
type if needed.
sourcepub async fn get_already_cached(
&self,
meta_far_blob: BlobId,
) -> Result<PackageDirectory, GetAlreadyCachedError>
pub async fn get_already_cached( &self, meta_far_blob: BlobId, ) -> Result<PackageDirectory, GetAlreadyCachedError>
Uses PackageCache.Get to obtain the package directory of a package that is already cached (all blobs are already in blobfs). Errors if the package is not already cached. Always uses open package tracking GC protection, because OTA (the only client of Retained GC protection), should never need to get an already cached package.
Compared to get_cached
:
- Activates
meta_far_blob
in the dynamic index - Must not be called concurrently with the same
meta_far_blob
sourcepub async fn get_subpackage(
&self,
superpackage: BlobId,
subpackage: &RelativePackageUrl,
) -> Result<PackageDirectory, GetSubpackageError>
pub async fn get_subpackage( &self, superpackage: BlobId, subpackage: &RelativePackageUrl, ) -> Result<PackageDirectory, GetSubpackageError>
Uses PackageCache.GetSubpackage to obtain the package directory of a subpackage. Errors if there is not an open connection to the superpackage.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
)