Crate concordium_std_derive[][src]

Attribute Macros

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].

contract_state

Marks a type as the contract state. Currently only used for generating the schema of the contract state. If the feature build-schema is not enabled this has no effect.

init

Derive the appropriate export for an annotated init function.

receive

Derive the appropriate export for an annotated receive function.

Derive Macros

Deserial

Derive the Deserial trait. See the documentation of derive(Serial) 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. If the feature build-schema is not enabled this is a no-op, i.e., it does not produce any code.

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.