Trait InstructionAccess

Source
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§

Source

fn wallet(&self) -> Result<Pubkey, InstructionError>

Get wallet.

Source

fn program_id(&self) -> &Pubkey

Get program ID.

Source

fn data(&self) -> &[u8]

Get data.

Source

fn num_accounts(&self) -> usize

Get the number of accounts.

Source

fn accounts(&self) -> impl Iterator<Item = &InstructionAccount>

Get accounts.

Provided Methods§

Source

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.

Implementors§