fn store<K: Hash, V: ToKeyStoreValue>(&self, k: &K, v: &V) -> Result<(), Self::Error> {
        let mut hasher = std::collections::hash_map::DefaultHasher::new();
        k.hash(&mut hasher);
        let k = hasher.finish();
        let value = v
            .to_key_store_value()
            .map_err(|_| Error::SerializationError)?;
        // We unwrap here, because this is the only function claiming a write
        // lock on `credential_bundles`. It only holds the lock very briefly and
        // should not panic during that period.
        let mut values = self.values.write().unwrap();
        values.insert(k, value);
        Ok(())
    }
/// Store a value `v` that implements the [`KeyStoreValue`] trait for
/// serialization for ID `k`.
///
/// Returns an error if storing fails.


Returns an error if storing fails.
Returns an error if storing fails .
fn store<K: Hash, V: ToKeyStoreValue>(&self, k: &K, v: &V) -> Result<(), Self::Error> {
        let mut hasher = std::collections::hash_map::DefaultHasher::new();
        k.hash(&mut hasher);
        let k = hasher.finish();
        let value = v
            .to_key_store_value()
            .map_err(|_| Error::SerializationError)?;
        // We unwrap here, because this is the only function claiming a write
        // lock on `credential_bundles`. It only holds the lock very briefly and
        // should not panic during that period.
        let mut values = self.values.write().unwrap();
        values.insert(k, value);
        Ok(())
    }
fn store < K : Hash , V : ToKeyStoreValue > ( & self , k : & K , v : & V ) -> Result < ( ) , Self :: Error > { let mut hasher = std :: collections :: hash_map :: DefaultHasher :: new ( ) ; k . hash ( & mut hasher ) ; let k = hasher . finish ( ) ; let value = v . to_key_store_value ( ) . map_err ( | _ | Error :: SerializationError ) ? ; // We unwrap here, because this is the only function claiming a write // lock on `credential_bundles`. It only holds the lock very briefly and // should not panic during that period. let mut values = self . values . write ( ) . unwrap ( ) ; values . insert ( k , value ) ; Ok ( ( ) ) }
Store a value `v` that implements the [`KeyStoreValue`] trait for
serialization for ID `k`.
Store a value ` v ` that implements the [ ` KeyStoreValue ` ] trait for serialization for ID ` k ` .
&self
k
&K
v
&V
&self
k
&K
v
&V