diff --git a/src/storage/json/parser.rs b/src/storage/json/parser.rs index c752e20a..7011b6c2 100644 --- a/src/storage/json/parser.rs +++ b/src/storage/json/parser.rs @@ -1,5 +1,7 @@ use std::collections::HashMap; use std::error::Error; +use std::fmt::{Debug, Display, Formatter}; +use std::fmt; use serde_json::{Value, from_str}; use serde_json::error::Result as R; @@ -25,6 +27,24 @@ impl JsonHeaderParser { } +impl Display for JsonHeaderParser { + + fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { + write!(fmt, "JsonHeaderParser"); + Ok(()) + } + +} + +impl Debug for JsonHeaderParser { + + fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { + write!(fmt, "JsonHeaderParser, Spec: {:?}", self.spec); + Ok(()) + } + +} + impl FileHeaderParser for JsonHeaderParser { fn read(&self, string: Option) diff --git a/src/storage/parser.rs b/src/storage/parser.rs index c627e56a..8afb0d9c 100644 --- a/src/storage/parser.rs +++ b/src/storage/parser.rs @@ -83,7 +83,7 @@ impl Display for ParserError { } -pub trait FileHeaderParser : Sized { +pub trait FileHeaderParser : Sized + Debug + Display { fn read(&self, string: Option) -> Result; fn write(&self, data: &FileHeaderData) -> Result; }