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 [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>
pub fn compile_instructions( &self, instructions: &[Instruction], ) -> Vec<CompiledInstruction>
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>
pub fn try_compile_instructions( &self, instructions: &[Instruction], ) -> Result<Vec<CompiledInstruction>, 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ยง
Sourceยงimpl<'a> Clone for AccountKeys<'a>
impl<'a> Clone for AccountKeys<'a>
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>
impl<'a> Debug for AccountKeys<'a>
Sourceยงimpl<'a> Default for AccountKeys<'a>
impl<'a> Default for AccountKeys<'a>
Sourceยงfn default() -> AccountKeys<'a>
fn default() -> AccountKeys<'a>
Sourceยงimpl Index<usize> for AccountKeys<'_>
impl Index<usize> for AccountKeys<'_>
Sourceยงimpl PartialEq for AccountKeys<'_>
impl PartialEq for AccountKeys<'_>
impl<'a> Eq for AccountKeys<'a>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSourceยงimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.