Skip to main content

HopperIx

Trait HopperIx 

Source
pub trait HopperIx<'a>: Sized {
    type Accounts: HopperAccounts<'a>;
    type Args;

    // Required method
    fn parse_args(data: &'a [u8]) -> Result<Self::Args, ProgramError>;
}
Expand description

Trait defining a Hopper instruction.

Combines argument parsing with account construction into a single instruction definition. Used with hopper_entry() for typed dispatch.

Required Associated Types§

Source

type Accounts: HopperAccounts<'a>

The account struct for this instruction.

Source

type Args

The parsed argument type.

Required Methods§

Source

fn parse_args(data: &'a [u8]) -> Result<Self::Args, ProgramError>

Parse instruction arguments from raw data (after dispatch tag).

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§