pub struct StorableAccountsBySlot<'a> {
target_slot: Slot,
slots_and_accounts: &'a [(Slot, &'a [&'a StoredAccountMeta<'a>])],
include_slot_in_hash: IncludeSlotInHash,
starting_offsets: Vec<usize>,
contains_multiple_slots: bool,
len: usize,
}
Expand description
holds slices of accounts being moved FROM a common source slot to ‘target_slot’
Fields§
§target_slot: Slot
§slots_and_accounts: &'a [(Slot, &'a [&'a StoredAccountMeta<'a>])]
each element is (source slot, accounts moving FROM source slot)
include_slot_in_hash: IncludeSlotInHash
§starting_offsets: Vec<usize>
This is calculated based off slots_and_accounts. cumulative offset of all account slices prior to this one starting_offsets[0] is the starting offset of slots_and_accounts[1] The starting offset of slots_and_accounts[0] is always 0
contains_multiple_slots: bool
true if there is more than 1 slot represented in slots_and_accounts
len: usize
total len of all accounts, across all slots_and_accounts
Implementations§
source§impl<'a> StorableAccountsBySlot<'a>
impl<'a> StorableAccountsBySlot<'a>
sourcepub(crate) fn new(
target_slot: Slot,
slots_and_accounts: &'a [(Slot, &'a [&'a StoredAccountMeta<'a>])],
include_slot_in_hash: IncludeSlotInHash
) -> Self
pub(crate) 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)
sourcefn find_internal_index(&self, index: usize) -> (usize, usize)
fn find_internal_index(&self, index: usize) -> (usize, usize)
given an overall index for all accounts in self: return (slots_and_accounts index, index within those accounts)
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