Struct solana_sdk::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: u64,
}

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

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]

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]

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: u64
) -> AccountInfo<'a>
[src]

pub fn deserialize_data<T>(&self) -> Result<T, Box<ErrorKind, Global>> where
    T: DeserializeOwned
[src]

pub fn serialize_data<T>(
    &mut self,
    state: &T
) -> Result<(), Box<ErrorKind, Global>> where
    T: Serialize
[src]

Trait Implementations

impl<'a> Clone for AccountInfo<'a>[src]

impl<'a> Debug for AccountInfo<'a>[src]

impl<'a, T> From<T> for AccountInfo<'a> where
    T: IntoAccountInfo<'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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeDebug for T where
    T: Debug
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]