solana_accounts_db/
epoch_accounts_hash.rs1use {crate::accounts_hash::AccountsHash, solana_hash::Hash};
11
12mod manager;
13pub use manager::Manager as EpochAccountsHashManager;
14
15#[cfg_attr(feature = "frozen-abi", derive(AbiExample))]
17#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone, Copy)]
18pub struct EpochAccountsHash(Hash);
19
20impl AsRef<Hash> for EpochAccountsHash {
21 fn as_ref(&self) -> &Hash {
22 &self.0
23 }
24}
25
26impl EpochAccountsHash {
27 #[must_use]
29 pub const fn new(accounts_hash: Hash) -> Self {
30 Self(accounts_hash)
31 }
32}
33
34impl From<AccountsHash> for EpochAccountsHash {
35 fn from(accounts_hash: AccountsHash) -> EpochAccountsHash {
36 Self::new(accounts_hash.0)
37 }
38}