pub trait InstructionAccess {
// Required methods
fn wallet(&self) -> Result<Pubkey, InstructionError>;
fn program_id(&self) -> &Pubkey;
fn data(&self) -> &[u8] ⓘ;
fn num_accounts(&self) -> usize;
fn accounts(&self) -> impl Iterator<Item = &InstructionAccount>;
// Provided method
fn to_instruction(
&self,
mark_executor_wallet_as_signer: bool,
) -> Result<Instruction, InstructionError> { ... }
}
Expand description
Instruction Access.
Required Methods§
Sourcefn wallet(&self) -> Result<Pubkey, InstructionError>
fn wallet(&self) -> Result<Pubkey, InstructionError>
Get wallet.
Sourcefn program_id(&self) -> &Pubkey
fn program_id(&self) -> &Pubkey
Get program ID.
Sourcefn num_accounts(&self) -> usize
fn num_accounts(&self) -> usize
Get the number of accounts.
Sourcefn accounts(&self) -> impl Iterator<Item = &InstructionAccount>
fn accounts(&self) -> impl Iterator<Item = &InstructionAccount>
Get accounts.
Provided Methods§
Sourcefn to_instruction(
&self,
mark_executor_wallet_as_signer: bool,
) -> Result<Instruction, InstructionError>
fn to_instruction( &self, mark_executor_wallet_as_signer: bool, ) -> Result<Instruction, InstructionError>
Convert to instruction.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.