Struct switchboard_aggregator::AccountInfo [−][src]
pub struct AccountInfo<'a> {
pub key: &'a Pubkey,
pub is_signer: bool,
pub is_writable: bool,
pub lamports: Rc<RefCell<&'a mut u64>>,
pub data: Rc<RefCell<&'a mut [u8]>>,
pub owner: &'a Pubkey,
pub executable: bool,
pub rent_epoch: u64,
}
Expand description
Account information
Fields
key: &'a Pubkey
Public key of the account
is_signer: bool
Was the transaction signed by this account’s public key?
is_writable: bool
Is the account writable?
lamports: Rc<RefCell<&'a mut u64>>
The lamports in the account. Modifiable by programs.
data: Rc<RefCell<&'a mut [u8]>>
The data held in this account. Modifiable by programs.
owner: &'a Pubkey
Program that owns this account
executable: bool
This account’s data contains a loaded program (and is now read-only)
rent_epoch: u64
The epoch at which this account will next owe rent
Implementations
Trait Implementations
pub fn try_accounts(
_program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
_ix_data: &[u8]
) -> Result<AccountInfo<'info>, ProgramError>
pub fn try_accounts(
_program_id: &Pubkey,
accounts: &mut &[AccountInfo<'info>],
_ix_data: &[u8]
) -> Result<AccountInfo<'info>, ProgramError>
Returns the validated accounts struct. What constitutes “valid” is
program dependent. However, users of these types should never have to
worry about account substitution attacks. For example, if a program
expects a Mint
account from the SPL token program in a particular
field, then it should be impossible for this method to return Ok
if
any other account type is given–from the SPL token program or elsewhere. Read more
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for ProgramState<'info, T> where
T: AccountSerialize + AccountDeserialize + Clone,
impl<'info, T> AsRef<AccountInfo<'info>> for ProgramState<'info, T> where
T: AccountSerialize + AccountDeserialize + Clone,
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for ProgramAccount<'info, T> where
T: AccountSerialize + AccountDeserialize + Clone,
impl<'info, T> AsRef<AccountInfo<'info>> for ProgramAccount<'info, T> where
T: AccountSerialize + AccountDeserialize + Clone,
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for Account<'info, T> where
T: AccountSerialize + AccountDeserialize + Owner + Clone,
impl<'info, T> AsRef<AccountInfo<'info>> for Account<'info, T> where
T: AccountSerialize + AccountDeserialize + Owner + Clone,
Performs the conversion.
Performs the conversion.
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for CpiAccount<'info, T> where
T: AccountDeserialize + Clone,
impl<'info, T> AsRef<AccountInfo<'info>> for CpiAccount<'info, T> where
T: AccountDeserialize + Clone,
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for AccountLoader<'info, T> where
T: ZeroCopy + Owner,
impl<'info, T> AsRef<AccountInfo<'info>> for AccountLoader<'info, T> where
T: ZeroCopy + Owner,
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for Program<'info, T> where
T: Id + AccountDeserialize + Clone,
impl<'info, T> AsRef<AccountInfo<'info>> for Program<'info, T> where
T: Id + AccountDeserialize + Clone,
Performs the conversion.
Performs the conversion.
impl<'info, T> AsRef<AccountInfo<'info>> for CpiState<'info, T> where
T: AccountSerialize + AccountDeserialize + Clone,
impl<'info, T> AsRef<AccountInfo<'info>> for CpiState<'info, T> where
T: AccountSerialize + AccountDeserialize + Clone,
Performs the conversion.
Performs the conversion.
is_signer
is given as an optional override for the signer meta field.
This covers the edge case when a program-derived-address needs to relay
a transaction from a client to another program but sign the transaction
before the relay. The client cannot mark the field as a signer, and so
we have to override the is_signer meta field given by the client. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for AccountInfo<'a>
impl<'a> !Send for AccountInfo<'a>
impl<'a> !Sync for AccountInfo<'a>
impl<'a> Unpin for AccountInfo<'a>
impl<'a> !UnwindSafe for AccountInfo<'a>
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more