Crate concordium_contracts_common_derive

Crate concordium_contracts_common_derive 

Source

Attribute Macros§

concordium_cfg_not_test
If wasm-test feature of concordium-std is enabled ignore the item, this usually happens when executing tests with cargo-concordium utility. Otherwise this is equivalent to #[cfg(not(test))]. Use as a dual to #[concordium_cfg_test].
concordium_cfg_test
Sets the cfg for testing targeting either Wasm and native.
concordium_test
Derive the appropriate export for an annotated test function, when feature “wasm-test” is enabled, otherwise behaves like #[test].
init
Derive the appropriate export for an annotated init function.
receive
Derive the appropriate export for an annotated receive function.

Derive Macros§

Deletable
Derive the Deletable trait. See the documentation of derive(Deletable) for details and limitations.
Deserial
Derive the Deserial trait. See the documentation of derive(Serial) for details and limitations.
DeserialWithState
Derive the DeserialWithState trait. See the documentation of derive(Deserial) for details and limitations.
Reject
Derive the conversion of enums that represent error types into the Reject struct which can be used as the error type of init and receive functions. Creating custom enums for error types can provide meaningful error messages to the user of the smart contract.
SchemaType
Derive the SchemaType trait for a type with a schema::Type matching the implementation when deriving Serial.
Serial
Derive the Serial trait for the type.
Serialize
A helper macro to derive both the Serial and Deserial traits. [derive(Serialize)] is equivalent to [derive(Serial, Deserial)], see documentation of the latter two for details and options: derive(Serial), derive(Deserial).