(nodes: &[CollectionNode], node_id: Uuid)
| 750 | |
| 751 | pub fn get_collection(&self, id: Uuid) -> Option<&Collection> { |
| 752 | self.collections.iter().find(|c| c.id == id) |
| 753 | } |
| 754 | |
| 755 | pub fn get_collection_mut(&mut self, id: Uuid) -> Option<&mut Collection> { |
| 756 | self.collections.iter_mut().find(|c| c.id == id) |
| 757 | } |
| 758 | |
| 759 | pub fn get_node(&self, collection_id: Uuid, node_id: Uuid) -> Option<&CollectionNode> { |
| 760 | self.get_collection(collection_id) |
| 761 | .and_then(|collection| find_node(&collection.nodes, node_id)) |
| 762 | } |
| 763 | |
| 764 | pub fn get_request_node( |
| 765 | &self, |
| 766 | collection_id: Uuid, |
| 767 | node_id: Uuid, |
| 768 | ) -> Option<&CollectionRequestNode> { |
| 769 | self.get_node(collection_id, node_id) |
no test coverage detected