Skip to main content

ProgramExt

Trait ProgramExt 

Source
pub trait ProgramExt: Program {
    // Provided methods
    fn instruction(&self, data: Vec<u8>) -> InstructionBuilder<'_, Self>
       where Self: Sized { ... }
    fn anchor_instruction(
        &self,
        args: impl InstructionData,
    ) -> InstructionBuilder<'_, Self>
       where Self: Sized { ... }
    fn anchor_accounts(
        &self,
        accounts: impl ToAccountMetas,
        convert_optional: bool,
    ) -> Vec<AccountMeta>
       where Self: Id { ... }
}
Expand description

Extension trait for Program.

Provided Methods§

Source

fn instruction(&self, data: Vec<u8>) -> InstructionBuilder<'_, Self>
where Self: Sized,

Source

fn anchor_instruction( &self, args: impl InstructionData, ) -> InstructionBuilder<'_, Self>
where Self: Sized,

Source

fn anchor_accounts( &self, accounts: impl ToAccountMetas, convert_optional: bool, ) -> Vec<AccountMeta>
where Self: Id,

Convert to account metas.

If convert_optional is true, read-only non-signer accounts with the default program ID as pubkey will be replaced with the current program ID.

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§

Source§

impl<P: ?Sized + Program> ProgramExt for P