[][src]Function sliderule::get_level

pub fn get_level(target_dir: &Path) -> u8

Figures out and returns what depth within another component's hierarchy the component is at. 0 = A top level component is probably being created 1 = A top level component with no parent 2 = A sub-component at depth n

target_dir must be a valid Sliderule component directory.

Examples


let level = sliderule::get_level(&test_dir.join("components").join("level1"));

assert_eq!(0, level)