pub trait ContractTraitDefinition {
const METADATA: &[u8];
}
Expand description
A trait that is implemented for dyn ContractTrait
and includes constants related to trait
definition.
dyn ContractTrait
here is a bit of a hack that allows treating a trait as a type. These
constants specifically can’t be implemented on a trait itself because that’ll make trait
not object safe, which is needed for ContractTrait
that uses a similar hack with
dyn ContractTrait
.
Do not implement this trait explicitly! Implementation is automatically generated by the
macro which generates trait definition. This trait is required, but not sufficient for
proper trait implementation, use #[contract]
attribute macro instead.
NOTE: It is unlikely to be necessary to interact with this directly.
Required Associated Constants§
Sourceconst METADATA: &[u8]
const METADATA: &[u8]
Trait metadata, see ContractMetadataKind
for encoding details“]
Trait metadata, see ContractMetadataKind
for encoding details“]
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.