(path: &str, scope: &str)
| 3238 | |
| 3239 | Self { |
| 3240 | node_indices, |
| 3241 | children, |
| 3242 | roots, |
| 3243 | } |
| 3244 | } |
| 3245 | |
| 3246 | pub fn node<'a>(&self, doc: &'a SceneDoc, key: u32) -> Option<&'a SceneNodeEntry> { |
| 3247 | self.node_indices |
| 3248 | .binary_search_by_key(&key, |(item_key, _)| *item_key) |
| 3249 | .ok() |
| 3250 | .map(|pos| self.node_indices[pos].1) |
| 3251 | .and_then(|idx| doc.scene.nodes.get(idx)) |
| 3252 | } |
| 3253 | |
| 3254 | pub fn child_keys(&self, key: u32) -> &[u32] { |
| 3255 | let Ok(pos) = self |