pub(crate) fn path_secret(&self, index: NodeIndex) -> Option<&PathSecret> {
        // Get a Vector containing the node indices of the direct path to the
        // root from our own leaf.
        if let Ok(mut dirpath) =
            treemath::leaf_direct_path(self.own_node_index(), self.leaf_count())
        {
            // Filter out blanks for which we don't have path secrets
            let mut dirpath_filter = dirpath
                .drain(..)
                .filter(|&index| !self.nodes[index].is_blank());

            // Compute the right index in the `path_secrets` vector and get the secret.
            if let Some(position) = dirpath_filter.position(|x| x == index) {
                return self.private_tree.path_secrets().get(position);
            }
        }

        // Return None if either of the conditions is not fulfilled.
        None
    }
/// Get the path secret for a given target node. Returns `None` if the given
/// index is not in the tree or not on the direct path of the `own_node`.
Get the path secret for a given target node. Returns `None` if the given
index is not in the tree or not on the direct path of the `own_node`.
Get the path secret for a given target node . Returns ` None ` if the given index is not in the tree or not on the direct path of the ` own_node ` .
pub(crate) fn path_secret(&self, index: NodeIndex) -> Option<&PathSecret> {
        // Get a Vector containing the node indices of the direct path to the
        // root from our own leaf.
        if let Ok(mut dirpath) =
            treemath::leaf_direct_path(self.own_node_index(), self.leaf_count())
        {
            // Filter out blanks for which we don't have path secrets
            let mut dirpath_filter = dirpath
                .drain(..)
                .filter(|&index| !self.nodes[index].is_blank());
            // Compute the right index in the `path_secrets` vector and get the secret.
            if let Some(position) = dirpath_filter.position(|x| x == index) {
                return self.private_tree.path_secrets().get(position);
            }
        }
        // Return None if either of the conditions is not fulfilled.
        None
    }
pub ( crate ) fn path_secret ( & self , index : NodeIndex ) -> Option < & PathSecret > { // Get a Vector containing the node indices of the direct path to the // root from our own leaf. if let Ok ( mut dirpath ) = treemath :: leaf_direct_path ( self . own_node_index ( ) , self . leaf_count ( ) ) { // Filter out blanks for which we don't have path secrets let mut dirpath_filter = dirpath . drain ( .. ) . filter ( | & index | ! self . nodes [ index ] . is_blank ( ) ) ; // Compute the right index in the `path_secrets` vector and get the secret. if let Some ( position ) = dirpath_filter . position ( | x | x == index ) { return self . private_tree . path_secrets ( ) . get ( position ) ; } } // Return None if either of the conditions is not fulfilled. None }
Get the path secret for a given target node.
Get the path secret for a given target node .
&self
index
NodeIndex
&self
index
NodeIndex