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
sourceimpl AccountSharedData
impl AccountSharedData
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
sourceimpl AbiExample for AccountSharedData
impl AbiExample for AccountSharedData
sourceimpl Clone for AccountSharedData
impl Clone for AccountSharedData
sourcefn clone(&self) -> AccountSharedData
fn clone(&self) -> AccountSharedData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AccountSharedData
impl Debug for AccountSharedData
sourceimpl Default for AccountSharedData
impl Default for AccountSharedData
sourcefn default() -> AccountSharedData
fn default() -> AccountSharedData
Returns the “default value” for a type. Read more
sourceimpl From<Account> for AccountSharedData
impl From<Account> for AccountSharedData
sourcefn from(other: AccountSharedData) -> Self
fn from(other: AccountSharedData) -> Self
Converts to this type from the input type.
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &AccountSharedData) -> bool
fn ne(&self, other: &AccountSharedData) -> bool
This method tests for !=
.
sourceimpl ReadableAccount for AccountSharedData
impl ReadableAccount for AccountSharedData
sourceimpl Serialize for AccountSharedData
impl Serialize for AccountSharedData
sourceimpl<T> StateMut<T> for AccountSharedData where
T: Serialize + DeserializeOwned,
impl<T> StateMut<T> for AccountSharedData where
T: Serialize + DeserializeOwned,
fn state(&self) -> Result<T, InstructionError>
fn set_state(&mut self, state: &T) -> Result<(), InstructionError>
sourceimpl WritableAccount for AccountSharedData
impl WritableAccount for AccountSharedData
fn set_lamports(&mut self, lamports: u64)
fn data_mut(&mut self) -> &mut Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn data_as_mut_slice(&mut self) -> &mut [u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
fn set_owner(&mut self, owner: Pubkey)
fn copy_into_owner_from_slice(&mut self, source: &[u8])
fn set_executable(&mut self, executable: bool)
fn set_rent_epoch(&mut self, epoch: Epoch)
fn create(
lamports: u64,
data: Vec<u8>,
owner: Pubkey,
executable: bool,
rent_epoch: Epoch
) -> Self
fn checked_add_lamports(&mut self, lamports: u64) -> Result<(), LamportsError>
fn checked_sub_lamports(&mut self, lamports: u64) -> Result<(), LamportsError>
fn saturating_add_lamports(&mut self, lamports: u64)
fn saturating_sub_lamports(&mut self, lamports: u64)
impl Eq for AccountSharedData
impl StructuralEq for AccountSharedData
impl StructuralPartialEq for AccountSharedData
Auto Trait Implementations
impl RefUnwindSafe for AccountSharedData
impl Send for AccountSharedData
impl Sync for AccountSharedData
impl Unpin for AccountSharedData
impl UnwindSafe for AccountSharedData
Blanket Implementations
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + ?Sized,
default fn visit_for_abi(
&self,
_digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
impl<T> AbiEnumVisitor for T where
T: Serialize + AbiExample + ?Sized,
default fn visit_for_abi(
&self,
digester: &mut AbiDigester
) -> Result<AbiDigester, DigestError>
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more