canic-backup 0.92.1

Manifest and orchestration primitives for Canic deployment backup and restore
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::discovery::SnapshotTarget;

pub(super) fn target_role(
    selected_canister: &str,
    index: usize,
    target: &SnapshotTarget,
) -> String {
    target.role.clone().unwrap_or_else(|| {
        if target.canister_id == selected_canister {
            "root".to_string()
        } else {
            format!("member-{index}")
        }
    })
}