Struct solana_runtime::accounts::Accounts [−][src]
pub struct Accounts { pub accounts_db: Arc<AccountsDb>, // some fields omitted }
Expand description
This structure handles synchronization for db
Fields
accounts_db: Arc<AccountsDb>
Single global AccountsDb
Implementations
pub fn new_with_config(
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: AccountSecondaryIndexes,
caching_enabled: bool
) -> Self
[src]Return true if the slice has any duplicate elements
pub fn load_accounts<'a>(
&self,
ancestors: &Ancestors,
txs: impl Iterator<Item = &'a Transaction>,
lock_results: Vec<TransactionCheckResult>,
hash_queue: &BlockhashQueue,
error_counters: &mut ErrorCounters,
rent_collector: &RentCollector,
feature_set: &FeatureSet
) -> Vec<TransactionLoadResult>
[src]pub fn load_with_fixed_root(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]pub fn load_without_fixed_root(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]scans underlying accounts_db for this delta (slot) with a map function from LoadedAccount to B returns only the latest/current version of B for this slot
pub fn load_by_program_slot(
&self,
slot: Slot,
program_id: Option<&Pubkey>
) -> Vec<(Pubkey, AccountSharedData)>
[src]pub fn load_largest_accounts(
&self,
ancestors: &Ancestors,
num: usize,
filter_by_address: &HashSet<Pubkey>,
filter: AccountAddressFilter
) -> Vec<(Pubkey, u64)>
[src]#[must_use]pub fn verify_bank_hash_and_lamports(
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> bool
[src]pub fn load_by_program(
&self,
ancestors: &Ancestors,
program_id: &Pubkey
) -> Vec<(Pubkey, AccountSharedData)>
[src]pub fn load_by_program_with_filter<F: Fn(&AccountSharedData) -> bool>(
&self,
ancestors: &Ancestors,
program_id: &Pubkey,
filter: F
) -> Vec<(Pubkey, AccountSharedData)>
[src]pub fn load_by_index_key_with_filter<F: Fn(&AccountSharedData) -> bool>(
&self,
ancestors: &Ancestors,
index_key: &IndexKey,
filter: F
) -> Vec<(Pubkey, AccountSharedData)>
[src]pub fn load_to_collect_rent_eagerly<R: RangeBounds<Pubkey>>(
&self,
ancestors: &Ancestors,
range: R
) -> Vec<(Pubkey, AccountSharedData)>
[src]Slow because lock is held for 1 operation instead of many. WARNING: This noncached version is only to be used for tests/benchmarking as bypassing the cache in general is not supported
#[must_use]pub fn lock_accounts<'a>(
&self,
txs: impl Iterator<Item = &'a Transaction>,
demote_sysvar_write_locks: bool
) -> Vec<Result<()>>
[src]
#[must_use]pub fn lock_accounts<'a>(
&self,
txs: impl Iterator<Item = &'a Transaction>,
demote_sysvar_write_locks: bool
) -> Vec<Result<()>>
[src]This function will prevent multiple threads from modifying the same account state at the same time
pub fn unlock_accounts<'a>(
&self,
txs: impl Iterator<Item = &'a Transaction>,
results: &[Result<()>],
demote_sysvar_write_locks: bool
)
[src]
pub fn unlock_accounts<'a>(
&self,
txs: impl Iterator<Item = &'a Transaction>,
results: &[Result<()>],
demote_sysvar_write_locks: bool
)
[src]Once accounts are unlocked, new transactions that modify that state can enter the pipeline
pub fn store_cached<'a>(
&self,
slot: Slot,
txs: impl Iterator<Item = &'a Transaction>,
res: &'a [TransactionExecutionResult],
loaded: &'a mut [TransactionLoadResult],
rent_collector: &RentCollector,
last_blockhash_with_fee_calculator: &(Hash, FeeCalculator),
fix_recent_blockhashes_sysvar_delay: bool,
demote_sysvar_write_locks: bool
)
[src]
pub fn store_cached<'a>(
&self,
slot: Slot,
txs: impl Iterator<Item = &'a Transaction>,
res: &'a [TransactionExecutionResult],
loaded: &'a mut [TransactionLoadResult],
rent_collector: &RentCollector,
last_blockhash_with_fee_calculator: &(Hash, FeeCalculator),
fix_recent_blockhashes_sysvar_delay: bool,
demote_sysvar_write_locks: bool
)
[src]Store the accounts into the DB
Purge a slot if it is not a root
Root slots cannot be purged
is_from_abs
is true if the caller is the AccountsBackgroundService
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Accounts
impl !UnwindSafe for Accounts
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V