pub trait State: StateView {
// Required methods
fn add_public_key(
&mut self,
account_id: AccountId,
public_key: PublicKey,
) -> Result<()>;
fn remove_public_key(
&mut self,
account_id: AccountId,
public_key: PublicKey,
) -> Result<()>;
fn commit_nonce(
&mut self,
account_id: AccountId,
nonce: Nonce,
) -> Result<()>;
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<()>;
fn set_auth_by_predecessor_id(
&mut self,
account_id: AccountId,
enable: bool,
) -> Result<bool>;
// 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, ) -> Result<()>
fn remove_public_key( &mut self, account_id: AccountId, public_key: PublicKey, ) -> Result<()>
fn commit_nonce(&mut self, account_id: AccountId, nonce: Nonce) -> Result<()>
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<()>
Sourcefn set_auth_by_predecessor_id(
&mut self,
account_id: AccountId,
enable: bool,
) -> Result<bool>
fn set_auth_by_predecessor_id( &mut self, account_id: AccountId, enable: bool, ) -> Result<bool>
Sets whether authentication by PREDECESSOR_ID
is enabled.
Returns whether authentication by PREDECESSOR_ID
was enabled
before.
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.