pub fn weight<P>(&self, pk: P) -> Option<Weight>
    where
        P: Borrow<PublicKey>,
    {
        if let Some(weight) = self.root_weights.get(pk.borrow().as_ref()) {
            return Some(*weight);
        }

        let roots: Vec<PublicKey> = self
            .root_weights
            .keys()
            .map(|pk| pk.clone().into())
            .collect();

        // get all possible certificates from the given public key to all roots in the graph
        let certs = self.get_all_certs(pk, roots.as_slice());
        self.certificates_weight(certs)
    }
/// Get the maximum weight of trust for one public key.
Get the maximum weight of trust for one public key.
Get the maximum weight of trust for one public key .
pub fn weight<P>(&self, pk: P) -> Option<Weight>
    where
        P: Borrow<PublicKey>,
    {
        if let Some(weight) = self.root_weights.get(pk.borrow().as_ref()) {
            return Some(*weight);
        }
        let roots: Vec<PublicKey> = self
            .root_weights
            .keys()
            .map(|pk| pk.clone().into())
            .collect();
        // get all possible certificates from the given public key to all roots in the graph
        let certs = self.get_all_certs(pk, roots.as_slice());
        self.certificates_weight(certs)
    }
pub fn weight < P > ( & self , pk : P ) -> Option < Weight > where P : Borrow < PublicKey > , { if let Some ( weight ) = self . root_weights . get ( pk . borrow ( ) . as_ref ( ) ) { return Some ( * weight ) ; } let roots : Vec < PublicKey > = self . root_weights . keys ( ) . map ( | pk | pk . clone ( ) . into ( ) ) . collect ( ) ; // get all possible certificates from the given public key to all roots in the graph let certs = self . get_all_certs ( pk , roots . as_slice ( ) ) ; self . certificates_weight ( certs ) }
Get the maximum weight of trust for one public key.
Get the maximum weight of trust for one public key .
&self
pk
P