pub type StaticPackages = PathHashMapping<Static>;
Aliased Type§
struct StaticPackages { /* private fields */ }
Implementations
Source§impl<T> PathHashMapping<T>
impl<T> PathHashMapping<T>
Sourcepub fn deserialize(reader: impl Read) -> Result<Self, PathHashMappingError>
pub fn deserialize(reader: impl Read) -> Result<Self, PathHashMappingError>
Reads the line-oriented “package-path=hash” static_packages or cache_packages file. Validates the package paths and hashes.
Sourcepub fn contents(&self) -> impl ExactSizeIterator<Item = &(PackagePath, Hash)>
pub fn contents(&self) -> impl ExactSizeIterator<Item = &(PackagePath, Hash)>
Iterator over the contents of the mapping.
Sourcepub fn into_contents(self) -> impl ExactSizeIterator<Item = (PackagePath, Hash)>
pub fn into_contents(self) -> impl ExactSizeIterator<Item = (PackagePath, Hash)>
Iterator over the contents of the mapping, consuming self.
Sourcepub fn hash_for_package(&self, path: &PackagePath) -> Option<Hash>
pub fn hash_for_package(&self, path: &PackagePath) -> Option<Hash>
Get the hash for a package.
Sourcepub fn from_entries(entries: Vec<(PackagePath, Hash)>) -> Self
pub fn from_entries(entries: Vec<(PackagePath, Hash)>) -> Self
Create a PathHashMapping
from a Vec
of (PackagePath, Hash)
pairs.