获取调用链(递归)
(&self, function_id: &Uuid, max_depth: usize)
| 109 | |
| 110 | /// 获取调用链(递归) |
| 111 | pub fn get_call_chain(&self, function_id: &Uuid, max_depth: usize) -> Vec<Vec<Uuid>> { |
| 112 | let mut chains = Vec::new(); |
| 113 | let mut visited = HashSet::new(); |
| 114 | self._get_call_chain_recursive(function_id, &mut chains, &mut visited, 0, max_depth); |
| 115 | |
| 116 | // 如果没有找到任何调用链,至少返回包含函数本身的链 |
| 117 | if chains.is_empty() { |
| 118 | chains.push(vec![*function_id]); |
| 119 | } |
| 120 | |
| 121 | chains |
| 122 | } |
| 123 | |
| 124 | fn _get_call_chain_recursive( |
| 125 | &self, |
no test coverage detected