diff options
author | Nadrieril | 2019-03-24 16:25:37 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-24 16:25:37 +0100 |
commit | 8bae9a8fab523668e9aea96e4f32cec21e22998a (patch) | |
tree | 09763096bd270981978152226f9b780dbd22153b /dhall_core/src/import.rs | |
parent | 6c1a739687f706cf6630c55f8d53c92aacaf6e3d (diff) |
Parser import hash and headers
Diffstat (limited to 'dhall_core/src/import.rs')
-rw-r--r-- | dhall_core/src/import.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/dhall_core/src/import.rs b/dhall_core/src/import.rs index 21bd370..f039953 100644 --- a/dhall_core/src/import.rs +++ b/dhall_core/src/import.rs @@ -28,7 +28,7 @@ pub struct URL { pub authority: String, pub path: PathBuf, pub query: Option<String>, - // pub headers: Option<ImportHashed>, + pub headers: Option<Box<ImportHashed>>, } #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -44,11 +44,21 @@ pub enum ImportMode { RawText, } +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Hash { + pub protocol: String, + pub hash: String, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ImportHashed { + pub location: ImportLocation, + pub hash: Option<Hash>, +} + /// Reference to an external resource #[derive(Debug, Clone, PartialEq, Eq)] pub struct Import { pub mode: ImportMode, - pub location: ImportLocation, - // TODO - pub hash: Option<()>, + pub location_hashed: ImportHashed, } |