// Removes a node, and all of its children
Removes a node, and all of its children
Removes a node and all of its children
pub fn remove_node(&mut self, id: NodeId) {
        if !self.is_valid_id(id) {
            return;
        }
        if let Some(parent) = self.parents[id.index()] {
            self.children[parent.index()].retain(|child| *child != id);
        }
        self.geometries.remove(id.arena_index());
        self.layouts[id.index()] = NodeLayout::default();
        self.parents[id.index()] = None;
        self.renderers[id.index()] = Box::new(EmptyRenderer);
        self.handlers[id.index()] = Box::new(EmptyNodeHandler);
        self.updaters[id.index()] = None;
        self.states.states[id.index()] = None;
        std::mem::replace(&mut self.children[id.index()], Vec::with_capacity(0))
            .iter()
            .for_each(|child| self.remove_node(*child));
    }
pub fn remove_node ( & mut self , id : NodeId ) { if ! self . is_valid_id ( id ) { return ; } if let Some ( parent ) = self . parents [ id . index ( ) ] { self . children [ parent . index ( ) ] . retain ( | child | * child != id ) ; } self . geometries . remove ( id . arena_index ( ) ) ; self . layouts [ id . index ( ) ] = NodeLayout :: default ( ) ; self . parents [ id . index ( ) ] = None ; self . renderers [ id . index ( ) ] = Box :: new ( EmptyRenderer ) ; self . handlers [ id . index ( ) ] = Box :: new ( EmptyNodeHandler ) ; self . updaters [ id . index ( ) ] = None ; self . states . states [ id . index ( ) ] = None ; std :: mem :: replace ( & mut self . children [ id . index ( ) ] , Vec :: with_capacity ( 0 ) ) . iter ( ) . for_each ( | child | self . remove_node ( * child ) ) ; }
Removes a node, and all of its children
Removes a node and all of its children
&mut self
id
NodeId