Struct solana_sdk::account::AccountSharedData
source · pub struct AccountSharedData { /* private fields */ }
Expand description
An Account with data that is stored on chain This will be the in-memory representation of the ‘Account’ struct data. The existing ‘Account’ structure cannot easily change due to downstream projects.
Implementations§
pub fn set_data_from_slice(&mut self, data: &[u8])
pub fn set_data(&mut self, data: Vec<u8>)
pub fn new(lamports: u64, space: usize, owner: &Pubkey) -> Self
pub fn new_ref(lamports: u64, space: usize, owner: &Pubkey) -> Rc<RefCell<Self>>
pub fn new_data<T: Serialize>( 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>
pub fn new_data_with_space<T: Serialize>( 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>
pub fn new_rent_epoch( lamports: u64, space: usize, owner: &Pubkey, rent_epoch: Epoch ) -> Self
pub fn deserialize_data<T: DeserializeOwned>(&self) -> Result<T, Error>
pub fn serialize_data<T: Serialize>(&mut self, state: &T) -> Result<(), Error>
Trait Implementations§
source§fn clone(&self) -> AccountSharedData
fn clone(&self) -> AccountSharedData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§fn default() -> AccountSharedData
fn default() -> AccountSharedData
Returns the “default value” for a type. Read more
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§fn from(other: AccountSharedData) -> Self
fn from(other: AccountSharedData) -> Self
Converts to this type from the input type.
source§fn eq(&self, other: &AccountSharedData) -> bool
fn eq(&self, other: &AccountSharedData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.