From e5a38bab67f790803ff98484fc5835adba7bf62a Mon Sep 17 00:00:00 2001 From: diogo464 Date: Fri, 23 Sep 2022 13:45:57 +0100 Subject: rewrite --- src/config/mod.rs | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/config/mod.rs (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs new file mode 100644 index 0000000..98ba9fb --- /dev/null +++ b/src/config/mod.rs @@ -0,0 +1,97 @@ +mod parse; + +use std::path::Path; + +pub struct Config { + groups: Vec, +} + +pub struct Group { + includes: Vec, + links: Vec, + copies: Vec, +} + +pub struct IncludeAction { + group: String, +} + +pub struct LinkAction { + source: String, + target: String, +} + +pub struct CopyAction { + source: String, + target: String, +} + +pub fn parse(content: &str) -> std::io::Result { + todo!() +} + +pub fn parse_path(path: impl AsRef) -> std::io::Result { + todo!() +} + +pub fn format(content: &str) -> std::io::Result { + todo!() +} + +pub fn format_path(path: impl AsRef) -> std::io::Result { + todo!() +} + +pub fn format_inplace(path: impl AsRef) -> std::io::Result<()> { + todo!() +} + +impl Config { + pub fn groups(&self) -> impl Iterator { + std::iter::empty() + } + + pub fn group(&self, name: &str) -> Option<&Group> { + todo!() + } +} + +impl Group { + pub fn groups(&self) -> impl Iterator { + std::iter::empty() + } + + pub fn links(&self) -> impl Iterator { + std::iter::empty() + } + + pub fn copies(&self) -> impl Iterator { + std::iter::empty() + } +} + +impl IncludeAction { + pub fn name(&self) -> &str { + todo!() + } +} + +impl LinkAction { + pub fn source(&self) -> &str { + todo!() + } + + pub fn dest(&self) -> &str { + todo!() + } +} + +impl CopyAction { + pub fn source(&self) -> &str { + todo!() + } + + pub fn dest(&self) -> &str { + todo!() + } +} -- cgit