pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn new( program_id: Address, elf: impl Into<ElfSource>, config: RuntimeConfig, ) -> RuntimeResult<Self>
pub fn add_program(&mut self, program_id: &Address, elf: impl Into<ElfSource>)
pub fn run( &mut self, instruction: &SolanaInstruction, accounts: &[(Address, Account)], ) -> RuntimeResult<ExecutionResult>
pub fn prepare( &mut self, instruction: &SolanaInstruction, accounts: &[(Address, Account)], ) -> RuntimeResult<()>
pub fn step(&mut self) -> RuntimeResult<()>
pub fn get_pc(&self) -> usize
pub fn get_registers(&self) -> Option<&[u64; 11]>
pub fn current_program_id(&self) -> &Address
pub fn is_halted(&self) -> bool
pub fn exit_code(&self) -> Option<u64>
pub fn compute_units_consumed(&self) -> u64
pub fn get_account(&self, pubkey: &Address) -> Option<Account>
pub fn get_accounts(&self) -> &HashMap<Address, Account>
pub fn get_register(&self, idx: usize) -> Option<u64>
pub fn set_register(&mut self, idx: usize, value: u64) -> RuntimeResult<()>
pub fn read_memory(&self, addr: u64, size: usize) -> Option<Vec<u8>>
pub fn get_instruction(&self) -> Option<&Instruction>
pub fn get_program(&self) -> &[Instruction]
pub fn get_call_stack(&self) -> Option<&[CallFrame]>
pub fn config(&self) -> &RuntimeConfig
pub fn sysvars(&self) -> &SysvarContext
pub fn sysvars_mut(&mut self) -> &mut SysvarContext
pub fn log_collector(&self) -> &LogCollector
pub fn drain_logs(&self) -> Vec<String>
Auto Trait Implementations§
impl Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl !Send for Runtime
impl !Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
impl !UnwindSafe for Runtime
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> 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