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§
Sourceconst MAIN_CONTRACT_METADATA: &[u8]
const MAIN_CONTRACT_METADATA: &[u8]
Main contract metadata, see ContractMetadataKind
for encoding details.
More metadata can be contributed by trait implementations.
Sourceconst CRATE_NAME: &str
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§
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.