Struct solana_sdk::message::AccountKeys
source · [−]pub struct AccountKeys<'a> { /* private fields */ }
Expand description
Collection of static and dynamically loaded keys used to load accounts during transaction processing.
Implementations
sourceimpl<'a> AccountKeys<'a>
impl<'a> AccountKeys<'a>
pub fn new(
static_keys: &'a [Pubkey],
dynamic_keys: Option<&'a LoadedAddresses>
) -> AccountKeys<'a>
sourcepub fn get(&self, index: usize) -> Option<&'a Pubkey>
pub fn get(&self, index: usize) -> Option<&'a Pubkey>
Returns the address of the account at the specified index of the list of message account keys constructed from static keys, followed by dynamically loaded writable addresses, and lastly the list of dynamically loaded readonly addresses.
sourcepub fn iter(&self) -> impl Iterator<Item = &'a Pubkey>
pub fn iter(&self) -> impl Iterator<Item = &'a Pubkey>
Iterator for the addresses of the loaded accounts for a message
sourcepub fn compile_instructions(
&self,
instructions: &[Instruction]
) -> Vec<CompiledInstruction, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn compile_instructions(
&self,
instructions: &[Instruction]
) -> Vec<CompiledInstruction, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Compile instructions using the order of account keys to determine compiled instruction account indexes.
Panics
Panics when compiling fails. See AccountKeys::try_compile_instructions
for a full description of failure scenarios.
sourcepub fn try_compile_instructions(
&self,
instructions: &[Instruction]
) -> Result<Vec<CompiledInstruction, Global>, CompileError>
pub fn try_compile_instructions(
&self,
instructions: &[Instruction]
) -> Result<Vec<CompiledInstruction, Global>, CompileError>
Compile instructions using the order of account keys to determine compiled instruction account indexes.
Errors
Compilation will fail if any instructions
use account keys which are not
present in this account key collection.
Compilation will fail if any instructions
use account keys which are located
at an index which cannot be cast to a u8
without overflow.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for AccountKeys<'a>
impl<'a> Send for AccountKeys<'a>
impl<'a> Sync for AccountKeys<'a>
impl<'a> Unpin for AccountKeys<'a>
impl<'a> UnwindSafe for AccountKeys<'a>
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more