derive_volume_file_path

Function derive_volume_file_path 

Source
pub fn derive_volume_file_path(
    root: &Path,
    sc_name: &SclName,
    vol_name: &SclName,
) -> PathBuf
Expand description

Returns the path where a volume file should be stored.

Controllers interacting with the volume file must ensure a common understanding about root.

use crate::scl_lib::api_objects::{SclName, Volume, derive_volume_file_path};
use std::path::Path;

let root = Path::new("/tmp/scl");
let sc_name = SclName::try_from("sc01".to_string()).unwrap();
let vol_name =  SclName::try_from("vol01".to_string()).unwrap();
assert_eq!(derive_volume_file_path(&root, &sc_name, &vol_name), Path::new("/tmp/scl/sc01/volumes/vol01"));