#[repr(C)]pub struct StableInstruction {
pub accounts: StableVec<AccountMeta>,
pub data: StableVec<u8>,
pub program_id: Pubkey,
}
Expand description
Instruction
, with a stable memory layout
This is used within the runtime to ensure memory mapping and memory accesses are valid. We
rely on known addresses and offsets within the runtime, and since Instruction
’s layout is
allowed to change, we must provide a way to lock down the memory layout. StableInstruction
reimplements the bare minimum of Instruction
’s API sufficient only for the runtime’s needs.
§Examples
Creating a StableInstruction
from an Instruction
let instruction = Instruction { program_id, accounts, data };
let instruction = StableInstruction::from(instruction);
Fields§
§accounts: StableVec<AccountMeta>
§data: StableVec<u8>
§program_id: Pubkey
Trait Implementations§
Source§impl Debug for StableInstruction
impl Debug for StableInstruction
Source§impl From<Instruction> for StableInstruction
impl From<Instruction> for StableInstruction
Source§fn from(other: Instruction) -> Self
fn from(other: Instruction) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StableInstruction
impl PartialEq for StableInstruction
impl StructuralPartialEq for StableInstruction
Auto Trait Implementations§
impl Freeze for StableInstruction
impl RefUnwindSafe for StableInstruction
impl !Send for StableInstruction
impl !Sync for StableInstruction
impl Unpin for StableInstruction
impl UnwindSafe for StableInstruction
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