pub trait State: StateView {
// Required methods
fn add_public_key(
&mut self,
account_id: AccountId,
public_key: PublicKey,
) -> bool;
fn remove_public_key(
&mut self,
account_id: AccountId,
public_key: PublicKey,
) -> bool;
fn commit_nonce(&mut self, account_id: AccountId, nonce: Nonce) -> bool;
fn internal_add_balance(
&mut self,
owner_id: AccountId,
tokens: impl IntoIterator<Item = (TokenId, u128)>,
) -> Result<()>;
fn internal_sub_balance(
&mut self,
owner_id: &AccountIdRef,
tokens: impl IntoIterator<Item = (TokenId, u128)>,
) -> Result<()>;
fn ft_withdraw(
&mut self,
owner_id: &AccountIdRef,
withdraw: FtWithdraw,
) -> Result<()>;
fn nft_withdraw(
&mut self,
owner_id: &AccountIdRef,
withdraw: NftWithdraw,
) -> Result<()>;
fn mt_withdraw(
&mut self,
owner_id: &AccountIdRef,
withdraw: MtWithdraw,
) -> Result<()>;
fn native_withdraw(
&mut self,
owner_id: &AccountIdRef,
withdraw: NativeWithdraw,
) -> Result<()>;
fn storage_deposit(
&mut self,
owner_id: &AccountIdRef,
storage_deposit: StorageDeposit,
) -> Result<()>;
// Provided method
fn internal_apply_deltas(
&mut self,
owner_id: &AccountIdRef,
tokens: impl IntoIterator<Item = (TokenId, i128)>,
) -> Result<()> { ... }
}
Required Methods§
fn add_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> bool
fn remove_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> bool
fn commit_nonce(&mut self, account_id: AccountId, nonce: Nonce) -> bool
fn internal_add_balance( &mut self, owner_id: AccountId, tokens: impl IntoIterator<Item = (TokenId, u128)>, ) -> Result<()>
fn internal_sub_balance( &mut self, owner_id: &AccountIdRef, tokens: impl IntoIterator<Item = (TokenId, u128)>, ) -> Result<()>
fn ft_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: FtWithdraw, ) -> Result<()>
fn nft_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: NftWithdraw, ) -> Result<()>
fn mt_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: MtWithdraw, ) -> Result<()>
fn native_withdraw( &mut self, owner_id: &AccountIdRef, withdraw: NativeWithdraw, ) -> Result<()>
fn storage_deposit( &mut self, owner_id: &AccountIdRef, storage_deposit: StorageDeposit, ) -> Result<()>
Provided Methods§
fn internal_apply_deltas( &mut self, owner_id: &AccountIdRef, tokens: impl IntoIterator<Item = (TokenId, i128)>, ) -> Result<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.