pub struct UsersModuleImpl<T, BigInt, BigUint>
where for<'b> BigUint: BigUintApi + 'static + AddAssign<&'b BigUint> + SubAssign<&'b BigUint> + MulAssign<&'b BigUint> + DivAssign<&'b BigUint> + RemAssign<&'b BigUint> + BitAndAssign<&'b BigUint> + BitOrAssign<&'b BigUint> + BitXorAssign<&'b BigUint>, for<'a, 'b> &'a BigUint: Add<&'b BigUint, Output = BigUint> + Sub<&'b BigUint, Output = BigUint> + Mul<&'b BigUint, Output = BigUint> + Div<&'b BigUint, Output = BigUint> + Rem<&'b BigUint, Output = BigUint> + BitAnd<&'b BigUint, Output = BigUint> + BitOr<&'b BigUint, Output = BigUint> + BitXor<&'b BigUint, Output = BigUint> + Shr<usize, Output = BigUint> + Shl<usize, Output = BigUint>, for<'b> BigInt: BigIntApi<BigUint> + 'static + AddAssign<&'b BigInt> + SubAssign<&'b BigInt> + MulAssign<&'b BigInt> + DivAssign<&'b BigInt> + RemAssign<&'b BigInt>, for<'a, 'b> &'a BigInt: Add<&'b BigInt, Output = BigInt> + Sub<&'b BigInt, Output = BigInt> + Mul<&'b BigInt, Output = BigInt> + Div<&'b BigInt, Output = BigInt> + Rem<&'b BigInt, Output = BigInt>, T: ContractSelfApi<BigInt, BigUint> + ErrorApi + BlockchainApi<BigUint> + CallValueApi<BigUint> + SendApi<BigUint> + EndpointArgumentApi + EndpointFinishApi + StorageReadApi + StorageWriteApi + CryptoApi + LogApi + Clone + 'static,
{ /* private fields */ }

Implementations§

source§

impl<T, BigInt, BigUint> UsersModuleImpl<T, BigInt, BigUint>
where for<'b> BigUint: BigUintApi + 'static + AddAssign<&'b BigUint> + SubAssign<&'b BigUint> + MulAssign<&'b BigUint> + DivAssign<&'b BigUint> + RemAssign<&'b BigUint> + BitAndAssign<&'b BigUint> + BitOrAssign<&'b BigUint> + BitXorAssign<&'b BigUint>, for<'a, 'b> &'a BigUint: Add<&'b BigUint, Output = BigUint> + Sub<&'b BigUint, Output = BigUint> + Mul<&'b BigUint, Output = BigUint> + Div<&'b BigUint, Output = BigUint> + Rem<&'b BigUint, Output = BigUint> + BitAnd<&'b BigUint, Output = BigUint> + BitOr<&'b BigUint, Output = BigUint> + BitXor<&'b BigUint, Output = BigUint> + Shr<usize, Output = BigUint> + Shl<usize, Output = BigUint>, for<'b> BigInt: BigIntApi<BigUint> + 'static + AddAssign<&'b BigInt> + SubAssign<&'b BigInt> + MulAssign<&'b BigInt> + DivAssign<&'b BigInt> + RemAssign<&'b BigInt>, for<'a, 'b> &'a BigInt: Add<&'b BigInt, Output = BigInt> + Sub<&'b BigInt, Output = BigInt> + Mul<&'b BigInt, Output = BigInt> + Div<&'b BigInt, Output = BigInt> + Rem<&'b BigInt, Output = BigInt>, T: ContractSelfApi<BigInt, BigUint> + ErrorApi + BlockchainApi<BigUint> + CallValueApi<BigUint> + SendApi<BigUint> + EndpointArgumentApi + EndpointFinishApi + StorageReadApi + StorageWriteApi + CryptoApi + LogApi + Clone + 'static,

source

pub fn new(api: T) -> Self

Trait Implementations§

source§

impl<T, BigInt, BigUint> CallableContract<T> for UsersModuleImpl<T, BigInt, BigUint>
where for<'b> BigUint: BigUintApi + 'static + AddAssign<&'b BigUint> + SubAssign<&'b BigUint> + MulAssign<&'b BigUint> + DivAssign<&'b BigUint> + RemAssign<&'b BigUint> + BitAndAssign<&'b BigUint> + BitOrAssign<&'b BigUint> + BitXorAssign<&'b BigUint>, for<'a, 'b> &'a BigUint: Add<&'b BigUint, Output = BigUint> + Sub<&'b BigUint, Output = BigUint> + Mul<&'b BigUint, Output = BigUint> + Div<&'b BigUint, Output = BigUint> + Rem<&'b BigUint, Output = BigUint> + BitAnd<&'b BigUint, Output = BigUint> + BitOr<&'b BigUint, Output = BigUint> + BitXor<&'b BigUint, Output = BigUint> + Shr<usize, Output = BigUint> + Shl<usize, Output = BigUint>, for<'b> BigInt: BigIntApi<BigUint> + 'static + AddAssign<&'b BigInt> + SubAssign<&'b BigInt> + MulAssign<&'b BigInt> + DivAssign<&'b BigInt> + RemAssign<&'b BigInt>, for<'a, 'b> &'a BigInt: Add<&'b BigInt, Output = BigInt> + Sub<&'b BigInt, Output = BigInt> + Mul<&'b BigInt, Output = BigInt> + Div<&'b BigInt, Output = BigInt> + Rem<&'b BigInt, Output = BigInt>, T: ContractSelfApi<BigInt, BigUint> + ErrorApi + BlockchainApi<BigUint> + CallValueApi<BigUint> + SendApi<BigUint> + EndpointArgumentApi + EndpointFinishApi + StorageReadApi + StorageWriteApi + CryptoApi + LogApi + Clone + 'static,

