multiversx_sc_modules::users

Struct ContractObj

Source
pub struct ContractObj<A>(/* private fields */)
where
    A: VMApi;

Trait Implementations§

Source§

impl<A> CallableContract for ContractObj<A>
where A: VMApi + Send + Sync,

Source§

fn call(&self, fn_name: &str) -> bool

Source§

impl<A> ContractBase for ContractObj<A>
where A: VMApi,

Source§

type Api = A

Source§

fn call_value(&self) -> CallValueWrapper<Self::Api>

Gateway into the call value retrieval functionality. The payment annotations should normally be the ones to handle this, but the developer is also given direct access to the API.
Source§

fn send(&self) -> SendWrapper<Self::Api>

Gateway to the functionality related to sending transactions from the current contract.
Source§

fn tx(&self) -> Tx<TxScEnv<Self::Api>, (), (), (), (), (), ()>

Starts the declaration of a new transaction.
Source§

fn send_raw(&self) -> SendRawWrapper<Self::Api>

Low-level functionality related to sending transactions from the current contract. Read more
Source§

fn blockchain(&self) -> BlockchainWrapper<Self::Api>

Gateway blockchain info related to the current transaction and to accounts.
Source§

fn crypto(&self) -> CryptoWrapper<Self::Api>

Stateless crypto functions provided by the Arwen VM.
Source§

fn serializer(&self) -> ManagedSerializer<Self::Api>

Component that provides contract developers access to highly optimized manual serialization and deserialization.
Source§

fn error(&self) -> ErrorHelper<Self::Api>

Source§

fn storage_raw(&self) -> StorageRawWrapper<Self::Api>

Source§

impl<A> EndpointWrappers for ContractObj<A>
where A: VMApi,

Source§

fn call_get_user_id(&mut self)

Source§

fn call_get_user_address(&mut self)

Source§

fn call_get_num_users(&mut self)

Source§

fn call_update_user_address(&mut self)

Source§

fn call(&mut self, fn_name: &str) -> bool

Source§

fn callback_selector( &mut self, ___cb_closure___: &CallbackClosureForDeser<Self::Api>, ) -> CallbackSelectorResult

Source§

fn callback(&mut self)

Source§

impl<A> AutoImpl for ContractObj<A>
where A: VMApi,

Auto Trait Implementations§

§

impl<A> Freeze for ContractObj<A>

§

impl<A> RefUnwindSafe for ContractObj<A>
where A: RefUnwindSafe,

§

impl<A> Send for ContractObj<A>

§

impl<A> Sync for ContractObj<A>

§

impl<A> Unpin for ContractObj<A>
where A: Unpin,

§

impl<A> UnwindSafe for ContractObj<A>
where A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn get_user_id( &self, address: &ManagedAddress<<C as ContractBase>::Api>, ) -> usize

Each user gets a user id. This is in order to be able to iterate over their data. This is a mapping from user address to user id. The key is the bytes “user_id” concatenated with their public key. The value is the user id.

Source§

fn get_num_users(&self) -> usize

Retrieves the number of delegtors, including the owner, even if they no longer have anything in the contract.

Source§

fn set_num_users(&self, num_users: usize)

Yields how accounts are registered in the contract. Note that not all of them must have stakes greater than zero.

Source§

fn set_user_id( &self, address: &ManagedAddress<<C as ContractBase>::Api>, user_id: usize, )

Source§

fn get_user_address( &self, user_id: usize, ) -> ManagedAddress<<C as ContractBase>::Api>

Source§

fn set_user_address( &self, user_id: usize, address: &ManagedAddress<<C as ContractBase>::Api>, )

Source§

fn get_or_create_user(&self, address: &ManagedAddress<Self::Api>) -> usize

Source§

fn update_user_address( &self, addresses: MultiValueEncoded<Self::Api, ManagedAddress<Self::Api>>, )