pub struct HashCache {
pub hashed_mints: ArrayMap<Pubkey, [u8; 32], 5>,
pub hashed_pubkeys: Vec<(Pubkey, [u8; 32])>,
}Expand description
Context for caching hashed values to avoid recomputation
Fields§
§hashed_mints: ArrayMap<Pubkey, [u8; 32], 5>Cache for mint hashes: (mint_pubkey, hashed_mint)
hashed_pubkeys: Vec<(Pubkey, [u8; 32])>Cache for pubkey hashes: (pubkey, hashed_pubkey)
Implementations§
Source§impl HashCache
impl HashCache
Sourcepub fn get_or_hash_mint(
&mut self,
mint: &Pubkey,
) -> Result<[u8; 32], TokenError>
pub fn get_or_hash_mint( &mut self, mint: &Pubkey, ) -> Result<[u8; 32], TokenError>
Get or compute hash for a mint pubkey
Sourcepub fn get_or_hash_pubkey(&mut self, pubkey: &Pubkey) -> [u8; 32]
pub fn get_or_hash_pubkey(&mut self, pubkey: &Pubkey) -> [u8; 32]
Get or compute hash for a pubkey (owner, delegate, etc.)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HashCache
impl RefUnwindSafe for HashCache
impl Send for HashCache
impl Sync for HashCache
impl Unpin for HashCache
impl UnwindSafe for HashCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more