1
0
Fork 0
mirror of https://git.sr.ht/~nixgoat/vento synced 2025-11-30 08:27:17 +00:00

src: Add public documentation for remaining functions

Essentially the documentation that will go into docs.rs.
This commit is contained in:
Lux Aliaga 2023-02-19 18:22:11 -03:00
parent 27b42e963e
commit 0424ec2ba9
Signed by: lux
GPG key ID: B56C805968637437
2 changed files with 5 additions and 0 deletions

View file

@ -25,6 +25,7 @@ use tar::Archive;
use xz2::read::XzDecoder;
use xz2::write::XzEncoder;
/// Exports an inventory slot into an xz tarball
pub fn export_inv(slot: &str, output: PathBuf, message: bool) -> Result<()> {
let slotdir: PathBuf = match slot {
"active" | "a" => common::env_config()?.active_dir,
@ -54,6 +55,7 @@ pub fn export_inv(slot: &str, output: PathBuf, message: bool) -> Result<()> {
Ok(())
}
/// Exports the Vento directory into an xz tarball
pub fn export_dir(output: PathBuf, message: bool) -> Result<()> {
let dir: PathBuf = common::env_config()?.vento_dir;
@ -72,6 +74,7 @@ pub fn export_dir(output: PathBuf, message: bool) -> Result<()> {
Ok(())
}
/// Imports an xz tarball into an inventory slot
pub fn import_inv(input: PathBuf, slot: &str, message: bool) -> Result<()> {
let slotdir: PathBuf = match slot {
"active" | "a" => common::env_config()?.active_dir,
@ -102,6 +105,7 @@ pub fn import_inv(input: PathBuf, slot: &str, message: bool) -> Result<()> {
Ok(())
}
/// Imports an xz tarball into the Vento directory
pub fn import_dir(input: PathBuf, message: bool) -> Result<()> {
let dir: PathBuf = common::env_config()?.vento_dir;

View file

@ -35,6 +35,7 @@ pub enum ErrorType {
NoFileOrDir,
}
/// Displays an error and exits
pub fn throw_error(error: ErrorType) -> Result<()> {
bail!(
"{}",