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

Function insert_node

src/entities/collections.rs:803–819  ·  view source on GitHub ↗
(
    nodes: &mut Vec<CollectionNode>,
    parent_folder_id: Option<Uuid>,
    node: CollectionNode,
)

Source from the content-addressed store, hash-verified

801 node_id: Uuid,
802 ) -> Vec<CollectionDestinationEntry> {
803 self.destination_entries()
804 .into_iter()
805 .filter(|entry| {
806 if entry.destination.collection_id != source_collection_id {
807 return true;
808 }
809
810 match entry.destination.folder_id {
811 Some(folder_id) if folder_id == node_id => false,
812 Some(folder_id) => self
813 .get_node(source_collection_id, node_id)
814 .map(|node| !node.contains_node(folder_id))
815 .unwrap_or(false),
816 None => true,
817 }
818 })
819 .collect()
820 }
821
822 pub fn is_empty(&self) -> bool {

Callers 3

create_folderMethod · 0.85
add_request_nodeMethod · 0.85

Calls 1

find_folder_mutFunction · 0.85

Tested by

no test coverage detected