pub struct StorableAccountsBySlot<'a> { /* private fields */ }
Expand description
holds slices of accounts being moved FROM a common source slot to ‘target_slot’
Implementations§
source§impl<'a> StorableAccountsBySlot<'a>
impl<'a> StorableAccountsBySlot<'a>
sourcepub fn new(
target_slot: Slot,
slots_and_accounts: &'a [(Slot, &'a [&'a StoredAccountMeta<'a>])],
include_slot_in_hash: IncludeSlotInHash
) -> Self
pub fn new( target_slot: Slot, slots_and_accounts: &'a [(Slot, &'a [&'a StoredAccountMeta<'a>])], include_slot_in_hash: IncludeSlotInHash ) -> Self
each element of slots_and_accounts is (source slot, accounts moving FROM source slot)
Trait Implementations§
source§impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>> for StorableAccountsBySlot<'a>
impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>> for StorableAccountsBySlot<'a>
The last parameter exists until this feature is activated: ignore slot when calculating an account hash #28420
source§fn account(&self, index: usize) -> &StoredAccountMeta<'a>
fn account(&self, index: usize) -> &StoredAccountMeta<'a>
account at ‘index’
fn slot(&self, index: usize) -> Slot
source§fn target_slot(&self) -> Slot
fn target_slot(&self) -> Slot
slot that all accounts are to be written to
source§fn contains_multiple_slots(&self) -> bool
fn contains_multiple_slots(&self) -> bool
are there accounts from multiple slots
only used for an assert
source§fn include_slot_in_hash(&self) -> IncludeSlotInHash
fn include_slot_in_hash(&self) -> IncludeSlotInHash
true iff hashing these accounts should include the slot
source§fn has_hash_and_write_version(&self) -> bool
fn has_hash_and_write_version(&self) -> bool
true iff the impl can provide hash and write_version
Otherwise, hash and write_version have to be provided separately to store functions.
source§fn hash(&self, index: usize) -> &Hash
fn hash(&self, index: usize) -> &Hash
return hash for account at ‘index’
Should only be called if ‘has_hash_and_write_version’ = true
source§fn write_version(&self, index: usize) -> u64
fn write_version(&self, index: usize) -> u64
return write_version for account at ‘index’
Should only be called if ‘has_hash_and_write_version’ = true
Auto Trait Implementations§
impl<'a> RefUnwindSafe for StorableAccountsBySlot<'a>
impl<'a> Send for StorableAccountsBySlot<'a>
impl<'a> Sync for StorableAccountsBySlot<'a>
impl<'a> Unpin for StorableAccountsBySlot<'a>
impl<'a> UnwindSafe for StorableAccountsBySlot<'a>
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