summaryrefslogtreecommitdiff
path: root/src/loading/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-01 12:46:01 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-01 12:55:07 +0200
commit7218892c722ca583297c0ebbda350bdf6f16d3ce (patch)
tree27ebbfaf0662c1e0dd01e7c5e9e360ab288cae4d /src/loading/mod.rs
parent9bdb0bdeffa5e4b6da9e3f6d3c1b79c506005fc5 (diff)
Refactor path handling
Diffstat (limited to 'src/loading/mod.rs')
-rw-r--r--src/loading/mod.rs14
1 files changed, 13 insertions, 1 deletions
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;