pub struct AccountKeys<'a> { /* private fields */ }Expand description
Collection of static and dynamically loaded keys used to load accounts during transaction processing.
Implementations§
Source§impl<'a> AccountKeys<'a>
impl<'a> AccountKeys<'a>
pub fn new( static_keys: &'a [Address], dynamic_keys: Option<&'a LoadedAddresses>, ) -> Self
target_os=solana only.Sourcepub fn get(&self, index: usize) -> Option<&'a Address>
Available on non-target_os=solana only.
pub fn get(&self, index: usize) -> Option<&'a Address>
target_os=solana only.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 len(&self) -> usize
Available on non-target_os=solana only.
pub fn len(&self) -> usize
target_os=solana only.Returns the total length of loaded accounts for a message
Sourcepub fn is_empty(&self) -> bool
Available on non-target_os=solana only.
pub fn is_empty(&self) -> bool
target_os=solana only.Returns true if this collection of account keys is empty
Sourcepub fn iter(&self) -> impl Iterator<Item = &'a Address> + Clone
Available on non-target_os=solana only.
pub fn iter(&self) -> impl Iterator<Item = &'a Address> + Clone
target_os=solana only.Iterator for the addresses of the loaded accounts for a message
Sourcepub fn compile_instructions(
&self,
instructions: &[Instruction],
) -> Vec<CompiledInstruction>
Available on non-target_os=solana only.
pub fn compile_instructions( &self, instructions: &[Instruction], ) -> Vec<CompiledInstruction>
target_os=solana only.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>, CompileError>
Available on non-target_os=solana only.
pub fn try_compile_instructions( &self, instructions: &[Instruction], ) -> Result<Vec<CompiledInstruction>, CompileError>
target_os=solana only.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§
Source§impl<'a> Clone for AccountKeys<'a>
Available on non-target_os=solana only.
impl<'a> Clone for AccountKeys<'a>
target_os=solana only.Source§fn clone(&self) -> AccountKeys<'a>
fn clone(&self) -> AccountKeys<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for AccountKeys<'a>
Available on non-target_os=solana only.
impl<'a> Debug for AccountKeys<'a>
target_os=solana only.Source§impl<'a> Default for AccountKeys<'a>
Available on non-target_os=solana only.
impl<'a> Default for AccountKeys<'a>
target_os=solana only.Source§fn default() -> AccountKeys<'a>
fn default() -> AccountKeys<'a>
Source§impl Index<usize> for AccountKeys<'_>
Available on non-target_os=solana only.
impl Index<usize> for AccountKeys<'_>
target_os=solana only.Source§impl PartialEq for AccountKeys<'_>
Available on non-target_os=solana only.
impl PartialEq for AccountKeys<'_>
target_os=solana only.impl<'a> Eq for AccountKeys<'a>
target_os=solana only.Auto Trait Implementations§
impl<'a> Freeze for AccountKeys<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more