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