[][src]Struct solana_runtime::accounts::Accounts

pub struct Accounts {
    pub slot: Slot,
    pub accounts_db: Arc<AccountsDB>,
    // some fields omitted
}

This structure handles synchronization for db

Fields

slot: Slot

my slot

accounts_db: Arc<AccountsDB>

Single global AccountsDB

Methods

impl Accounts[src]

pub fn new(paths: Vec<PathBuf>) -> Self[src]

pub fn new_from_parent(parent: &Accounts, slot: Slot, parent_slot: Slot) -> Self[src]

pub fn new_with_frozen_accounts(
    paths: Vec<PathBuf>,
    ancestors: &HashMap<Slot, usize>,
    frozen_account_pubkeys: &[Pubkey]
) -> Self
[src]

pub fn freeze_accounts(
    &mut self,
    ancestors: &HashMap<Slot, usize>,
    frozen_account_pubkeys: &[Pubkey]
)
[src]

pub fn from_stream<R: Read, P: AsRef<Path>>(
    account_paths: &[PathBuf],
    ancestors: &HashMap<Slot, usize>,
    frozen_account_pubkeys: &[Pubkey],
    stream: &mut BufReader<R>,
    stream_append_vecs_path: P
) -> Result<Self, IOError>
[src]

pub fn has_duplicates<T: PartialEq>(xs: &[T]) -> bool[src]

Return true if the slice has any duplicate elements

pub fn load_accounts(
    &self,
    ancestors: &HashMap<Slot, usize>,
    txs: &[Transaction],
    txs_iteration_order: Option<&[usize]>,
    lock_results: Vec<TransactionProcessResult>,
    hash_queue: &BlockhashQueue,
    error_counters: &mut ErrorCounters,
    rent_collector: &RentCollector
) -> Vec<(Result<TransactionLoadResult>, Option<HashAgeKind>)>
[src]

pub fn load_slow(
    &self,
    ancestors: &HashMap<Slot, usize>,
    pubkey: &Pubkey
) -> Option<(Account, Slot)>
[src]

Slow because lock is held for 1 operation instead of many

pub fn load_by_program_slot(
    &self,
    slot: Slot,
    program_id: &Pubkey
) -> Vec<(Pubkey, Account)>
[src]

#[must_use]pub fn verify_bank_hash(
    &self,
    slot: Slot,
    ancestors: &HashMap<Slot, usize>
) -> bool
[src]

pub fn load_by_program(
    &self,
    ancestors: &HashMap<Slot, usize>,
    program_id: Option<&Pubkey>
) -> Vec<(Pubkey, Account)>
[src]

pub fn store_slow(&self, slot: Slot, pubkey: &Pubkey, account: &Account)[src]

Slow because lock is held for 1 operation instead of many

pub fn bank_hash_at(&self, slot_id: Slot) -> Hash[src]

pub fn bank_hash_info_at(&self, slot_id: Slot) -> BankHashInfo[src]

#[must_use]pub fn lock_accounts(
    &self,
    txs: &[Transaction],
    txs_iteration_order: Option<&[usize]>
) -> Vec<Result<()>>
[src]

This function will prevent multiple threads from modifying the same account state at the same time

pub fn unlock_accounts(
    &self,
    txs: &[Transaction],
    txs_iteration_order: Option<&[usize]>,
    results: &[Result<()>]
)
[src]

Once accounts are unlocked, new transactions that modify that state can enter the pipeline

pub fn store_accounts(
    &self,
    slot: Slot,
    txs: &[Transaction],
    txs_iteration_order: Option<&[usize]>,
    res: &[TransactionProcessResult],
    loaded: &mut [(Result<TransactionLoadResult>, Option<HashAgeKind>)],
    rent_collector: &RentCollector,
    last_blockhash: &Hash
)
[src]

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 Debug for Accounts[src]

impl Default for Accounts[src]

Auto Trait Implementations

impl !RefUnwindSafe for Accounts

impl Send for Accounts

impl Sync for Accounts

impl Unpin for Accounts

impl !UnwindSafe for Accounts

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> From<T> for T[src]

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,