fn detach(
        &mut self,
        obj: &Self::Id,
        owner: &Self::Id,
    ) -> Result<(), FlowError> {
        if !self.contains_node(obj) {
            Err(FlowError::NotExistObj)?
        }
        let res = self
            .node_mut(owner)
            .map(|owner| {
                if !owner.children().contains(obj) {
                    Err(FlowError::AbandonedChild)?
                }
                owner.children_ref_mut().retain(|x| x != obj);
                Ok(())
            })
            .unwrap_or(Err(FlowError::NotExistOwner));
        self.check_assert();
        res
    }
/// detaches a node from a non-owner link
detaches a node from a non-owner link
detaches a node from a non - owner link
fn detach(
        &mut self,
        obj: &Self::Id,
        owner: &Self::Id,
    ) -> Result<(), FlowError> {
        if !self.contains_node(obj) {
            Err(FlowError::NotExistObj)?
        }
        let res = self
            .node_mut(owner)
            .map(|owner| {
                if !owner.children().contains(obj) {
                    Err(FlowError::AbandonedChild)?
                }
                owner.children_ref_mut().retain(|x| x != obj);
                Ok(())
            })
            .unwrap_or(Err(FlowError::NotExistOwner));
        self.check_assert();
        res
    }
fn detach ( & mut self , obj : & Self :: Id , owner : & Self :: Id , ) -> Result < ( ) , FlowError > { if ! self . contains_node ( obj ) { Err ( FlowError :: NotExistObj ) ? } let res = self . node_mut ( owner ) . map ( | owner | { if ! owner . children ( ) . contains ( obj ) { Err ( FlowError :: AbandonedChild ) ? } owner . children_ref_mut ( ) . retain ( | x | x != obj ) ; Ok ( ( ) ) } ) . unwrap_or ( Err ( FlowError :: NotExistOwner ) ) ; self . check_assert ( ) ; res }
detaches a node from a non-owner link
detaches a node from a non - owner link
&mut self
obj
&Self::Id
owner
&Self::Id
&mut self
obj
&Self::Id
owner
&Self::Id