ab_contracts_common

Trait Contract

Source
pub trait Contract: IoType {
    type Slot: IoType;
    type Tmp: IoType;

    const MAIN_CONTRACT_METADATA: &[u8];
    const CRATE_NAME: &str;
}
Expand description

A trait that indicates the struct is a contact.

Do not implement this trait explicitly! Implementation is automatically generated by the macro which generates smart contract implementation. This trait is required, but not sufficient for proper contract implementation, use #[contract] attribute macro instead.

Required Associated Constants§

Source

const MAIN_CONTRACT_METADATA: &[u8]

Main contract metadata, see ContractMetadataKind for encoding details.

More metadata can be contributed by trait implementations.

Source

const CRATE_NAME: &str

Name of the crate where contact is located.

NOTE: It is unlikely to be necessary to interact with this directly.

Required Associated Types§

Source

type Slot: IoType

Slot type used by this contract

Source

type Tmp: IoType

Tmp type used by this contract

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§