Struct near_primitives::account::Account
source · pub struct Account { /* private fields */ }
Expand description
Per account information stored in the state.
Implementations§
source§impl Account
impl Account
sourcepub const MAX_ACCOUNT_DELETION_STORAGE_USAGE: u64 = 10_000u64
pub const MAX_ACCOUNT_DELETION_STORAGE_USAGE: u64 = 10_000u64
Max number of bytes an account can have in its state (excluding contract code) before it is infeasible to delete.
pub fn new( amount: u128, locked: u128, code_hash: CryptoHash, storage_usage: u64 ) -> Account
pub fn amount(&self) -> u128
pub fn locked(&self) -> u128
pub fn code_hash(&self) -> CryptoHash
pub fn storage_usage(&self) -> u64
pub fn version(&self) -> AccountVersion
pub fn set_amount(&mut self, amount: u128)
pub fn set_locked(&mut self, locked: u128)
pub fn set_code_hash(&mut self, code_hash: CryptoHash)
pub fn set_storage_usage(&mut self, storage_usage: u64)
pub fn set_version(&mut self, version: AccountVersion)
Trait Implementations§
source§impl BorshDeserialize for Account
impl BorshDeserialize for Account
fn deserialize_reader<R>(rd: &mut R) -> Result<Account, Error>where
R: Read,
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for Account
impl BorshSerialize for Account
source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Account, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Account, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&Account> for AccountView
impl From<&Account> for AccountView
source§impl From<&AccountView> for Account
impl From<&AccountView> for Account
source§fn from(view: &AccountView) -> Self
fn from(view: &AccountView) -> Self
Converts to this type from the input type.
source§impl From<Account> for AccountView
impl From<Account> for AccountView
source§impl From<AccountView> for Account
impl From<AccountView> for Account
source§fn from(view: AccountView) -> Self
fn from(view: AccountView) -> Self
Converts to this type from the input type.
source§impl PartialEq for Account
impl PartialEq for Account
source§impl Serialize for Account
impl Serialize for Account
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
impl Eq for Account
impl StructuralPartialEq for Account
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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§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