source§

fn call(&self, fn_name: &[u8]) -> bool

source§

fn clone_contract(&self) -> Box<dyn CallableContract<T>>

source§

fn into_api(self: Box<Self>) -> T

source§

impl<T, BigInt, BigUint> ContractSelfApi<BigInt, BigUint> for UsersModuleImpl<T, BigInt, BigUint>
where for<'b> BigUint: BigUintApi + 'static + AddAssign<&'b BigUint> + SubAssign<&'b BigUint> + MulAssign<&'b BigUint> + DivAssign<&'b BigUint> + RemAssign<&'b BigUint> + BitAndAssign<&'b BigUint> + BitOrAssign<&'b BigUint> + BitXorAssign<&'b BigUint>, for<'a, 'b> &'a BigUint: Add<&'b BigUint, Output = BigUint> + Sub<&'b BigUint, Output = BigUint> + Mul<&'b BigUint, Output = BigUint> + Div<&'b BigUint, Output = BigUint> + Rem<&'b BigUint, Output = BigUint> + BitAnd<&'b BigUint, Output = BigUint> + BitOr<&'b BigUint, Output = BigUint> + BitXor<&'b BigUint, Output = BigUint> + Shr<usize, Output = BigUint> + Shl<usize, Output = BigUint>, for<'b> BigInt: BigIntApi<BigUint> + 'static + AddAssign<&'b BigInt> + SubAssign<&'b BigInt> + MulAssign<&'b BigInt> + DivAssign<&'b BigInt> + RemAssign<&'b BigInt>, for<'a, 'b> &'a BigInt: Add<&'b BigInt, Output = BigInt> + Sub<&'b BigInt, Output = BigInt> + Mul<&'b BigInt, Output = BigInt> + Div<&'b BigInt, Output = BigInt> + Rem<&'b BigInt, Output = BigInt>, T: ContractSelfApi<BigInt, BigUint> + ErrorApi + BlockchainApi<BigUint> + CallValueApi<BigUint> + SendApi<BigUint> + EndpointArgumentApi + EndpointFinishApi + StorageReadApi + StorageWriteApi + CryptoApi + LogApi + Clone + 'static,

§

type Storage = <T as ContractSelfApi<BigInt, BigUint>>::Storage

Abstracts the lower-level storage functionality.
§

type CallValue = <T as ContractSelfApi<BigInt, BigUint>>::CallValue

Abstracts the call value handling at the beginning of a function call.
§

type SendApi = <T as ContractSelfApi<BigInt, BigUint>>::SendApi

Abstracts the sending of MOAX & DCT transactions, as well as async calls.
§

type BlockchainApi = <T as ContractSelfApi<BigInt, BigUint>>::BlockchainApi

§

type CryptoApi = <T as ContractSelfApi<BigInt, BigUint>>::CryptoApi

source§

fn get_storage_raw(&self) -> Self::Storage

Gateway into the lower-level storage functionality. Storage related annotations make use of this. Using it directly is not recommended.
source§

fn call_value(&self) -> Self::CallValue

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) -> Self::SendApi

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

fn blockchain(&self) -> Self::BlockchainApi

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

fn crypto(&self) -> Self::CryptoApi

Stateless crypto functions provided by the Arwen VM.
source§

fn storage_load_cumulated_validator_reward(&self) -> BigUint

Retrieves validator rewards, as set by the protocol. TODO: move to the storage API, once BigUint gets refactored
source§

