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 AccountFromStorage])],
db: &'a AccountsDb,
) -> Self
pub fn new( target_slot: Slot, slots_and_accounts: &'a [(Slot, &'a [&'a AccountFromStorage])], db: &'a AccountsDb, ) -> Self
each element of slots_and_accounts is (source slot, accounts moving FROM source slot)
Trait Implementations§
source§impl<'a> StorableAccounts<'a> for StorableAccountsBySlot<'a>
impl<'a> StorableAccounts<'a> for StorableAccountsBySlot<'a>
source§fn account<Ret>(
&self,
index: usize,
callback: impl for<'local> FnMut(AccountForStorage<'local>) -> Ret,
) -> Ret
fn account<Ret>( &self, index: usize, callback: impl for<'local> FnMut(AccountForStorage<'local>) -> Ret, ) -> Ret
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 account_default_if_zero_lamport<Ret>(
&self,
index: usize,
callback: impl for<'local> FnMut(AccountForStorage<'local>) -> Ret,
) -> Ret
fn account_default_if_zero_lamport<Ret>( &self, index: usize, callback: impl for<'local> FnMut(AccountForStorage<'local>) -> Ret, ) -> Ret
None if account is zero lamports
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