multiversx_sc_modules::only_admin

Trait OnlyAdminModule

Source
pub trait OnlyAdminModule: ContractBase + Sized {
    // Required method
    fn admins(&self) -> UnorderedSetMapper<Self::Api, ManagedAddress<Self::Api>>;

    // Provided methods
    fn is_admin(&self, address: ManagedAddress<Self::Api>) -> bool { ... }
    fn add_admin(&self, address: ManagedAddress<Self::Api>) { ... }
    fn remove_admin(&self, address: ManagedAddress<Self::Api>) { ... }
    fn require_caller_is_admin(&self) { ... }
}

Required Methods§

Provided Methods§

Source

fn is_admin(&self, address: ManagedAddress<Self::Api>) -> bool

Source

fn add_admin(&self, address: ManagedAddress<Self::Api>)

Source

fn remove_admin(&self, address: ManagedAddress<Self::Api>)

Source

fn require_caller_is_admin(&self)

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.

Implementors§

Source§

impl<C> OnlyAdminModule for C
where C: AutoImpl,