pub struct IdlInstruction {
pub name: String,
pub accounts: Vec<IdlAccountItem>,
pub args: Vec<IdlField>,
pub default_optional_accounts: Option<bool>,
pub discriminant: Option<IdlInstructionDiscriminant>,
}Expand description
This represents one Instruction which in the case of ShankInstruction is just one variant of that enum. We also expect it to only have one arg which is a custom type containing the respective instruction args.
Fields§
§name: StringName of the instruction.
accounts: Vec<IdlAccountItem>Accounts that need to be supplied in order to process the instruction.
args: Vec<IdlField>Instruction args.
default_optional_accounts: Option<bool>Shank only.
When the #[default_optional_accounts] attribute is added to an Instruction enum, shank will mark it
such that optional accounts should default to the progam_id if they are not provided by the client.
Thus their position is static and optional accounts that are set can follow ones that are not.
The default strategy (without #[default_optional_accounts]) is to just omit unset optional
accounts from the accounts array.
discriminant: Option<IdlInstructionDiscriminant>A custom discriminant for the instruction, defaults to the index of the variant in the enum.
Trait Implementations§
Source§impl Clone for IdlInstruction
impl Clone for IdlInstruction
Source§fn clone(&self) -> IdlInstruction
fn clone(&self) -> IdlInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IdlInstruction
impl Debug for IdlInstruction
Source§impl<'de> Deserialize<'de> for IdlInstruction
impl<'de> Deserialize<'de> for IdlInstruction
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IdlInstruction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IdlInstruction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for IdlInstruction
impl PartialEq for IdlInstruction
Source§impl Serialize for IdlInstruction
impl Serialize for IdlInstruction
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for IdlInstruction
impl StructuralPartialEq for IdlInstruction
Auto Trait Implementations§
impl Freeze for IdlInstruction
impl RefUnwindSafe for IdlInstruction
impl Send for IdlInstruction
impl Sync for IdlInstruction
impl Unpin for IdlInstruction
impl UnwindSafe for IdlInstruction
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<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