pub struct InstructionsSysvar<'a> { /* private fields */ }Expand description
Typed borrowed view over the Instructions sysvar account data.
Implementations§
Source§impl<'a> InstructionsSysvar<'a>
impl<'a> InstructionsSysvar<'a>
Sourcepub fn len(&self) -> Result<u16, ProgramError>
pub fn len(&self) -> Result<u16, ProgramError>
Number of instructions in the transaction.
Sourcepub fn is_empty(&self) -> Result<bool, ProgramError>
pub fn is_empty(&self) -> Result<bool, ProgramError>
True when the sysvar reports zero instructions.
Sourcepub fn current_index(&self) -> Result<u16, ProgramError>
pub fn current_index(&self) -> Result<u16, ProgramError>
Current instruction index.
Sourcepub fn instruction(
&self,
index: u16,
) -> Result<IntrospectedInstruction<'a>, ProgramError>
pub fn instruction( &self, index: u16, ) -> Result<IntrospectedInstruction<'a>, ProgramError>
Borrow instruction index as a typed view.
Sourcepub fn current_instruction(
&self,
) -> Result<IntrospectedInstruction<'a>, ProgramError>
pub fn current_instruction( &self, ) -> Result<IntrospectedInstruction<'a>, ProgramError>
Borrow the current instruction as a typed view.
Sourcepub fn program_id_at(&self, index: u16) -> Result<Address, ProgramError>
pub fn program_id_at(&self, index: u16) -> Result<Address, ProgramError>
Read the program id at instruction index.
Auto Trait Implementations§
impl<'a> Freeze for InstructionsSysvar<'a>
impl<'a> RefUnwindSafe for InstructionsSysvar<'a>
impl<'a> Send for InstructionsSysvar<'a>
impl<'a> Sync for InstructionsSysvar<'a>
impl<'a> Unpin for InstructionsSysvar<'a>
impl<'a> UnsafeUnpin for InstructionsSysvar<'a>
impl<'a> UnwindSafe for InstructionsSysvar<'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