pub struct AccountsToStore<'a> {
pub slot: Slot,
/* private fields */
}
Expand description
reference a set of accounts to store The accounts may have to be split between 2 storages (primary and overflow) if there is not enough room in the primary storage. The ‘store’ functions need data stored in a slice of specific type. We need 1-2 of these slices constructed based on available bytes and individual account sizes. The slice arithmetic across both hashes and account data gets messy. So, this struct abstracts that.
Fields§
§slot: Slot
Implementations§
source§impl<'a> AccountsToStore<'a>
impl<'a> AccountsToStore<'a>
sourcepub fn new(
available_bytes: u64,
accounts: &'a [&'a StoredAccountMeta<'a>],
alive_total_bytes: usize,
slot: Slot
) -> Self
pub fn new( available_bytes: u64, accounts: &'a [&'a StoredAccountMeta<'a>], alive_total_bytes: usize, slot: Slot ) -> Self
break ‘stored_accounts’ into primary and overflow available_bytes: how many bytes remain in the primary storage. Excess accounts will be directed to an overflow storage
sourcepub fn has_overflow(&self) -> bool
pub fn has_overflow(&self) -> bool
true if a request to ‘get’ ‘Overflow’ would return accounts & hashes
sourcepub fn get(&self, storage: StorageSelector) -> &[&'a StoredAccountMeta<'a>]
pub fn get(&self, storage: StorageSelector) -> &[&'a StoredAccountMeta<'a>]
get the accounts to store in the given ‘storage’
Auto Trait Implementations§
impl<'a> RefUnwindSafe for AccountsToStore<'a>
impl<'a> Send for AccountsToStore<'a>
impl<'a> Sync for AccountsToStore<'a>
impl<'a> Unpin for AccountsToStore<'a>
impl<'a> UnwindSafe for AccountsToStore<'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