Type Alias StaticPackages

Source
pub type StaticPackages = PathHashMapping<Static>;

Aliased Type§

struct StaticPackages { /* private fields */ }

Implementations

Source§

impl<T> PathHashMapping<T>

Source

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.

Source

pub fn contents(&self) -> impl ExactSizeIterator<Item = &(PackagePath, Hash)>

Iterator over the contents of the mapping.

Source

pub fn into_contents(self) -> impl ExactSizeIterator<Item = (PackagePath, Hash)>

Iterator over the contents of the mapping, consuming self.

Source

pub fn hashes(&self) -> impl Iterator<Item = &Hash>

Iterator over the contained hashes.

Source

pub fn hash_for_package(&self, path: &PackagePath) -> Option<Hash>

Get the hash for a package.

Source

pub fn from_entries(entries: Vec<(PackagePath, Hash)>) -> Self

Create a PathHashMapping from a Vec of (PackagePath, Hash) pairs.

Source

pub fn serialize(&self, writer: impl Write) -> Result<(), PathHashMappingError>

Write a static_packages or cache_packages file.

Trait Implementations

Source§

impl<T: Debug> Debug for PathHashMapping<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: PartialEq> PartialEq for PathHashMapping<T>

Source§

fn eq(&self, other: &PathHashMapping<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Eq> Eq for PathHashMapping<T>

Source§

impl<T> StructuralPartialEq for PathHashMapping<T>