pub struct InstructionContext { /* private fields */ }
Expand description

Loaded instruction shared between runtime and programs.

This context is valid for the entire duration of a (possibly cross program) instruction being processed.

Implementations

New

How many Instructions were on the stack after this one was pushed

That is the number of nested parent Instructions plus one (itself).

Number of program accounts

Get the index of the instruction’s program id

Get the instruction’s program id

Number of accounts in this Instruction (without program accounts)

Assert that enough account were supplied to this Instruction

Number of accounts in this Instruction

Data parameter for the programs process_instruction handler

Searches for a program account by its key

Searches for an account by its key

Translates the given instruction wide index into a transaction wide index

Gets the key of the last program account of this Instruction

Gets the key of an instruction account (skipping program accounts)

Tries to borrow an account from this Instruction

Gets the last program account of this Instruction

Gets an instruction account of this Instruction

Returns whether an account is a signer

Returns whether an account is writable

Calculates the set of all keys of signer accounts in this Instruction

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.