add docstrings

This commit is contained in:
steven-omaha
2023-02-23 16:56:15 +01:00
parent c700784d52
commit d409e9d411
6 changed files with 26 additions and 2 deletions
+3
View File
@@ -137,6 +137,9 @@ impl Group {
})
}
/// Add the new `packages` to the group file under the section `section_header`. If
/// the section header does not yet exist, it is created. The packages are written
/// in the provided order immediately after the header.
pub(crate) fn save_packages(&self, section_header: &str, packages: &[Package]) -> Result<()> {
let mut content = read_to_string(&self.path)
.with_context(|| format!("reading existing file contents from {:?}", &self.path))?;
+10
View File
@@ -1,3 +1,13 @@
/*!
This module reflects the relationship between groups, sections / backends and
packages.
A ['Group'] contains one (strictly spoken zero, but this doesn't make sense) or
more ['Section']s, which relate to individual backends. Each section contains
one (strictly spoken zero) or more ['Package']s. On start-up `pacdef` will load
all groups using ['Group::load'], which in turn will get all packages from all
sections.
*/
mod group;
mod package;
mod section;