Struct system_image::PathHashMapping
source · 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 Iterator<Item = &(PackagePath, Hash)> + ExactSizeIterator
pub fn contents( &self ) -> impl Iterator<Item = &(PackagePath, Hash)> + ExactSizeIterator
Iterator over the contents of the mapping.
sourcepub fn into_contents(
self
) -> impl Iterator<Item = (PackagePath, Hash)> + ExactSizeIterator
pub fn into_contents( self ) -> impl Iterator<Item = (PackagePath, Hash)> + ExactSizeIterator
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>
source§fn eq(&self, other: &PathHashMapping<T>) -> bool
fn eq(&self, other: &PathHashMapping<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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