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§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
Source§type ThreadChecker = SendablePyClass<CompiledInstruction>
type ThreadChecker = SendablePyClass<CompiledInstruction>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§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
Source§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.Source§impl Serialize for CompiledInstruction
impl Serialize for CompiledInstruction
impl Eq for CompiledInstruction
impl StructuralPartialEq for CompiledInstruction
Auto Trait Implementations§
impl Freeze for CompiledInstruction
impl RefUnwindSafe for CompiledInstruction
impl Send for CompiledInstruction
impl Sync for CompiledInstruction
impl Unpin for CompiledInstruction
impl UnwindSafe for CompiledInstruction
Blanket Implementations§
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<'a, T> FromPyObject<'a> for T
impl<'a, T> FromPyObject<'a> for T
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>
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>
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