pub struct ThisInvokeContext<'a> {
pub timings: ExecuteDetailsTimings,
/* private fields */
}
Fields§
§timings: ExecuteDetailsTimings
Implementations§
Source§impl<'a> ThisInvokeContext<'a>
impl<'a> ThisInvokeContext<'a>
pub fn new( program_id: &Pubkey, rent: Rent, message: &'a Message, instruction: &'a CompiledInstruction, program_indices: &[usize], accounts: &'a [(Pubkey, Rc<RefCell<AccountSharedData>>)], programs: &'a [(Pubkey, ProcessInstructionWithContext)], log_collector: Option<Rc<LogCollector>>, compute_budget: ComputeBudget, compute_meter: Rc<RefCell<dyn ComputeMeter>>, executors: Rc<RefCell<Executors>>, instruction_recorder: Option<InstructionRecorder>, feature_set: Arc<FeatureSet>, account_db: Arc<Accounts>, ancestors: &'a Ancestors, blockhash: &'a Hash, fee_calculator: &'a FeeCalculator, ) -> Result<Self, InstructionError>
Trait Implementations§
Source§impl<'a> InvokeContext for ThisInvokeContext<'a>
impl<'a> InvokeContext for ThisInvokeContext<'a>
Source§fn push(
&mut self,
key: &Pubkey,
message: &Message,
instruction: &CompiledInstruction,
program_indices: &[usize],
account_indices: &[usize],
) -> Result<(), InstructionError>
fn push( &mut self, key: &Pubkey, message: &Message, instruction: &CompiledInstruction, program_indices: &[usize], account_indices: &[usize], ) -> Result<(), InstructionError>
Push a stack frame onto the invocation stack
Source§fn invoke_depth(&self) -> usize
fn invoke_depth(&self) -> usize
Current depth of the invocation stake
Source§fn verify_and_update(
&mut self,
instruction: &CompiledInstruction,
account_indices: &[usize],
write_privileges: &[bool],
) -> Result<(), InstructionError>
fn verify_and_update( &mut self, instruction: &CompiledInstruction, account_indices: &[usize], write_privileges: &[bool], ) -> Result<(), InstructionError>
Verify and update PreAccount state based on program execution
Source§fn get_caller(&self) -> Result<&Pubkey, InstructionError>
fn get_caller(&self) -> Result<&Pubkey, InstructionError>
Get the program ID of the currently executing program
Source§fn remove_first_keyed_account(&mut self) -> Result<(), InstructionError>
fn remove_first_keyed_account(&mut self) -> Result<(), InstructionError>
Removes the first keyed account
Source§fn get_keyed_accounts(&self) -> Result<&[KeyedAccount<'_>], InstructionError>
fn get_keyed_accounts(&self) -> Result<&[KeyedAccount<'_>], InstructionError>
Get the list of keyed accounts
Source§fn get_programs(&self) -> &[(Pubkey, ProcessInstructionWithContext)]
fn get_programs(&self) -> &[(Pubkey, ProcessInstructionWithContext)]
Get a list of built-in programs
Source§fn get_bpf_compute_budget(&self) -> &BpfComputeBudget
fn get_bpf_compute_budget(&self) -> &BpfComputeBudget
👎Deprecated since 1.8.0: please use
get_compute_budget
insteadGet this invocation’s compute budget
Source§fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>>
fn get_compute_meter(&self) -> Rc<RefCell<dyn ComputeMeter>>
Get this invocation’s compute meter
Source§fn add_executor(&self, pubkey: &Pubkey, executor: Arc<dyn Executor>)
fn add_executor(&self, pubkey: &Pubkey, executor: Arc<dyn Executor>)
Loaders may need to do work in order to execute a program. Cache
the work that can be re-used across executions
Source§fn get_executor(&self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>
fn get_executor(&self, pubkey: &Pubkey) -> Option<Arc<dyn Executor>>
Get the completed loader work that can be re-used across executions
Source§fn record_instruction(&self, instruction: &Instruction)
fn record_instruction(&self, instruction: &Instruction)
Record invoked instruction
Source§fn is_feature_active(&self, feature_id: &Pubkey) -> bool
fn is_feature_active(&self, feature_id: &Pubkey) -> bool
Get the bank’s active feature set
Source§fn get_account(
&self,
pubkey: &Pubkey,
) -> Option<(usize, Rc<RefCell<AccountSharedData>>)>
fn get_account( &self, pubkey: &Pubkey, ) -> Option<(usize, Rc<RefCell<AccountSharedData>>)>
Find an account_index and account by its key
Source§fn update_timing(
&mut self,
serialize_us: u64,
create_vm_us: u64,
execute_us: u64,
deserialize_us: u64,
)
fn update_timing( &mut self, serialize_us: u64, create_vm_us: u64, execute_us: u64, deserialize_us: u64, )
Update timing
Source§fn get_compute_budget(&self) -> &ComputeBudget
fn get_compute_budget(&self) -> &ComputeBudget
Get this invocation’s compute budget
Source§fn get_blockhash(&self) -> &Hash
fn get_blockhash(&self) -> &Hash
Get this invocation’s blockhash
Source§fn get_fee_calculator(&self) -> &FeeCalculator
fn get_fee_calculator(&self) -> &FeeCalculator
Get this invocation’s
FeeCalculator
Auto Trait Implementations§
impl<'a> !Freeze for ThisInvokeContext<'a>
impl<'a> !RefUnwindSafe for ThisInvokeContext<'a>
impl<'a> !Send for ThisInvokeContext<'a>
impl<'a> !Sync for ThisInvokeContext<'a>
impl<'a> Unpin for ThisInvokeContext<'a>
impl<'a> !UnwindSafe for ThisInvokeContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more