#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Options {
top_level: String,
sections: Vec<String>,
}
impl Options {
pub fn new() -> Self {
Self::default()
}
pub fn with_top_level(top_level: impl Into<String>) -> Self {
Self {
top_level: top_level.into(),
sections: Vec::new(),
}
}
pub fn top_level(&self) -> &str {
&self.top_level
}
pub fn set_top_level(&mut self, top_level: impl Into<String>) -> &mut Self {
self.top_level = top_level.into();
self
}
pub fn sections(&self) -> &[String] {
&self.sections
}
pub fn add_section(&mut self, section: impl Into<String>) -> &mut Self {
self.sections.push(section.into());
self
}
pub fn set_sections(&mut self, sections: Vec<String>) -> &mut Self {
self.sections = sections;
self
}
}