Struct solana_sdk::instruction::Instruction [−][src]
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
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
pub 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
Tests whether the argument is a “none” instance. If so it will be
deserialized as None
, and otherwise it will be passed to
FromWasmAbi
. Read more
Returns an ABI instance indicating “none”, which JS will interpret as
the None
branch of this option. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type Anchor = Ref<'static, Instruction>
type Anchor = Ref<'static, Instruction>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
pub unsafe fn ref_from_abi(
js: <Instruction as RefFromWasmAbi>::Abi
) -> <Instruction as RefFromWasmAbi>::Anchor
pub unsafe fn ref_from_abi(
js: <Instruction as RefFromWasmAbi>::Abi
) -> <Instruction as RefFromWasmAbi>::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
type Anchor = RefMut<'static, Instruction>
type Anchor = RefMut<'static, Instruction>
Same as RefFromWasmAbi::Anchor
pub unsafe fn ref_mut_from_abi(
js: <Instruction as RefMutFromWasmAbi>::Abi
) -> <Instruction as RefMutFromWasmAbi>::Anchor
pub unsafe fn ref_mut_from_abi(
js: <Instruction as RefMutFromWasmAbi>::Abi
) -> <Instruction as RefMutFromWasmAbi>::Anchor
Same as RefFromWasmAbi::ref_from_abi
pub 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
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
pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
Mutably borrows from an owned value. Read more
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more