Struct solana_sdk::instruction::Instruction
source · [−]pub struct Instruction {
pub program_id: Pubkey,
pub accounts: Vec<AccountMeta, Global>,
pub data: Vec<u8, Global>,
}
Fields
program_id: Pubkey
Pubkey of the instruction processor that executes this instruction
accounts: Vec<AccountMeta, Global>
Metadata for what accounts should be passed to the instruction processor
data: Vec<u8, Global>
Opaque data passed to the instruction processor
Implementations
sourceimpl Instruction
impl Instruction
pub fn new<T>(
program_id: Pubkey,
data: &T,
accounts: Vec<AccountMeta, Global>
) -> Instruction where
T: Serialize,
Please use another Instruction constructor instead, such as Instruction::new_with_bincode
pub fn new_with_bincode<T>(
program_id: Pubkey,
data: &T,
accounts: Vec<AccountMeta, Global>
) -> Instruction where
T: Serialize,
pub fn new_with_borsh<T>(
program_id: Pubkey,
data: &T,
accounts: Vec<AccountMeta, Global>
) -> Instruction where
T: BorshSerialize,
pub fn new_with_bytes(
program_id: Pubkey,
data: &[u8],
accounts: Vec<AccountMeta, Global>
) -> Instruction
Trait Implementations
sourceimpl Clone for Instruction
impl Clone for Instruction
sourcepub fn clone(&self) -> Instruction
pub fn clone(&self) -> Instruction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Instruction
impl Debug for Instruction
sourceimpl<'de> Deserialize<'de> for Instruction
impl<'de> Deserialize<'de> for Instruction
sourcepub fn deserialize<__D>(
__deserializer: __D
) -> Result<Instruction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Instruction, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Instruction> for Instruction
impl PartialEq<Instruction> for Instruction
sourcepub fn eq(&self, other: &Instruction) -> bool
pub fn eq(&self, other: &Instruction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &Instruction) -> bool
pub fn ne(&self, other: &Instruction) -> bool
This method tests for !=
.
sourceimpl Serialize for Instruction
impl Serialize for Instruction
sourcepub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Instruction
Auto Trait Implementations
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
Blanket Implementations
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more