#[repr(C)]
pub struct ExtraAccountMeta { pub discriminator: u8, pub address_config: [u8; 32], pub is_signer: PodBool, pub is_writable: PodBool, }
Expand description

Pod type for defining a required account in a validation account.

This can be any of the following:

  • A standard AccountMeta
  • A PDA (with seed configurations)
  • A pubkey stored in some data (account or instruction data)

Can be used in TLV-encoded data.

Fields§

§discriminator: u8

Discriminator to tell whether this represents a standard AccountMeta, PDA, or pubkey data.

§address_config: [u8; 32]

This address_config field can either be the pubkey of the account, the seeds used to derive the pubkey from provided inputs (PDA), or the data used to derive the pubkey (account or instruction data).

§is_signer: PodBool

Whether the account should sign

§is_writable: PodBool

Whether the account should be writable

Implementations§

source§

impl ExtraAccountMeta

source

pub fn new_with_pubkey( pubkey: &Pubkey, is_signer: bool, is_writable: bool, ) -> Result<Self, ProgramError>

Create a ExtraAccountMeta from a public key, thus representing a standard AccountMeta

source

pub fn new_with_seeds( seeds: &[Seed], is_signer: bool, is_writable: bool, ) -> Result<Self, ProgramError>

Create a ExtraAccountMeta from a list of seed configurations, thus representing a PDA

source

pub fn new_with_pubkey_data( key_data: &PubkeyData, is_signer: bool, is_writable: bool, ) -> Result<Self, ProgramError>

Create a ExtraAccountMeta from a pubkey data configuration.

source

pub fn new_external_pda_with_seeds( program_index: u8, seeds: &[Seed], is_signer: bool, is_writable: bool, ) -> Result<Self, ProgramError>

Create a ExtraAccountMeta from a list of seed configurations, representing a PDA for an external program

This PDA belongs to a program elsewhere in the account list, rather than the executing program. For a PDA on the executing program, use ExtraAccountMeta::new_with_seeds.

source

pub fn resolve<'a, F>( &self, instruction_data: &[u8], program_id: &Pubkey, get_account_key_data_fn: F, ) -> Result<AccountMeta, ProgramError>
where F: Fn(usize) -> Option<(&'a Pubkey, Option<&'a [u8]>)>,

Resolve an ExtraAccountMeta into an AccountMeta, potentially resolving a program-derived address (PDA) if necessary

Trait Implementations§

source§

impl Clone for ExtraAccountMeta

source§

fn clone(&self) -> ExtraAccountMeta

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExtraAccountMeta

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ExtraAccountMeta

source§

fn default() -> ExtraAccountMeta

Returns the “default value” for a type. Read more
source§

impl From<&AccountInfo<'_>> for ExtraAccountMeta

source§

fn from(account_info: &AccountInfo<'_>) -> Self

Converts to this type from the input type.
source§

impl From<&AccountMeta> for ExtraAccountMeta

source§

fn from(meta: &AccountMeta) -> Self

Converts to this type from the input type.
source§

impl From<AccountInfo<'_>> for ExtraAccountMeta

source§

fn from(account_info: AccountInfo<'_>) -> Self

Converts to this type from the input type.
source§

impl From<AccountMeta> for ExtraAccountMeta

source§

fn from(meta: AccountMeta) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ExtraAccountMeta

source§

fn eq(&self, other: &ExtraAccountMeta) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&ExtraAccountMeta> for AccountMeta

§

type Error = ProgramError

The type returned in the event of a conversion error.
source§

fn try_from(pod: &ExtraAccountMeta) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Zeroable for ExtraAccountMeta

source§

fn zeroed() -> Self

source§

impl Copy for ExtraAccountMeta

source§

impl Pod for ExtraAccountMeta

source§

impl StructuralPartialEq for ExtraAccountMeta

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> AnyBitPattern for T
where T: Pod,

source§

impl<T> NoUninit for T
where T: Pod,