From 8bae9a8fab523668e9aea96e4f32cec21e22998a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 24 Mar 2019 16:25:37 +0100 Subject: Parser import hash and headers --- dhall_core/src/import.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'dhall_core/src/import.rs') 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, - // pub headers: Option, + pub headers: Option>, } #[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, +} + /// 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, } -- cgit v1.2.3