Struct solana_runtime::accounts::Accounts [−][src]
pub struct Accounts { pub accounts_db: Arc<AccountsDb>, // some fields omitted }
This structure handles synchronization for db
Fields
accounts_db: Arc<AccountsDb>
Single global AccountsDb
Implementations
impl Accounts
[src]
impl Accounts
[src]pub fn new(paths: Vec<PathBuf>, cluster_type: &ClusterType) -> Self
[src]
pub fn new_with_config(
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: HashSet<AccountIndex>,
caching_enabled: bool
) -> Self
[src]
paths: Vec<PathBuf>,
cluster_type: &ClusterType,
account_indexes: HashSet<AccountIndex>,
caching_enabled: bool
) -> Self
pub fn new_from_parent(parent: &Accounts, slot: Slot, parent_slot: Slot) -> Self
[src]
pub fn has_duplicates<T: PartialEq>(xs: &[T]) -> bool
[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]
&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>
pub fn load_slow(
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
[src]
&self,
ancestors: &Ancestors,
pubkey: &Pubkey
) -> Option<(AccountSharedData, Slot)>
Slow because lock is held for 1 operation instead of many
pub fn scan_slot<F, B>(&self, slot: Slot, func: F) -> Vec<B> where
F: Fn(LoadedAccount<'_>) -> Option<B> + Send + Sync,
B: Sync + Send + Default + Eq,
[src]
F: Fn(LoadedAccount<'_>) -> Option<B> + Send + Sync,
B: Sync + Send + Default + Eq,
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]
&self,
slot: Slot,
program_id: Option<&Pubkey>
) -> Vec<(Pubkey, AccountSharedData)>
pub fn load_largest_accounts(
&self,
ancestors: &Ancestors,
num: usize,
filter_by_address: &HashSet<Pubkey>,
filter: AccountAddressFilter
) -> Vec<(Pubkey, u64)>
[src]
&self,
ancestors: &Ancestors,
num: usize,
filter_by_address: &HashSet<Pubkey>,
filter: AccountAddressFilter
) -> Vec<(Pubkey, u64)>
pub fn calculate_capitalization(&self, ancestors: &Ancestors) -> u64
[src]
#[must_use]pub fn verify_bank_hash_and_lamports(
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> bool
[src]
&self,
slot: Slot,
ancestors: &Ancestors,
total_lamports: u64
) -> bool
pub fn load_by_program(
&self,
ancestors: &Ancestors,
program_id: &Pubkey
) -> Vec<(Pubkey, AccountSharedData)>
[src]
&self,
ancestors: &Ancestors,
program_id: &Pubkey
) -> Vec<(Pubkey, AccountSharedData)>
pub fn load_by_program_with_filter<F: Fn(&AccountSharedData) -> bool>(
&self,
ancestors: &Ancestors,
program_id: &Pubkey,
filter: F
) -> Vec<(Pubkey, AccountSharedData)>
[src]
&self,
ancestors: &Ancestors,
program_id: &Pubkey,
filter: F
) -> Vec<(Pubkey, AccountSharedData)>
pub fn load_by_index_key_with_filter<F: Fn(&AccountSharedData) -> bool>(
&self,
ancestors: &Ancestors,
index_key: &IndexKey,
filter: F
) -> Vec<(Pubkey, AccountSharedData)>
[src]
&self,
ancestors: &Ancestors,
index_key: &IndexKey,
filter: F
) -> Vec<(Pubkey, AccountSharedData)>
pub fn load_all(
&self,
ancestors: &Ancestors
) -> Vec<(Pubkey, AccountSharedData, Slot)>
[src]
&self,
ancestors: &Ancestors
) -> Vec<(Pubkey, AccountSharedData, Slot)>
pub fn load_to_collect_rent_eagerly<R: RangeBounds<Pubkey>>(
&self,
ancestors: &Ancestors,
range: R
) -> Vec<(Pubkey, AccountSharedData)>
[src]
&self,
ancestors: &Ancestors,
range: R
) -> Vec<(Pubkey, AccountSharedData)>
pub fn store_slow_uncached(
&self,
slot: Slot,
pubkey: &Pubkey,
account: &AccountSharedData
)
[src]
&self,
slot: Slot,
pubkey: &Pubkey,
account: &AccountSharedData
)
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
pub fn store_slow_cached(
&self,
slot: Slot,
pubkey: &Pubkey,
account: &AccountSharedData
)
[src]
&self,
slot: Slot,
pubkey: &Pubkey,
account: &AccountSharedData
)
pub fn bank_hash_at(&self, slot: Slot) -> Hash
[src]
pub fn bank_hash_info_at(&self, slot: Slot) -> BankHashInfo
[src]
#[must_use]pub fn lock_accounts<'a>(
&self,
txs: impl Iterator<Item = &'a Transaction>,
demote_sysvar_write_locks: bool
) -> Vec<Result<()>>
[src]
&self,
txs: impl Iterator<Item = &'a Transaction>,
demote_sysvar_write_locks: bool
) -> Vec<Result<()>>
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]
&self,
txs: impl Iterator<Item = &'a Transaction>,
results: &[Result<()>],
demote_sysvar_write_locks: bool
)
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]
&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
)
Store the accounts into the DB
pub fn purge_slot(&self, slot: Slot)
[src]
Purge a slot if it is not a root Root slots cannot be purged
pub fn add_root(&self, slot: Slot)
[src]
Add a slot to root. Root slots cannot be purged
Trait Implementations
impl AbiExample for Accounts
[src]
impl AbiExample for Accounts
[src]Auto Trait Implementations
impl !RefUnwindSafe for Accounts
impl !RefUnwindSafe for Accounts
impl !UnwindSafe for Accounts
impl !UnwindSafe for Accounts
Blanket Implementations
impl<T> AbiExample for T
[src]
impl<T> AbiExample for T
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,