impl<T, BigInt, BigUint> ContractWithAbi for UsersModuleImpl<T, BigInt, BigUint>
where for<'b> BigUint: BigUintApi + 'static + AddAssign<&'b BigUint> + SubAssign<&'b BigUint> + MulAssign<&'b BigUint> + DivAssign<&'b BigUint> + RemAssign<&'b BigUint> + BitAndAssign<&'b BigUint> + BitOrAssign<&'b BigUint> + BitXorAssign<&'b BigUint>, for<'a, 'b> &'a BigUint: Add<&'b BigUint, Output = BigUint> + Sub<&'b BigUint, Output = BigUint> + Mul<&'b BigUint, Output = BigUint> + Div<&'b BigUint, Output = BigUint> + Rem<&'b BigUint, Output = BigUint> + BitAnd<&'b BigUint, Output = BigUint> + BitOr<&'b BigUint, Output = BigUint> + BitXor<&'b BigUint, Output = BigUint> + Shr<usize, Output = BigUint> + Shl<usize, Output = BigUint>, for<'b> BigInt: BigIntApi<BigUint> + 'static + AddAssign<&'b BigInt> + SubAssign<&'b BigInt> + MulAssign<&'b BigInt> + DivAssign<&'b BigInt> + RemAssign<&'b BigInt>, for<'a, 'b> &'a BigInt: Add<&'b BigInt, Output = BigInt> + Sub<&'b BigInt, Output = BigInt> + Mul<&'b BigInt, Output = BigInt> + Div<&'b BigInt, Output = BigInt> + Rem<&'b BigInt, Output = BigInt>, T: ContractSelfApi<BigInt, BigUint> + ErrorApi + BlockchainApi<BigUint> + CallValueApi<BigUint> + SendApi<BigUint> + EndpointArgumentApi + EndpointFinishApi + StorageReadApi + StorageWriteApi + CryptoApi + LogApi + Clone + 'static,

§

type Storage = <T as ContractSelfApi<BigInt, BigUint>>::Storage

The generated ABI generation code sometimes references the contract storage manager type, e.g. with storage mappers.
source§

fn abi(&self, include_modules: bool) -> ContractAbi

Generate a raw ABI object. Contracts would not call this function, so it never ends up in the wasm bytecode. It is, however, still no_std.
source§

impl<T, BigInt, BigUint> UsersModule<T, BigInt, BigUint> for UsersModuleImpl<T, BigInt, BigUint>
where for<'b> BigUint: BigUintApi + 'static + AddAssign<&'b BigUint> + SubAssign<&'b BigUint> + MulAssign<&'b BigUint> + DivAssign<&'b BigUint> + RemAssign<&'b BigUint> + BitAndAssign<&'b BigUint> + BitOrAssign<&'b BigUint> + BitXorAssign<&'b BigUint>, for<'a, 'b> &'a BigUint: Add<&'b BigUint, Output = BigUint> + Sub<&'b BigUint, Output = BigUint> + Mul<&'b BigUint, Output = BigUint> + Div<&'b BigUint, Output = BigUint> + Rem<&'b BigUint, Output = BigUint> + BitAnd<&'b BigUint, Output = BigUint> + BitOr<&'b BigUint, Output = BigUint> + BitXor<&'b BigUint, Output = BigUint> + Shr<usize, Output = BigUint> + Shl<usize, Output = BigUint>, for<'b> BigInt: BigIntApi<BigUint> + 'static + AddAssign<&'b BigInt> + SubAssign<&'b BigInt> + MulAssign<&'b BigInt> + DivAssign<&'b BigInt> + RemAssign<&'b BigInt>, for<'a, 'b> &'a BigInt: Add<&'b BigInt, Output = BigInt> + Sub<&'b BigInt, Output = BigInt> + Mul<&'b BigInt, Output = BigInt> + Div<&'b BigInt, Output = BigInt> + Rem<&'b BigInt, Output = BigInt>, T: ContractSelfApi<BigInt, BigUint> + ErrorApi + BlockchainApi<BigUint> + CallValueApi<BigUint> + SendApi<BigUint> + EndpointArgumentApi + EndpointFinishApi + StorageReadApi + StorageWriteApi + CryptoApi + LogApi + Clone + 'static,

source§

fn get_user_id(&self, address: &Address) -> usize

source§

fn set_user_id(&self, address: &Address, user_id: usize)

source§

fn get_user_address(&self, user_id: usize) -> Address

source§

fn set_user_address(&self, user_id: usize, address: &Address)

source§

fn get_num_users(&self) -> usize

source§

fn set_num_users(&self, num_users: usize)

source§

fn callback(&self)

source§

fn callbacks(&self) -> CallbackProxies<T, BigInt, BigUint>

source§

fn get_or_create_user(&self, address: &Address) -> usize

source§

fn update_user_address(&self, addresses: VarArgs<Address>) -> SCResult<()>

Auto Trait Implementations§

§

impl<T, BigInt, BigUint> RefUnwindSafe for UsersModuleImpl<T, BigInt, BigUint>
where BigInt: RefUnwindSafe, BigUint: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, BigInt, BigUint> Send for UsersModuleImpl<T, BigInt, BigUint>
where BigInt: Send, BigUint: Send, T: Send,

§

impl<T, BigInt, BigUint> Sync for UsersModuleImpl<T, BigInt, BigUint>
where BigInt: Sync, BigUint: Sync, T: Sync,

§

impl<T, BigInt, BigUint> Unpin for UsersModuleImpl<T, BigInt, BigUint>
where BigInt: Unpin, BigUint: Unpin, T: Unpin,

§

impl<T, BigInt, BigUint> UnwindSafe for UsersModuleImpl<T, BigInt, BigUint>
where BigInt: UnwindSafe, BigUint: UnwindSafe, T: 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>,

§

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>,

§

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.