pub struct UniversalContractObj<A>where
    A: VMApi,{ /* private fields */ }
Expand description

A unique empty structure that automatically implements all smart contract traits.

The smart contract macros will automatically also generate trait implementations for this type. These include:

  • the contract trait
  • the AutoImpl trait
  • the EndpointWrappers trait

When generating WASM, this contract implementation is used. This makes sure no monomorphization-induced code duplication occurs in relation to modules.

Implementations§

source§

impl<A> UniversalContractObj<A>where A: VMApi,

source

pub fn new() -> Self

Trait Implementations§

source§

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

§

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 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> Default for UniversalContractObj<A>where A: VMApi,

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<A> CodecFromSelf for UniversalContractObj<A>where A: CodecFromSelf,

§

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

§

impl<A> Send for UniversalContractObj<A>where A: Send,

§

impl<A> Sync for UniversalContractObj<A>where A: Sync,

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.