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 reserve(&mut self, additional: usize)
pub fn capacity(&self) -> usize
pub fn resize(&mut self, new_len: usize, value: u8)
pub fn extend_from_slice(&mut self, data: &[u8])
pub fn set_data_from_slice(&mut self, new_data: &[u8])
pub fn spare_data_capacity_mut(&mut self) -> &mut [MaybeUninit<u8>]
pub fn new(lamports: u64, space: usize, owner: &Pubkey) -> AccountSharedData
pub fn new_ref( lamports: u64, space: usize, owner: &Pubkey, ) -> Rc<RefCell<AccountSharedData>>
pub fn new_data<T>(
lamports: u64,
state: &T,
owner: &Pubkey,
) -> Result<AccountSharedData, Box<ErrorKind>>where
T: Serialize,
pub fn new_ref_data<T>(
lamports: u64,
state: &T,
owner: &Pubkey,
) -> Result<RefCell<AccountSharedData>, Box<ErrorKind>>where
T: Serialize,
pub fn new_data_with_space<T>(
lamports: u64,
state: &T,
space: usize,
owner: &Pubkey,
) -> Result<AccountSharedData, Box<ErrorKind>>where
T: Serialize,
pub fn new_ref_data_with_space<T>(
lamports: u64,
state: &T,
space: usize,
owner: &Pubkey,
) -> Result<RefCell<AccountSharedData>, Box<ErrorKind>>where
T: Serialize,
pub fn new_rent_epoch( lamports: u64, space: usize, owner: &Pubkey, rent_epoch: u64, ) -> AccountSharedData
pub fn deserialize_data<T>(&self) -> Result<T, Box<ErrorKind>>where
T: DeserializeOwned,
pub fn serialize_data<T>(&mut self, state: &T) -> Result<(), Box<ErrorKind>>where
T: Serialize,
Trait Implementations§
fn example() -> AccountSharedData
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<AccountSharedData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountSharedData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§fn from(other: Account) -> AccountSharedData
fn from(other: Account) -> AccountSharedData
Converts to this type from the input type.
Source§fn from(account: VoteAccount) -> AccountSharedData
fn from(account: VoteAccount) -> AccountSharedData
Converts to this type from the input type.
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
fn set_lamports(&mut self, lamports: u64)
fn data_as_mut_slice(&mut self) -> &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: u64)
fn create( lamports: u64, data: Vec<u8>, owner: Pubkey, executable: bool, rent_epoch: u64, ) -> AccountSharedData
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)
fn is_zero_lamport(&self) -> bool
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more