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)
| 403 | /// orphaned. A view with children cannot be deleted without first |
| 404 | /// reparenting or deleting its children. |
| 405 | fn get_children_views(&self, parent_id: u64) -> Result<Vec<ViewState>, PristineError> { |
| 406 | // Default implementation: scan all views and filter by parent. |
| 407 | // View counts are typically small (<100), so this is fine. |
| 408 | let names = self.list_views()?; |
| 409 | let mut children = Vec::new(); |
| 410 | for name in names { |
| 411 | if let Some(view) = self.get_view(&name)? { |
| 412 | if view.parent == Some(parent_id) { |
| 413 | children.push(view); |
| 414 | } |
| 415 | } |
| 416 | } |
| 417 | Ok(children) |
| 418 | } |
| 419 | |
| 420 | /// Read the persisted conflicts for a file (`inode`) on a view. |
| 421 | /// |
nothing calls this directly
no test coverage detected