pub struct PathHashMapping<T> { /* private fields */ }
Expand description
A PathHashMapping
reads and writes line-oriented “{package_path}={hash}\n” files, e.g.
“data/static_packages”.
Deprecated.
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.
Trait Implementations§
Source§impl<T: Debug> Debug for PathHashMapping<T>
impl<T: Debug> Debug for PathHashMapping<T>
Source§impl<T: PartialEq> PartialEq for PathHashMapping<T>
impl<T: PartialEq> PartialEq for PathHashMapping<T>
impl<T: Eq> Eq for PathHashMapping<T>
impl<T> StructuralPartialEq for PathHashMapping<T>
Auto Trait Implementations§
impl<T> Freeze for PathHashMapping<T>
impl<T> RefUnwindSafe for PathHashMapping<T>where
T: RefUnwindSafe,
impl<T> Send for PathHashMapping<T>where
T: Send,
impl<T> Sync for PathHashMapping<T>where
T: Sync,
impl<T> Unpin for PathHashMapping<T>where
T: Unpin,
impl<T> UnwindSafe for PathHashMapping<T>where
T: UnwindSafe,
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