fn node_ownership_set(&self, obj: &Self::Id) -> HashSet<Self::Id> {
        let mut visit_set = HashSet::new();
        let mut final_set = HashSet::new();
        if self.contains_node(obj) {
            visit_set.insert(obj.clone());
            final_set.insert(obj.clone());
        }
        while !visit_set.is_empty() {
            let mut wait_set = HashSet::new();
            for obj in visit_set.iter() {
                let children =
                    self.node(&obj).map(|x| x.children()).unwrap_or_default();
                let set: Vec<Self::Id> = children
                    .into_iter()
                    .filter_map(|id| {
                        self.node(&id)
                            .map(|node| {
                                if node.parent() == Some(obj.clone()) {
                                    Some(id)
                                } else {
                                    None
                                }
                            })
                            .flatten()
                    })
                    .collect();
                wait_set.extend(set);
            }
            final_set.extend(wait_set.iter().cloned());
            visit_set.clear();
            visit_set.extend(wait_set);
        }
        final_set
    }
/// returns all the nodes owned by a node, including itself
returns all the nodes owned by a node, including itself
returns all the nodes owned by a node including itself
fn node_ownership_set(&self, obj: &Self::Id) -> HashSet<Self::Id> {
        let mut visit_set = HashSet::new();
        let mut final_set = HashSet::new();
        if self.contains_node(obj) {
            visit_set.insert(obj.clone());
            final_set.insert(obj.clone());
        }
        while !visit_set.is_empty() {
            let mut wait_set = HashSet::new();
            for obj in visit_set.iter() {
                let children =
                    self.node(&obj).map(|x| x.children()).unwrap_or_default();
                let set: Vec<Self::Id> = children
                    .into_iter()
                    .filter_map(|id| {
                        self.node(&id)
                            .map(|node| {
                                if node.parent() == Some(obj.clone()) {
                                    Some(id)
                                } else {
                                    None
                                }
                            })
                            .flatten()
                    })
                    .collect();
                wait_set.extend(set);
            }
            final_set.extend(wait_set.iter().cloned());
            visit_set.clear();
            visit_set.extend(wait_set);
        }
        final_set
    }
fn node_ownership_set ( & self , obj : & Self :: Id ) -> HashSet < Self :: Id > { let mut visit_set = HashSet :: new ( ) ; let mut final_set = HashSet :: new ( ) ; if self . contains_node ( obj ) { visit_set . insert ( obj . clone ( ) ) ; final_set . insert ( obj . clone ( ) ) ; } while ! visit_set . is_empty ( ) { let mut wait_set = HashSet :: new ( ) ; for obj in visit_set . iter ( ) { let children = self . node ( & obj ) . map ( | x | x . children ( ) ) . unwrap_or_default ( ) ; let set : Vec < Self :: Id > = children . into_iter ( ) . filter_map ( | id | { self . node ( & id ) . map ( | node | { if node . parent ( ) == Some ( obj . clone ( ) ) { Some ( id ) } else { None } } ) . flatten ( ) } ) . collect ( ) ; wait_set . extend ( set ) ; } final_set . extend ( wait_set . iter ( ) . cloned ( ) ) ; visit_set . clear ( ) ; visit_set . extend ( wait_set ) ; } final_set }
returns all the nodes owned by a node, including itself
returns all the nodes owned by a node including itself
&self
obj
&Self::Id
&self
obj
&Self::Id