MCPcopy Create free account
hub / github.com/bajrangCoder/setu / find_node

Function find_node

src/entities/collections.rs:752–766  ·  view source on GitHub ↗
(nodes: &[CollectionNode], node_id: Uuid)

Source from the content-addressed store, hash-verified

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)

Callers 2

get_nodeMethod · 0.85

Calls 2

idMethod · 0.80
folderMethod · 0.80

Tested by

no test coverage detected