[−][src]Struct solana_runtime::accounts::Accounts
This structure handles synchronization for db
Fields
accounts_db: Arc<AccountsDB>
Single global AccountsDB
Methods
impl Accounts
[src]
pub fn new(paths: Option<String>) -> Self
[src]
pub fn new_from_parent(parent: &Accounts) -> Self
[src]
pub fn update_from_stream<R: Read>(
&self,
stream: &mut BufReader<R>
) -> Result<(), Error>
[src]
&self,
stream: &mut BufReader<R>
) -> Result<(), Error>
pub fn load_accounts(
&self,
ancestors: &HashMap<Fork, usize>,
txs: &[Transaction],
lock_results: Vec<Result<()>>,
hash_queue: &BlockhashQueue,
error_counters: &mut ErrorCounters
) -> Vec<Result<(InstructionAccounts, InstructionLoaders, InstructionCredits)>>
[src]
&self,
ancestors: &HashMap<Fork, usize>,
txs: &[Transaction],
lock_results: Vec<Result<()>>,
hash_queue: &BlockhashQueue,
error_counters: &mut ErrorCounters
) -> Vec<Result<(InstructionAccounts, InstructionLoaders, InstructionCredits)>>
pub fn load_slow(
&self,
ancestors: &HashMap<Fork, usize>,
pubkey: &Pubkey
) -> Option<(Account, Fork)>
[src]
&self,
ancestors: &HashMap<Fork, usize>,
pubkey: &Pubkey
) -> Option<(Account, Fork)>
Slow because lock is held for 1 operation instead of many
pub fn load_by_program_fork(
&self,
fork: Fork,
program_id: &Pubkey
) -> Vec<(Pubkey, Account)>
[src]
&self,
fork: Fork,
program_id: &Pubkey
) -> Vec<(Pubkey, Account)>
pub fn load_by_program(
&self,
ancestors: &HashMap<Fork, usize>,
program_id: &Pubkey
) -> Vec<(Pubkey, Account)>
[src]
&self,
ancestors: &HashMap<Fork, usize>,
program_id: &Pubkey
) -> Vec<(Pubkey, Account)>
pub fn store_slow(&self, fork: Fork, pubkey: &Pubkey, account: &Account)
[src]
Slow because lock is held for 1 operation instead of many
pub fn hash_internal_state(&self, fork_id: Fork) -> Option<Hash>
[src]
#[must_use]
pub fn lock_accounts(&self, txs: &[Transaction]) -> 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], results: &[Result<()>])
[src]
Once accounts are unlocked, new transactions that modify that state can enter the pipeline
pub fn has_accounts(&self, fork: Fork) -> bool
[src]
pub fn store_accounts(
&self,
fork: Fork,
txs: &[Transaction],
res: &[Result<()>],
loaded: &mut [Result<(InstructionAccounts, InstructionLoaders, InstructionCredits)>]
)
[src]
&self,
fork: Fork,
txs: &[Transaction],
res: &[Result<()>],
loaded: &mut [Result<(InstructionAccounts, InstructionLoaders, InstructionCredits)>]
)
Store the accounts into the DB
pub fn purge_fork(&self, fork: Fork)
[src]
Purge a fork if it is not a root Root forks cannot be purged
pub fn add_root(&self, fork: Fork)
[src]
Add a fork to root. Root forks cannot be purged
pub fn commit_credits(&self, ancestors: &HashMap<Fork, usize>, fork: Fork)
[src]
Commit remaining credit-only changes, regardless of reference count
We do a take() on self.credit_only_account_locks
so that the hashmap is no longer
available to be written to. This prevents any transactions from reinserting into the hashmap.
Then there are then only 2 cases for interleaving with commit_credits and lock_accounts.
Either:
pub fn commit_credits_unsafe(
&self,
ancestors: &HashMap<Fork, usize>,
fork: Fork
)
[src]
&self,
ancestors: &HashMap<Fork, usize>,
fork: Fork
)
Used only for tests to store credit-only accounts after every transaction
Trait Implementations
Auto Trait Implementations
impl Unpin for Accounts
impl Send for Accounts
impl Sync for Accounts
impl !RefUnwindSafe for Accounts
impl !UnwindSafe for Accounts
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,
unsafe fn initialize(place: *mut T)
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,