fn reparent(&self, new_parent: &Node) -> Result<(), Error> {
        if let (
            Some(child_state),
            Some(child_index),
            Some(new_parent_state),
            Some(new_parent_index),
        ) = (self.state(), self.block_index(), new_parent.state(), new_parent.block_index())
        {
            if new_parent_state != child_state {
                return Err(Error::AdoptionIntoWrongVmo);
            }

            new_parent_state
                .try_lock()
                .and_then(|state| state.reparent(child_index, new_parent_index))?;
        }

        Ok(())
    }
/// This function is called by a child with the new parent as an argument.
/// The child will be removed from its current parent and added to the tree
/// under new_parent.
This function is called by a child with the new parent as an argument.
The child will be removed from its current parent and added to the tree
under new_parent.
This function is called by a child with the new parent as an argument . The child will be removed from its current parent and added to the tree under new_parent .
fn reparent(&self, new_parent: &Node) -> Result<(), Error> {
        if let (
            Some(child_state),
            Some(child_index),
            Some(new_parent_state),
            Some(new_parent_index),
        ) = (self.state(), self.block_index(), new_parent.state(), new_parent.block_index())
        {
            if new_parent_state != child_state {
                return Err(Error::AdoptionIntoWrongVmo);
            }
            new_parent_state
                .try_lock()
                .and_then(|state| state.reparent(child_index, new_parent_index))?;
        }
        Ok(())
    }
fn reparent ( & self , new_parent : & Node ) -> Result < ( ) , Error > { if let ( Some ( child_state ) , Some ( child_index ) , Some ( new_parent_state ) , Some ( new_parent_index ) , ) = ( self . state ( ) , self . block_index ( ) , new_parent . state ( ) , new_parent . block_index ( ) ) { if new_parent_state != child_state { return Err ( Error :: AdoptionIntoWrongVmo ) ; } new_parent_state . try_lock ( ) . and_then ( | state | state . reparent ( child_index , new_parent_index ) ) ? ; } Ok ( ( ) ) }
This function is called by a child with the new parent as an argument.
This function is called by a child with the new parent as an argument .
&self
new_parent
&Node
&self
new_parent
&Node