txmap 3.1.4

A concurrent transactional hash map for Rust with fine-grained locking, internal mutability and composable transactions
Documentation
use crate::new_types::{HashCode, ShardIndex};
use std::hash::Hash;

/// A key together with its pre-computed hash and shard index.
///
/// Created internally by [`Indexer::indexed_key`](crate::indexer::Indexer::indexed_key). Used throughout
/// the transaction system to avoid re-hashing.
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct TxKey<K>
where
    K: Hash + Eq,
{
    /// Pre-computed hash code of the key.
    pub hash_code: HashCode,
    /// The shard this key belongs to.
    pub shard_index: ShardIndex,
    /// The original key value.
    pub key: K,
}