Trait StateView

Source
pub trait StateView {
    // Required methods
    fn verifying_contract(&self) -> Cow<'_, AccountIdRef>;
    fn wnear_id(&self) -> Cow<'_, AccountIdRef>;
    fn fee(&self) -> Pips;
    fn fee_collector(&self) -> Cow<'_, AccountIdRef>;
    fn has_public_key(
        &self,
        account_id: &AccountIdRef,
        public_key: &PublicKey,
    ) -> bool;
    fn iter_public_keys(
        &self,
        account_id: &AccountIdRef,
    ) -> impl Iterator<Item = PublicKey> + '_;
    fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool;
    fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128;
    fn is_account_locked(&self, account_id: &AccountIdRef) -> bool;
    fn is_auth_by_predecessor_id_enabled(
        &self,
        account_id: &AccountIdRef,
    ) -> bool;

    // Provided methods
    fn wnear_token_id(&self) -> TokenId { ... }
    fn cached(self) -> CachedState<Self>
       where Self: Sized { ... }
}

Required Methods§

Source

fn verifying_contract(&self) -> Cow<'_, AccountIdRef>

Source

fn wnear_id(&self) -> Cow<'_, AccountIdRef>

Source

fn fee(&self) -> Pips

Source

fn fee_collector(&self) -> Cow<'_, AccountIdRef>

Source

fn has_public_key( &self, account_id: &AccountIdRef, public_key: &PublicKey, ) -> bool

Source

fn iter_public_keys( &self, account_id: &AccountIdRef, ) -> impl Iterator<Item = PublicKey> + '_

Source

fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool

Source

fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128

Source

fn is_account_locked(&self, account_id: &AccountIdRef) -> bool

Source

fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool

Returns whether authentication by PREDECESSOR_ID is enabled.

Provided Methods§

Source

fn wnear_token_id(&self) -> TokenId

Source

fn cached(self) -> CachedState<Self>
where Self: Sized,

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.

Implementations on Foreign Types§

Source§

impl<T: StateView + ?Sized> StateView for &T

Source§

fn verifying_contract(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_id(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_token_id(&self) -> TokenId

Source§

fn fee(&self) -> Pips

Source§

fn fee_collector(&self) -> Cow<'_, AccountIdRef>

Source§

fn has_public_key( &self, account_id: &AccountIdRef, public_key: &PublicKey, ) -> bool

Source§

fn iter_public_keys( &self, account_id: &AccountIdRef, ) -> impl Iterator<Item = PublicKey> + '_

Source§

fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool

Source§

fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128

Source§

fn is_account_locked(&self, account_id: &AccountIdRef) -> bool

Source§

fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool

Source§

impl<T: StateView + ?Sized> StateView for &mut T

Source§

fn verifying_contract(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_id(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_token_id(&self) -> TokenId

Source§

fn fee(&self) -> Pips

Source§

fn fee_collector(&self) -> Cow<'_, AccountIdRef>

Source§

fn has_public_key( &self, account_id: &AccountIdRef, public_key: &PublicKey, ) -> bool

Source§

fn iter_public_keys( &self, account_id: &AccountIdRef, ) -> impl Iterator<Item = PublicKey> + '_

Source§

fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool

Source§

fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128

Source§

fn is_account_locked(&self, account_id: &AccountIdRef) -> bool

Source§

fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool

Source§

impl<T: StateView + ?Sized> StateView for Box<T>

Source§

fn verifying_contract(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_id(&self) -> Cow<'_, AccountIdRef>

Source§

fn wnear_token_id(&self) -> TokenId

Source§

fn fee(&self) -> Pips

Source§

fn fee_collector(&self) -> Cow<'_, AccountIdRef>

Source§

fn has_public_key( &self, account_id: &AccountIdRef, public_key: &PublicKey, ) -> bool

Source§

fn iter_public_keys( &self, account_id: &AccountIdRef, ) -> impl Iterator<Item = PublicKey> + '_

Source§

fn is_nonce_used(&self, account_id: &AccountIdRef, nonce: Nonce) -> bool

Source§

fn balance_of(&self, account_id: &AccountIdRef, token_id: &TokenId) -> u128

Source§

fn is_account_locked(&self, account_id: &AccountIdRef) -> bool

Source§

fn is_auth_by_predecessor_id_enabled(&self, account_id: &AccountIdRef) -> bool

Implementors§

Source§

impl<S> StateView for Deltas<S>
where S: StateView,

Source§

impl<W> StateView for CachedState<W>
where W: StateView,