pub struct BasePackageIndex { /* private fields */ }
Expand description
Represents the set of base packages.
Implementations§
Source§impl BasePackageIndex
impl BasePackageIndex
Sourcepub async fn from_proxy(cache: &PackageCacheProxy) -> Result<Self, Error>
pub async fn from_proxy(cache: &PackageCacheProxy) -> Result<Self, Error>
Creates a BasePackageIndex
from a PackageCache proxy.
Sourcepub fn is_unpinned_base_package(
&self,
pkg_url: &AbsolutePackageUrl,
) -> Option<BlobId>
pub fn is_unpinned_base_package( &self, pkg_url: &AbsolutePackageUrl, ) -> Option<BlobId>
Returns the package’s hash if the url is unpinned and refers to a base package, otherwise returns None.
Sourcepub fn create_mock(index: HashMap<UnpinnedAbsolutePackageUrl, BlobId>) -> Self
pub fn create_mock(index: HashMap<UnpinnedAbsolutePackageUrl, BlobId>) -> Self
Creates a BasePackageIndex backed only by the supplied HashMap
. This
is useful for testing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BasePackageIndex
impl RefUnwindSafe for BasePackageIndex
impl Send for BasePackageIndex
impl Sync for BasePackageIndex
impl Unpin for BasePackageIndex
impl UnwindSafe for BasePackageIndex
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
Mutably borrows from an owned value. Read more