pub struct AccountsPackage {
pub package_type: AccountsPackageType,
pub slot: Slot,
pub block_height: Slot,
pub snapshot_storages: Vec<Arc<AccountStorageEntry>>,
pub expected_capitalization: u64,
pub accounts_hash_for_testing: Option<AccountsHash>,
pub accounts: Arc<Accounts>,
pub epoch_schedule: EpochSchedule,
pub rent_collector: RentCollector,
pub snapshot_info: Option<SupplementalSnapshotInfo>,
pub enqueued: Instant,
}Expand description
This struct packages up fields to send from AccountsBackgroundService to AccountsHashVerifier
Fields§
§package_type: AccountsPackageType§slot: Slot§block_height: Slot§snapshot_storages: Vec<Arc<AccountStorageEntry>>§expected_capitalization: u64§accounts_hash_for_testing: Option<AccountsHash>§accounts: Arc<Accounts>§epoch_schedule: EpochSchedule§rent_collector: RentCollector§snapshot_info: Option<SupplementalSnapshotInfo>Supplemental information needed for snapshots
enqueued: InstantThe instant this accounts package was send to the queue. Used to track how long accounts packages wait before processing.
Implementations§
Source§impl AccountsPackage
impl AccountsPackage
Sourcepub fn new_for_snapshot(
package_type: AccountsPackageType,
bank: &Bank,
bank_snapshot_info: &BankSnapshotInfo,
bank_snapshots_dir: impl AsRef<Path>,
full_snapshot_archives_dir: impl AsRef<Path>,
incremental_snapshot_archives_dir: impl AsRef<Path>,
snapshot_storages: Vec<Arc<AccountStorageEntry>>,
archive_format: ArchiveFormat,
snapshot_version: SnapshotVersion,
accounts_hash_for_testing: Option<AccountsHash>,
) -> Result<Self>
pub fn new_for_snapshot( package_type: AccountsPackageType, bank: &Bank, bank_snapshot_info: &BankSnapshotInfo, bank_snapshots_dir: impl AsRef<Path>, full_snapshot_archives_dir: impl AsRef<Path>, incremental_snapshot_archives_dir: impl AsRef<Path>, snapshot_storages: Vec<Arc<AccountStorageEntry>>, archive_format: ArchiveFormat, snapshot_version: SnapshotVersion, accounts_hash_for_testing: Option<AccountsHash>, ) -> Result<Self>
Package up bank files, storages, and slot deltas for a snapshot
Sourcepub fn new_for_epoch_accounts_hash(
package_type: AccountsPackageType,
bank: &Bank,
snapshot_storages: Vec<Arc<AccountStorageEntry>>,
accounts_hash_for_testing: Option<AccountsHash>,
) -> Self
pub fn new_for_epoch_accounts_hash( package_type: AccountsPackageType, bank: &Bank, snapshot_storages: Vec<Arc<AccountStorageEntry>>, accounts_hash_for_testing: Option<AccountsHash>, ) -> Self
Package up fields needed to compute an EpochAccountsHash
Sourcepub fn default_for_tests() -> Self
pub fn default_for_tests() -> Self
Create a new Accounts Package where basically every field is defaulted. Only use for tests; many of the fields are invalid!
Sourcepub fn snapshot_links_dir(&self) -> &Path
pub fn snapshot_links_dir(&self) -> &Path
Returns the path to the snapshot links directory
NOTE 1: This path is within the TempDir created for the AccountsPackage, not the bank
snapshots dir passed into new_for_snapshot() when creating the AccountsPackage.
NOTE 2: This fn will panic if the AccountsPackage is of type EpochAccountsHash.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccountsPackage
impl !RefUnwindSafe for AccountsPackage
impl Send for AccountsPackage
impl Sync for AccountsPackage
impl Unpin for AccountsPackage
impl !UnwindSafe for AccountsPackage
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
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>
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>
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