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>])],
) -> Self
pub fn new( target_slot: Slot, slots_and_accounts: &'a [(Slot, &'a [&'a StoredAccountMeta<'a>])], ) -> 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>
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 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) -> &AccountHash
fn hash(&self, index: usize) -> &AccountHash
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> Freeze for StorableAccountsBySlot<'a>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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