diff --git a/src/module/helpers/mod.rs b/src/module/helpers/mod.rs index 8b501b4a..f260114b 100644 --- a/src/module/helpers/mod.rs +++ b/src/module/helpers/mod.rs @@ -1,17 +1,39 @@ +/*! + * Utility helpers for modules + */ + pub mod header; pub mod utils; +/** + * Helpers for header specs + */ pub mod spec { use storage::file::header::spec::FileHeaderSpec as FHS; + /** + * Helper to get a spec for a Key-Value for a named text: + * + * { '': "" } + */ pub fn named_text(name: &str) -> FHS { FHS::Key { name: String::from(name), value_type: Box::new(FHS::Text) } } + /** + * Helper to get a spec for a Key-Value for a named array: + * + * { '': [ "", ...] } + */ pub fn named_text_array(name: &str) -> FHS { FHS::Key { name: String::from(name), value_type: Box::new(text_array()) } } + /** + * Helper to get a spec for Array: + * + * [ "", ...] + */ pub fn text_array() -> FHS { FHS::Array { allowed_types: vec![FHS::Text] } }