[][src]Struct solana_sdk::account::Account

#[repr(C)]pub struct Account {
    pub lamports: u64,
    pub data: Vec<u8>,
    pub owner: Pubkey,
    pub executable: bool,
    pub rent_epoch: u64,
}

An Account with data that is stored on chain

Fields

lamports: u64

lamports in the account

data: Vec<u8>

data held in this account

owner: Pubkey

the program that owns this account. If executable, the program that loads 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 Account[src]

pub fn new(lamports: u64, space: usize, owner: &Pubkey) -> Account[src]

pub fn new_ref(
    lamports: u64,
    space: usize,
    owner: &Pubkey
) -> Rc<RefCell<Account>>
[src]

pub fn new_data<T>(
    lamports: u64,
    state: &T,
    owner: &Pubkey
) -> Result<Account, Box<ErrorKind>> where
    T: Serialize
[src]

pub fn new_ref_data<T>(
    lamports: u64,
    state: &T,
    owner: &Pubkey
) -> Result<RefCell<Account>, Box<ErrorKind>> where
    T: Serialize
[src]

pub fn new_data_with_space<T>(
    lamports: u64,
    state: &T,
    space: usize,
    owner: &Pubkey
) -> Result<Account, Box<ErrorKind>> where
    T: Serialize
[src]

pub fn new_ref_data_with_space<T>(
    lamports: u64,
    state: &T,
    space: usize,
    owner: &Pubkey
) -> Result<RefCell<Account>, Box<ErrorKind>> where
    T: Serialize
[src]

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

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

Trait Implementations

impl AbiExample for Account[src]

impl Clone for Account[src]

impl Debug for Account[src]

impl Default for Account[src]

impl<'de> Deserialize<'de> for Account[src]

impl Eq for Account[src]

impl PartialEq<Account> for Account[src]

impl Serialize for Account[src]

impl<T> StateMut<T> for Account where
    T: Serialize + DeserializeOwned
[src]

impl StructuralEq for Account[src]

impl StructuralPartialEq for Account[src]

Auto Trait Implementations

impl RefUnwindSafe for Account

impl Send for Account

impl Sync for Account

impl Unpin for Account

impl UnwindSafe for Account

Blanket Implementations

impl<T> AbiEnumVisitor for T where
    T: AbiExample + Serialize + ?Sized
[src]

impl<T> AbiEnumVisitor for T where
    T: Serialize + ?Sized
[src]

impl<T> AbiExample for T[src]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,