#[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 either be a standard AccountMeta
or a PDA.
Can be used in TLV-encoded data.
Fields§
§discriminator: u8
Discriminator to tell whether this represents a standard
AccountMeta
or a PDA
address_config: [u8; 32]
This address_config
field can either be the pubkey of the account
or the seeds used to derive the pubkey from provided inputs
is_signer: PodBool
Whether the account should sign
is_writable: PodBool
Whether the account should be writable
Implementations§
source§impl ExtraAccountMeta
impl ExtraAccountMeta
sourcepub fn new_with_pubkey(
pubkey: &Pubkey,
is_signer: bool,
is_writable: bool
) -> Result<Self, ProgramError>
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
sourcepub fn new_with_seeds(
seeds: &[Seed],
is_signer: bool,
is_writable: bool
) -> Result<Self, ProgramError>
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
sourcepub fn new_external_pda_with_seeds(
program_index: u8,
seeds: &[Seed],
is_signer: bool,
is_writable: bool
) -> Result<Self, ProgramError>
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
.
sourcepub fn resolve<'a, F>(
&self,
instruction_data: &[u8],
program_id: &Pubkey,
get_account_key_data_fn: F
) -> Result<AccountMeta, ProgramError>
pub fn resolve<'a, F>( &self, instruction_data: &[u8], program_id: &Pubkey, get_account_key_data_fn: F ) -> Result<AccountMeta, ProgramError>
Resolve an ExtraAccountMeta
into an AccountMeta
, potentially
resolving a program-derived address (PDA) if necessary
Trait Implementations§
source§impl Clone for ExtraAccountMeta
impl Clone for ExtraAccountMeta
source§fn clone(&self) -> ExtraAccountMeta
fn clone(&self) -> ExtraAccountMeta
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExtraAccountMeta
impl Debug for ExtraAccountMeta
source§impl Default for ExtraAccountMeta
impl Default for ExtraAccountMeta
source§fn default() -> ExtraAccountMeta
fn default() -> ExtraAccountMeta
source§impl From<&AccountInfo<'_>> for ExtraAccountMeta
impl From<&AccountInfo<'_>> for ExtraAccountMeta
source§fn from(account_info: &AccountInfo<'_>) -> Self
fn from(account_info: &AccountInfo<'_>) -> Self
source§impl From<&AccountMeta> for ExtraAccountMeta
impl From<&AccountMeta> for ExtraAccountMeta
source§fn from(meta: &AccountMeta) -> Self
fn from(meta: &AccountMeta) -> Self
source§impl From<AccountInfo<'_>> for ExtraAccountMeta
impl From<AccountInfo<'_>> for ExtraAccountMeta
source§fn from(account_info: AccountInfo<'_>) -> Self
fn from(account_info: AccountInfo<'_>) -> Self
source§impl From<AccountMeta> for ExtraAccountMeta
impl From<AccountMeta> for ExtraAccountMeta
source§fn from(meta: AccountMeta) -> Self
fn from(meta: AccountMeta) -> Self
source§impl PartialEq for ExtraAccountMeta
impl PartialEq for ExtraAccountMeta
source§fn eq(&self, other: &ExtraAccountMeta) -> bool
fn eq(&self, other: &ExtraAccountMeta) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<&ExtraAccountMeta> for AccountMeta
impl TryFrom<&ExtraAccountMeta> for AccountMeta
§type Error = ProgramError
type Error = ProgramError
impl Copy for ExtraAccountMeta
impl Pod for ExtraAccountMeta
impl StructuralPartialEq for ExtraAccountMeta
Auto Trait Implementations§
impl RefUnwindSafe for ExtraAccountMeta
impl Send for ExtraAccountMeta
impl Sync for ExtraAccountMeta
impl Unpin for ExtraAccountMeta
impl UnwindSafe for ExtraAccountMeta
Blanket Implementations§
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
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
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.