pub fn extract_child_index(condition_type: &str) -> Option<usize>Expand description
Extract the index from a child condition type.
§Arguments
condition_type- A condition type like “Bind9Instance-0” or “Pod-2”
§Returns
The index as Option<usize>, or None if the format is invalid.
§Example
use bindy::status_reasons::extract_child_index;
assert_eq!(extract_child_index("Bind9Instance-0"), Some(0));
assert_eq!(extract_child_index("Pod-5"), Some(5));
assert_eq!(extract_child_index("Ready"), None);
assert_eq!(extract_child_index("Invalid-Format"), None);