Struct solana_program::account_info::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: Epoch,
}Expand description
Account information
Fields
key: &'a PubkeyPublic key of the account
is_signer: boolWas the transaction signed by this account’s public key?
is_writable: boolIs 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 PubkeyProgram that owns this account
executable: boolThis account’s data contains a loaded program (and is now read-only)
rent_epoch: EpochThe epoch at which this account will next owe rent
Implementations
impl<'a> AccountInfo<'a>[src]
impl<'a> AccountInfo<'a>[src]pub fn signer_key(&self) -> Option<&Pubkey>[src]
pub fn unsigned_key(&self) -> &Pubkey[src]
pub fn lamports(&self) -> u64[src]
pub fn try_lamports(&self) -> Result<u64, ProgramError>[src]
pub fn data_len(&self) -> usize[src]
pub fn try_data_len(&self) -> Result<usize, ProgramError>[src]
pub fn data_is_empty(&self) -> bool[src]
pub fn try_data_is_empty(&self) -> Result<bool, ProgramError>[src]
pub fn try_borrow_lamports(&self) -> Result<Ref<'_, &mut u64>, ProgramError>[src]
pub fn try_borrow_mut_lamports(
&self
) -> Result<RefMut<'_, &'a mut u64>, ProgramError>[src]
&self
) -> Result<RefMut<'_, &'a mut u64>, ProgramError>
pub fn try_borrow_data(&self) -> Result<Ref<'_, &mut [u8]>, ProgramError>[src]
pub fn try_borrow_mut_data(
&self
) -> Result<RefMut<'_, &'a mut [u8]>, ProgramError>[src]
&self
) -> Result<RefMut<'_, &'a mut [u8]>, ProgramError>
pub fn new(
key: &'a Pubkey,
is_signer: bool,
is_writable: bool,
lamports: &'a mut u64,
data: &'a mut [u8],
owner: &'a Pubkey,
executable: bool,
rent_epoch: Epoch
) -> Self[src]
key: &'a Pubkey,
is_signer: bool,
is_writable: bool,
lamports: &'a mut u64,
data: &'a mut [u8],
owner: &'a Pubkey,
executable: bool,
rent_epoch: Epoch
) -> Self
pub fn deserialize_data<T: DeserializeOwned>(&self) -> Result<T, Error>[src]
pub fn serialize_data<T: Serialize>(&mut self, state: &T) -> Result<(), Error>[src]
Trait Implementations
impl<'a> Clone for AccountInfo<'a>[src]
impl<'a> Clone for AccountInfo<'a>[src]fn clone(&self) -> AccountInfo<'a>[src]
fn clone(&self) -> AccountInfo<'a>[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl<'a> Debug for AccountInfo<'a>[src]
impl<'a> Debug for AccountInfo<'a>[src]impl<'a, T: IntoAccountInfo<'a>> From<T> for AccountInfo<'a>[src]
impl<'a, T: IntoAccountInfo<'a>> From<T> for AccountInfo<'a>[src]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
impl<T> AbiExample for T[src]
impl<T> AbiExample for T[src]impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,