Attribute Macro ink::scale_derive

Expand description

Derive the re-exported traits ink::scale::Encode, ink::scale::Decode and ink::scale_info::TypeInfo. It enables using the built in derive macros for these traits without depending directly on the parity-scale-codec and scale-info crates.


  • encode: derives ink::scale::Encode
  • decode: derives ink::scale::Decode
  • type_info: derives ink::scale_info::TypeInfo


#[ink::scale_derive(Encode, Decode, TypeInfo)]
pub enum Error {}

This is a convenience macro that expands to include the additional crate attributes required for the path of the re-exported crates.

#[derive(::ink::scale::Encode, ::ink::scale::Decode)]
#[codec(crate = ::ink::scale)]
  feature = "std",
  scale_info(crate = ::ink::scale_info)
pub enum Error {}