ThisInvokeContext

Struct ThisInvokeContext 

Source
pub struct ThisInvokeContext<'a> {
    pub timings: ExecuteDetailsTimings,
    /* private fields */
}

Fields§

§timings: ExecuteDetailsTimings

Implementations§

Source§

impl<'a> ThisInvokeContext<'a>

Source

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>

Source§

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 pop(&mut self)

Pop a stack frame from the invocation stack
Source§

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>

Verify and update PreAccount state based on program execution
Source§

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>

Removes the first keyed account
Source§

fn get_keyed_accounts(&self) -> Result<&[KeyedAccount<'_>], InstructionError>

Get the list of keyed accounts
Source§

fn get_programs(&self) -> &[(Pubkey, ProcessInstructionWithContext)]

Get a list of built-in programs
Source§

fn get_logger(&self) -> Rc<RefCell<dyn Logger>>

Get this invocation’s logger
Source§

fn get_bpf_compute_budget(&self) -> &BpfComputeBudget

👎Deprecated since 1.8.0: please use get_compute_budget instead
Get this invocation’s compute budget
Source§

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>)

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

Get the completed loader work that can be re-used across executions
Source§

fn record_instruction(&self, instruction: &Instruction)

Record invoked instruction
Source§

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>>)>

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, )

Update timing
Source§

fn get_sysvar_data(&self, id: &Pubkey) -> Option<Rc<Vec<u8>>>

Get sysvar data
Source§

fn get_compute_budget(&self) -> &ComputeBudget

Get this invocation’s compute budget
Source§

fn get_blockhash(&self) -> &Hash

Get this invocation’s blockhash
Source§

fn get_fee_calculator(&self) -> &FeeCalculator

Get this invocation’s FeeCalculator
Source§

fn set_return_data(&mut self, return_data: Option<(Pubkey, Vec<u8>)>)

Set the return data
Source§

fn get_return_data(&self) -> &Option<(Pubkey, Vec<u8>)>

Get the return data

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> AbiExample for T

Source§

default fn example() -> T

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,