Find all views that have the given view as their parent. Used during view deletion to check for child views that would be orphaned. A view with children cannot be deleted without first reparenting or deleting its children.
(&self, parent_id: u64)
| 351 | /// orphaned. A view with children cannot be deleted without first |
| 352 | /// reparenting or deleting its children. |
| 353 | fn get_children_views(&self, parent_id: u64) -> Result<Vec<ViewState>, PristineError> { |
| 354 | // Default implementation: scan all views and filter by parent. |
| 355 | // View counts are typically small (<100), so this is fine. |
| 356 | let names = self.list_views()?; |
| 357 | let mut children = Vec::new(); |
| 358 | for name in names { |
| 359 | if let Some(view) = self.get_view(&name)? { |
| 360 | if view.parent == Some(parent_id) { |
| 361 | children.push(view); |
| 362 | } |
| 363 | } |
| 364 | } |
| 365 | Ok(children) |
| 366 | } |
| 367 | |
| 368 | /// Get a view by name. |
| 369 | fn get_view(&self, name: &str) -> Result<Option<ViewState>, PristineError>; |
nothing calls this directly
no test coverage detected