pub fn new<'a, K, I>(keys: I) -> Lock
    where
        K: Hash + 'a,
        I: IntoIterator<Item = &'a K>,
    {
        // prevent from deadlock, so we sort and deduplicate the index
        let mut required_hashes: Vec<u64> = keys
            .into_iter()
            .map(|key| {
                let mut s = DefaultHasher::new();
                key.hash(&mut s);
                s.finish()
            })
            .collect();
        required_hashes.sort_unstable();
        required_hashes.dedup();
        Lock {
            required_hashes,
            owned_count: 0,
        }
    }
/// Creates a lock specifing all the required latches for a command.
Creates a lock specifing all the required latches for a command.
Creates a lock specifing all the required latches for a command .
pub fn new<'a, K, I>(keys: I) -> Lock
    where
        K: Hash + 'a,
        I: IntoIterator<Item = &'a K>,
    {
        // prevent from deadlock, so we sort and deduplicate the index
        let mut required_hashes: Vec<u64> = keys
            .into_iter()
            .map(|key| {
                let mut s = DefaultHasher::new();
                key.hash(&mut s);
                s.finish()
            })
            .collect();
        required_hashes.sort_unstable();
        required_hashes.dedup();
        Lock {
            required_hashes,
            owned_count: 0,
        }
    }
pub fn new < ' a , K , I > ( keys : I ) -> Lock where K : Hash + ' a , I : IntoIterator < Item = & ' a K > , { // prevent from deadlock, so we sort and deduplicate the index let mut required_hashes : Vec < u64 > = keys . into_iter ( ) . map ( | key | { let mut s = DefaultHasher :: new ( ) ; key . hash ( & mut s ) ; s . finish ( ) } ) . collect ( ) ; required_hashes . sort_unstable ( ) ; required_hashes . dedup ( ) ; Lock { required_hashes , owned_count : 0 , } }
Creates a lock specifing all the required latches for a command.
Creates a lock specifing all the required latches for a command .
keys
I