Struct solders_instruction::CompiledInstruction
source · pub struct CompiledInstruction(/* private fields */);
Expand description
A compact encoding of an instruction.
A CompiledInstruction
is a component of a multi-instruction :class:~solders.message.Message
,
which is the core of a Solana transaction. It is created during the
construction of Message
. Most users will not interact with it directly.
Args: program_id_index (int): Index into the transaction keys array indicating the program account that executes this instruction. data (bytes): The program input data. accounts (bytes): Ordered indices into the transaction keys array indicating which accounts to pass to the program.
Implementations§
source§impl CompiledInstruction
impl CompiledInstruction
pub fn new(program_id_index: u8, data: &[u8], accounts: &[u8]) -> Self
sourcepub fn program_id(&self, program_ids: Vec<Pubkey>) -> Pubkey
pub fn program_id(&self, program_ids: Vec<Pubkey>) -> Pubkey
Return the pubkey of the program that executes this instruction.
Returns: Pubkey: The program ID.
pub fn program_id_index(&self) -> u8
pub fn accounts<'a>(&self, py: Python<'a>) -> &'a PyBytes
pub fn set_accounts(&mut self, accounts: Vec<u8>)
pub fn data<'a>(&self, py: Python<'a>) -> &'a PyBytes
sourcepub fn from_bytes(data: &[u8]) -> PyResult<Self>
pub fn from_bytes(data: &[u8]) -> PyResult<Self>
Deserialize a serialized CompiledInstruction
object.
Args:
data (bytes): the serialized CompiledInstruction
.
Returns:
CompiledInstruction: The deserialized CompiledInstruction
.
pub fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool>
pub fn __bytes__<'a>(&self, py: Python<'a>) -> &'a PyBytes
pub fn __str__(&self) -> String
pub fn __repr__(&self) -> String
pub fn __reduce__(&self) -> PyResult<(PyObject, PyObject)>
Trait Implementations§
source§impl AsRef<CompiledInstruction> for CompiledInstruction
impl AsRef<CompiledInstruction> for CompiledInstruction
source§fn as_ref(&self) -> &CompiledInstructionOriginal
fn as_ref(&self) -> &CompiledInstructionOriginal
source§impl Clone for CompiledInstruction
impl Clone for CompiledInstruction
source§fn clone(&self) -> CompiledInstruction
fn clone(&self) -> CompiledInstruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CommonMethods<'_> for CompiledInstruction
impl CommonMethods<'_> for CompiledInstruction
fn py_to_json(&self) -> String
fn py_from_json(raw: &'a str) -> Result<Self, PyErr>
source§impl Debug for CompiledInstruction
impl Debug for CompiledInstruction
source§impl<'de> Deserialize<'de> for CompiledInstruction
impl<'de> Deserialize<'de> for CompiledInstruction
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for CompiledInstruction
impl Display for CompiledInstruction
source§impl From<CompiledInstruction> for CompiledInstruction
impl From<CompiledInstruction> for CompiledInstruction
source§fn from(original: CompiledInstructionOriginal) -> CompiledInstruction
fn from(original: CompiledInstructionOriginal) -> CompiledInstruction
source§impl From<CompiledInstruction> for CompiledInstruction
impl From<CompiledInstruction> for CompiledInstruction
source§fn from(original: CompiledInstruction) -> Self
fn from(original: CompiledInstruction) -> Self
source§impl PartialEq for CompiledInstruction
impl PartialEq for CompiledInstruction
source§fn eq(&self, other: &CompiledInstruction) -> bool
fn eq(&self, other: &CompiledInstruction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PyBytesBincode for CompiledInstruction
impl PyBytesBincode for CompiledInstruction
fn pybytes_bincode<'a>(&self, py: Python<'a>) -> &'a PyBytes
source§impl PyBytesGeneral for CompiledInstruction
impl PyBytesGeneral for CompiledInstruction
fn pybytes_general<'a>(&self, py: Python<'a>) -> &'a PyBytes
source§impl PyClass for CompiledInstruction
impl PyClass for CompiledInstruction
source§impl PyClassImpl for CompiledInstruction
impl PyClassImpl for CompiledInstruction
source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type Layout = PyCell<CompiledInstruction>
type Layout = PyCell<CompiledInstruction>
§type ThreadChecker = ThreadCheckerStub<CompiledInstruction>
type ThreadChecker = ThreadCheckerStub<CompiledInstruction>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl PyClassNewTextSignature<CompiledInstruction> for PyClassImplCollector<CompiledInstruction>
impl PyClassNewTextSignature<CompiledInstruction> for PyClassImplCollector<CompiledInstruction>
fn new_text_signature(self) -> Option<&'static str>
source§impl PyFromBytesBincode<'_> for CompiledInstruction
impl PyFromBytesBincode<'_> for CompiledInstruction
source§impl PyFromBytesGeneral for CompiledInstruction
impl PyFromBytesGeneral for CompiledInstruction
fn py_from_bytes_general(raw: &[u8]) -> PyResult<Self>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a CompiledInstruction
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a CompiledInstruction
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut CompiledInstruction
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut CompiledInstruction
source§impl PyMethods<CompiledInstruction> for PyClassImplCollector<CompiledInstruction>
impl PyMethods<CompiledInstruction> for PyClassImplCollector<CompiledInstruction>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for CompiledInstruction
impl PyTypeInfo for CompiledInstruction
§type AsRefTarget = PyCell<CompiledInstruction>
type AsRefTarget = PyCell<CompiledInstruction>
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object
is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object
is an instance of this type.