pub struct Account(pub Account);Expand description
Per account information stored in the state.
Tuple Fields§
§0: AccountImplementations§
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: Balance, locked: Balance, code_hash: CryptoHash, storage_usage: StorageUsage, ) -> Self
Sourcepub fn code_hash(&self) -> CryptoHash
pub fn code_hash(&self) -> CryptoHash
CryptoHash: Hash of the code stored in the storage for this account.
Sourcepub fn storage_usage(&self) -> StorageUsage
pub fn storage_usage(&self) -> StorageUsage
int: Storage used by the given account, includes account id, this struct, access keys and other data.
Sourcepub fn version(&self) -> AccountVersion
pub fn version(&self) -> AccountVersion
AccountVersion: Version of Account in re migrations and similar
pub fn set_amount(&mut self, amount: Balance)
pub fn set_locked(&mut self, locked: Balance)
pub fn set_code_hash(&mut self, code_hash: CryptoHash)
pub fn set_storage_usage(&mut self, storage_usage: StorageUsage)
pub fn set_version(&mut self, version: AccountVersion)
pub fn __richcmp__(&self, other: &Self, op: CompareOp) -> PyResult<bool>
pub fn __bytes__<'a>(&self, py: Python<'a>) -> &'a PyBytes
pub fn __str__(&self) -> String
pub fn __repr__(&self) -> String
pub fn __reduce__(&self) -> PyResult<(PyObject, PyObject)>
Sourcepub fn from_bytes(data: &[u8]) -> PyResult<Self>
pub fn from_bytes(data: &[u8]) -> PyResult<Self>
Deserialize from bytes.
Args: data (bytes): the serialized object.
Returns: the deserialized object.
Trait Implementations§
Source§impl BorshDeserialize for Account
impl BorshDeserialize for Account
Source§impl BorshSerialize for Account
impl BorshSerialize for Account
Source§impl CommonMethods<'_> for Account
impl CommonMethods<'_> for Account
fn py_to_json(&self) -> String
fn py_from_json(raw: &'a str) -> Result<Self, PyErr>
Source§impl CommonMethodsCore for Account
impl CommonMethodsCore for Account
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
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§impl From<Account> for Account
impl From<Account> for Account
Source§fn from(original: AccountOriginal) -> Account
fn from(original: AccountOriginal) -> Account
Converts to this type from the input type.
Source§impl PyBytesBorsh for Account
impl PyBytesBorsh for Account
fn pybytes_borsh<'a>(&self, py: Python<'a>) -> &'a PyBytes
Source§impl PyBytesGeneral for Account
impl PyBytesGeneral for Account
fn pybytes_general<'a>(&self, py: Python<'a>) -> &'a PyBytes
Source§impl PyClassImpl for Account
impl PyClassImpl for Account
Source§const DOC: &'static str = "Per account information stored in the state.\u{0}"
const DOC: &'static str = "Per account information stored in the state.\u{0}"
Class doc string
Source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = ThreadCheckerStub<Account>
type ThreadChecker = ThreadCheckerStub<Account>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyFromBytesBorsh for Account
impl PyFromBytesBorsh for Account
fn py_from_bytes_borsh(raw: &[u8]) -> PyResult<Self>
Source§impl PyFromBytesGeneral for Account
impl PyFromBytesGeneral for Account
fn py_from_bytes_general(raw: &[u8]) -> PyResult<Self>
Source§impl PyMethods<Account> for PyClassImplCollector<Account>
impl PyMethods<Account> for PyClassImplCollector<Account>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Account
impl PyTypeInfo for Account
Source§type AsRefTarget = PyCell<Account>
type AsRefTarget = PyCell<Account>
Utility type to make Py::as_ref work.
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
Source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type or a subclass of this type.Source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type.Source§impl RichcmpEqualityOnly for Account
impl RichcmpEqualityOnly for Account
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> 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<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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<'a, T> FromPyObject<'a> for T
impl<'a, T> FromPyObject<'a> for T
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