Struct solana_sdk::account::Account [−][src]
#[repr(C)]pub struct Account { pub lamports: u64, pub data: Vec<u8>, pub owner: Pubkey, pub executable: bool, pub rent_epoch: Epoch, }
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: Epoch
the epoch at which this account will next owe rent
Implementations
impl Account
[src]
impl Account
[src]pub fn new(lamports: u64, space: usize, owner: &Pubkey) -> Self
[src]
pub fn new_ref(lamports: u64, space: usize, owner: &Pubkey) -> Rc<RefCell<Self>>
[src]
pub fn new_data<T: Serialize>(
lamports: u64,
state: &T,
owner: &Pubkey
) -> Result<Self, Error>
[src]
lamports: u64,
state: &T,
owner: &Pubkey
) -> Result<Self, Error>
pub fn new_ref_data<T: Serialize>(
lamports: u64,
state: &T,
owner: &Pubkey
) -> Result<RefCell<Self>, Error>
[src]
lamports: u64,
state: &T,
owner: &Pubkey
) -> Result<RefCell<Self>, Error>
pub fn new_data_with_space<T: Serialize>(
lamports: u64,
state: &T,
space: usize,
owner: &Pubkey
) -> Result<Self, Error>
[src]
lamports: u64,
state: &T,
space: usize,
owner: &Pubkey
) -> Result<Self, Error>
pub fn new_ref_data_with_space<T: Serialize>(
lamports: u64,
state: &T,
space: usize,
owner: &Pubkey
) -> Result<RefCell<Self>, Error>
[src]
lamports: u64,
state: &T,
space: usize,
owner: &Pubkey
) -> Result<RefCell<Self>, Error>
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 AbiExample for Account
[src]
impl AbiExample for Account
[src]impl Account for Account
[src]
impl Account for Account
[src]Return the information required to construct an AccountInfo
. Used by the
AccountInfo
conversion implementations.
impl<'de> Deserialize<'de> for Account
[src]
impl<'de> Deserialize<'de> for Account
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<AccountSharedData> for Account
[src]
impl From<AccountSharedData> for Account
[src]fn from(other: AccountSharedData) -> Self
[src]
impl ReadableAccount for Account
[src]
impl ReadableAccount for Account
[src]impl<T> StateMut<T> for Account where
T: Serialize + DeserializeOwned,
[src]
impl<T> StateMut<T> for Account where
T: Serialize + DeserializeOwned,
[src]fn state(&self) -> Result<T, InstructionError>
[src]
fn set_state(&mut self, state: &T) -> Result<(), InstructionError>
[src]
impl StructuralEq for Account
[src]
impl StructuralEq for Account
[src]impl StructuralPartialEq for Account
[src]
impl StructuralPartialEq for Account
[src]impl WritableAccount for Account
[src]
impl WritableAccount for Account
[src]fn set_lamports(&mut self, lamports: u64)
[src]
fn data_as_mut_slice(&mut self) -> &mut [u8]ⓘ
[src]
fn set_owner(&mut self, owner: Pubkey)
[src]
fn set_executable(&mut self, executable: bool)
[src]
fn set_rent_epoch(&mut self, epoch: Epoch)
[src]
fn create(
lamports: u64,
data: Vec<u8>,
owner: Pubkey,
executable: bool,
rent_epoch: Epoch
) -> Self
[src]
lamports: u64,
data: Vec<u8>,
owner: Pubkey,
executable: bool,
rent_epoch: Epoch
) -> Self
Auto Trait Implementations
impl RefUnwindSafe for Account
impl RefUnwindSafe for Account
impl UnwindSafe for Account
impl UnwindSafe for Account
Blanket Implementations
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
[src]
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
[src]pub default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
[src]
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
[src]pub default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
[src]
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
impl<T> AbiExample for T
[src]
impl<T> AbiExample for T
[src]impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,