From 7218892c722ca583297c0ebbda350bdf6f16d3ce Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 1 Jun 2021 12:46:01 +0200 Subject: Refactor path handling --- src/loading/mod.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/loading/mod.rs') diff --git a/src/loading/mod.rs b/src/loading/mod.rs index f57b5c73..0e171796 100644 --- a/src/loading/mod.rs +++ b/src/loading/mod.rs @@ -36,7 +36,19 @@ pub trait Loader { /// /// Should be the same for all paths pointing to the same file. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] -pub struct FileHash(pub u64); +pub struct FileHash(u64); + +impl FileHash { + /// Create an file hash from a raw hash value. + pub fn from_raw(v: u64) -> Self { + Self(v) + } + + /// Convert into the raw underlying hash value. + pub fn into_raw(self) -> u64 { + self.0 + } +} /// A loader which serves nothing. pub struct BlankLoader; -- cgit v1.2.3